home *** CD-ROM | disk | FTP | other *** search
- /*
- * Structure for the manipulation of a record within 1 Table
- */
- struct _table
- {
- #ifdef ANSI
- int (*inp_fn)(int , struct _table *, struct a_line **, struct a_line **, int);
- int (*add_fn)(struct _table *, struct a_line **, struct a_line **);
- int (*chg_fn)(struct _table *, struct a_line **, struct a_line **);
- void (*dsp_fn)(int, int);
- void (*key_fn)(int);
- void (*sel_fn)(void);
- int (*goto_fn)(int *);
- void (*extra_fn)(void);
- #else
- int (*inp_fn)(); /* Input Function */
- int (*add_fn)(); /* Add Record */
- int (*chg_fn)(); /* Update Record */
- void (*dsp_fn)(); /* Display Record */
- void (*key_fn)(); /* Key Input */
- void (*sel_fn)(); /* Key Selection */
- int (*goto_fn)(); /* Conditional Goto */
- void (*extra_fn)(); /* Date/Time */
- #endif
- struct fldinfx *fld_off; /* Field Information */
- unsigned int perms; /* Access Permissions */
- int retry; /* Number of Retries on Lock */
- int fd; /* File Descriptor */
- int fn; /* ??? */
- int maximum; /* Records on 1 Screen */
- int size; /* Record Length */
- int mode; /* Read Mode */
- int uniquekey; /* A Unique Key */
- int query_box; /* if set then use query box */
- int messages; /* if set then no_msg = FALSE */
- int auto_exit; /* exit x-ref wr. on last fld */
- int no_menus; /* no_menus on x-ref write */
- int page; /* allows paging if set */
- int tp; /* transaction processing ? */
- int *offset; /* -> Index of Parent Record */
- int *keynum; /* -> Active Key */
- int *keymatch; /* -> Active Keymatch */
- int *seq; /* -> Reading Sequence */
- int *index; /* -> Index of Current Record */
- char *rec; /* -> Physical Data */
- };
-
- /*
- * Defines paramaters regarding 1 field to be displayed on
- * the screen.
- */
- struct ipf
- {
- short screen; /* Screen Number */
- short dep;
- #ifdef ANSI
- int (*ip_fn)(int, int, int, struct _table *, struct fldinfx *, struct a_line **);
- #else
- int (*ip_fn)(); /* Data Entry Routine */
- #endif
- short table; /* Which Table */
- short t_num; /* Index into fldinfx structure */
- };
-
- # define FORWARD 1
- # define BACKWARD 0
-
- # define ASCENDING 1
- # define DESCENDING 0
-
- # define MAX_FNS 11
-
- # define ESC -1
- # define ADD -2
- # define CHG -3
- # define INQ -4
- # define DSP -5
- # define RET -6
- # define CLR -7
- # define VNULL (void (*)())0
-
- /*
- * Prototypes
- */
- # ifdef ANSI
- int add_mode(struct _table *, struct a_line **, struct a_line **, int, int);
- int add_record(struct _table *, struct a_line **, struct a_line **);
- int add_batch(struct _table *, struct a_line **, struct a_line **);
- int auto_mode(FIELD *, struct _table *, struct a_line **, struct a_line **, struct fldinfx *);
- int change_mode(struct _table *, struct a_line **, struct a_line **, int, int);
- int default_mode(struct _table *, struct a_line **, struct a_line **, int,int);
- int delete_batch(struct _table *, struct a_line **, struct a_line **);
- int delete_mode(struct _table *, struct a_line **,struct a_line **, int, int);
- int fill_list_mode(struct _table *, struct a_line **, struct a_line **);
- int first_mode(struct _table *, struct a_line **,struct a_line **, int, int);
- int inquire_mode(struct _table *, struct a_line **,struct a_line **, int, int);
- int last_mode(struct _table *, struct a_line **,struct a_line **, int, int);
- int make_list(struct _table *, struct a_line **, struct a_line **);
- int next_mode(struct _table *, struct a_line ** ,struct a_line ** , int, int);
- int prev_mode(struct _table *, struct a_line ** ,struct a_line ** , int, int);
- int rewrite_mode(struct _table *, struct a_line **,struct a_line **);
- int rewrite_batch(struct _table *, struct a_line **,struct a_line **);
- struct a_line *scan_table(struct _table *, struct a_line **, struct a_line **, int);
- void after_input(FIELD *, struct _table *, struct fldinfx *);
- void before_input(FIELD *, struct _table *, struct fldinfx *);
- void delete_list(struct _table *, struct a_line **, struct a_line **, int *);
- void do_page_mode(struct _table *, struct a_line **,struct a_line **, int);
- void freelist_mode(struct _table *, struct a_line **,struct a_line **);
- void head_list(struct _table *, struct a_line **,struct a_line **, int);
- void new_line(struct _table *, struct a_line **,struct a_line ** );
- void new_line_2(struct _table *, struct a_line **,struct a_line ** );
- void new_record(struct _table *, struct a_line **,struct a_line ** );
- void reorder_mode(struct _table *, struct a_line **,struct a_line **, int );
- void tag_on_record(struct _table *, struct a_line **,struct a_line **, int );
- void table_defaults(struct _table *);
- int start_field(int, struct ipf *);
- int end_field(int, struct ipf *);
- int get_ipidx(int, int, struct ipf *);
- void next_field(int *, int, struct ipf *);
- void prev_field(int *, int, struct ipf *);
- int do_goptions(struct optab *, int, int, ...);
- void valid_field(int *, int, struct ipf *);
- void tran_p(struct _table *);
- void roll_p(struct _table *);
- void comm_p(struct _table *);
- # else
- int add_mode();
- int add_record();
- int add_batch();
- int auto_mode();
- int change_mode();
- int default_mode();
- int delete_mode();
- int fill_list_mode();
- int first_mode();
- int get_ipidx();
- int inquire_mode();
- int last_mode();
- int make_list();
- int next_mode();
- int prev_mode();
- int rewrite_mode();
- int rewrite_batch();
- struct a_line *scan_table();
- void after_input();
- void before_input();
- void delete_list();
- void do_page_mode();
- void freelist_mode();
- void head_list();
- void new_line();
- void new_line_2();
- void new_record();
- void reorder_mode();
- void tag_on_record();
- void table_defaults();
- int start_field();
- int end_field();
- void next_field();
- void prev_field();
- int do_goptions();
- void valid_field();
- void tran_p();
- void roll_p();
- void comm_p();
- # endif
-