Subversion Repositories shark

Rev

Rev 2 | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*
 *
 *
 *
 */


int init_tokenizer(char *filename,int);

char *gettoken(void);
void ungettoken(void);

int done_tokenizer(void);

/*
 *
 *
 *
 */


int copystring(char **dstptr, char *src);

#define MAXVARIABLES 64

#define NOTYPEVAR   0
#define PRINTEDVAR  1

#define BOOLVAR     2
#define TRISTATEVAR 3
#define CHOICEVAR   4
#define RANGEVAR    5

/* FLAG_M (if this variable change value some menu must be modified) */
#define FLAG_M 0x01

#define MAXFILETABLE 16
extern char *filetable[];
extern int maxfileindex;

#define NOFILEINDEX -1

struct variable {
  int fileindex;
  int type;
  char *name;
  char *value;
  int flags;
};
extern struct variable vartable[];

struct choice {
  struct choice *next;
  char *text;
  struct variable *var;
};

struct menuentry;

struct _case {
  struct _case *next;
  char *value;
  struct menuentry *list;
};

#define BOOLENTRY      1
#define SUBMENUENTRY   2
#define TRISTATEENTRY  3
#define CHOICEENTRY    4
#define CASEENTRY      5
#define RANGEENTRY     6
#define SEPARATORENTRY 7

struct menuentry {
  int type;
  struct menuentry *next;

  struct menuentry *n;
  struct menuentry *p;

  union tagentry {

    struct boolentry {
      char *text;
      struct variable *var;
    } bool;

    struct rangeentry {
      char *text;
      int minval,maxval;
      struct variable *var;
    } range;

    struct tristateentry {
      char *text;
      struct variable *var;
    } tristate;

    struct choiceentry {
      char *text;
      int numchoices;
      struct choice *act;
      struct choice *list;
    } choice;

    struct submenuentry {
      char *text;
      char *menuname;
      struct menu *menu;
    } submenu;

    struct caseentry {
      struct _case    *list;
      struct variable *var;
    } _case;

  } x;
};

#define MAXMENUS 16

struct menu {
  char *name;
  char *title;
  struct menuentry *entries;
};
extern struct menu menutable[];

extern struct  menu *mainmenu;
extern char *caption;

int readconfigin(char *filename);

void dumpvariables(void);

extern int line;
extern int nextvariable;

struct variable *findvar(char *s);

extern long varhelp[];
extern char helpfilename[];
int findvarindex(struct variable *var);

/*
 *
 *
 *
 */


int show(void);

/*
 *
 *
 *
 */


int writeconfig(char *srcfilename);
int writeconfigmak(char *srcfilename);
int readconfig(char *filename);