Main Page | Class List | Directories | File List | Class Members | File Members

newt-module.c File Reference

#include <stdio.h>
#include <slang.h>
#include <newt.h>

Go to the source code of this file.

Defines

#define I   SLANG_INT_TYPE
#define S   SLANG_STRING_TYPE

Functions

 SLANG_MODULE (newt)
static void init (void)
static void cls (void)
static void draw_root_text (int *c, int *r, char *s)
static void open_window (int *c, int *r, int *dc, int *dr, char *title)
static void refresh (void)
static void finished (void)
int init_newt_module_ns (char *ns)
void deinit_newt_module (void)

Variables

static int Ok_To_Draw
static SLang_Intrin_Fun_Type Module_Funs []
static SLang_Intrin_Var_Type Module_Variables []
static SLang_IConstant_Type Module_Constants []


Define Documentation

#define I   SLANG_INT_TYPE
 

Definition at line 47 of file newt-module.c.

#define S   SLANG_STRING_TYPE
 

Definition at line 48 of file newt-module.c.

Referenced by cputurn(), initgame(), and randomplace().


Function Documentation

static void cls void   )  [static]
 

Definition at line 16 of file newt-module.c.

References Ok_To_Draw.

00017 {
00018    if (Ok_To_Draw)
00019      newtCls ();
00020 }

void deinit_newt_module void   ) 
 

Definition at line 88 of file newt-module.c.

References finished().

00089 {
00090    finished ();
00091 }

static void draw_root_text int *  c,
int *  r,
char *  s
[static]
 

Definition at line 22 of file newt-module.c.

References Ok_To_Draw.

00023 {
00024    if (Ok_To_Draw)
00025      newtDrawRootText (*c, *r, s);
00026 }

static void finished void   )  [static]
 

Definition at line 40 of file newt-module.c.

References Ok_To_Draw.

Referenced by deinit_newt_module(), and init_newt_module_ns().

00041 {
00042    if (Ok_To_Draw)
00043      newtFinished ();
00044    Ok_To_Draw = 0;
00045 }

static void init void   )  [static]
 

Definition at line 10 of file newt-module.c.

References Ok_To_Draw.

Referenced by main().

00011 {
00012    newtInit ();
00013    Ok_To_Draw = 1;
00014 }

int init_newt_module_ns char *  ns  ) 
 

Definition at line 73 of file newt-module.c.

References finished(), Ok_To_Draw, SLang_add_cleanup_function(), SLns_add_iconstant_table(), SLns_add_intrin_fun_table(), and SLns_add_intrin_var_table().

00074 {
00075    if ((-1 == SLns_add_intrin_fun_table (ns, Module_Funs, "__NEWT__"))
00076        || (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL))
00077        || (-1 == SLns_add_iconstant_table (ns, Module_Constants, NULL)))
00078      return -1;
00079    
00080    Ok_To_Draw = 0;
00081 
00082    (void) SLang_add_cleanup_function (finished);
00083 
00084    return 0;
00085 }

static void open_window int *  c,
int *  r,
int *  dc,
int *  dr,
char *  title
[static]
 

Definition at line 28 of file newt-module.c.

References Ok_To_Draw.

00029 {
00030    if (Ok_To_Draw)
00031      newtOpenWindow (*c, *r, *dc, *dr, title);
00032 }

static void refresh void   )  [static]
 

Definition at line 34 of file newt-module.c.

References Ok_To_Draw.

00035 {
00036    if (Ok_To_Draw)
00037      newtRefresh ();
00038 }

SLANG_MODULE newt   ) 
 


Variable Documentation

SLang_IConstant_Type Module_Constants[] [static]
 

Initial value:

Definition at line 67 of file newt-module.c.

SLang_Intrin_Fun_Type Module_Funs[] [static]
 

Initial value:

Definition at line 50 of file newt-module.c.

SLang_Intrin_Var_Type Module_Variables[] [static]
 

Initial value:

Definition at line 62 of file newt-module.c.

int Ok_To_Draw [static]
 

Definition at line 8 of file newt-module.c.

Referenced by cls(), draw_root_text(), finished(), init(), init_newt_module_ns(), open_window(), and refresh().


© sourcejam.com 2005-2008