home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / PROCINST.ZIP / HELP.ZIP / TABLE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-10  |  5.9 KB  |  119 lines

  1. /*
  2.  * Structure for the manipulation of a record within 1 Table
  3. */
  4. struct _table
  5. {
  6.     PROTO (int (*inp_fn), (int , struct _table *, struct a_line **, struct a_line **, int));
  7.     PROTO (int (*add_fn), (struct _table *, struct a_line **, struct a_line **));
  8.     PROTO (int (*chg_fn), (struct _table *, struct a_line **, struct a_line **));
  9.     PROTO (void (*dsp_fn), (int, int));
  10.     PROTO (void (*key_fn), (int));
  11.     PROTO (void (*sel_fn), (void));
  12.     PROTO (int (*goto_fn), (int *));
  13.     PROTO (void (*extra_fn), (void));
  14.  
  15.     struct fldinfx *fld_off;  /* Field Information          */
  16.     unsigned int perms;       /* Access Permissions         */
  17.     int retry;                /* Number of Retries on Lock  */
  18.     int fd;                   /* File Descriptor            */
  19.     int fn;                   /* Max. No. to read : period  */
  20.     int tabno;                /* Table Number               */
  21.     int maximum;              /* Records on 1 Screen        */
  22.     int size;                 /* Record Length              */
  23.     int mode;                 /* Read Mode                  */
  24.     int uniquekey;            /* A Unique Key               */
  25.     int query_box;            /* if set then use query box  */
  26.     int messages;             /* if set then no_msg = FALSE */
  27.     int auto_exit;            /* exit x-ref wr. on last fld */
  28.     int no_menus;             /* no_menus on x-ref write    */
  29.     int page;                 /* allows paging if set       */
  30.     int tp;                   /* transaction processing ?   */
  31.     int *offset;              /* -> Index of Parent Record  */
  32.     int *keynum;              /* -> Active Key              */
  33.     int *keymatch;            /* -> Active Keymatch         */
  34.     int *seq;                 /* -> Reading Sequence        */
  35.     int *index;               /* -> Index of Current Record */
  36.     char *rec;                /* -> Physical Data           */
  37. };
  38.  
  39. /*
  40.  * Defines paramaters regarding 1 field to be displayed on
  41.  * the screen.
  42. */
  43. struct ipf
  44. {
  45.     short screen;             /* Screen Number                */
  46.     short dep;
  47.     PROTO (int (*ip_fn), (int, int, int, struct _table *, struct fldinfx *, struct a_line **));
  48.     short table;              /* Which Table                  */
  49.     short t_num;              /* Index into fldinfx structure */
  50. };
  51.  
  52. # define FORWARD    1
  53. # define BACKWARD   0
  54.  
  55. # define ASCENDING  1
  56. # define DESCENDING 0
  57.  
  58. # define MAX_FNS    11
  59.  
  60. # define ESC       -1
  61. # define ADD       -2
  62. # define CHG       -3
  63. # define INQ       -4
  64. # define DSP       -5
  65. # define RET       -6
  66. # define CLR       -7
  67. # define VNULL      (void (*)())0
  68.  
  69. /*
  70.  * Prototypes
  71. */
  72. PROTO (int add_batch, (struct _table *, struct a_line **, struct a_line **));
  73. PROTO (int add_mode, (struct _table *, struct a_line **, struct a_line **, int, int));
  74. PROTO (int add_record, (struct _table *, struct a_line **, struct a_line **));
  75. PROTO (int auto_mode, (FIELD *, struct _table *, struct a_line **, struct a_line **, struct fldinfx *));
  76. PROTO (int change_mode, (struct _table *, struct a_line **, struct a_line **, int, int));
  77. PROTO (int default_mode, (struct _table *, struct a_line **, struct a_line **, int,int)); 
  78. PROTO (int delete_batch, (struct _table *, struct a_line **, struct a_line **));
  79. PROTO (int delete_mode, (struct _table *, struct a_line **,struct a_line **, int, int));
  80. PROTO (int do_goptions, (struct optab *, int, int, ...));
  81. PROTO (int end_field, (int, struct ipf *));
  82. PROTO (int fill_list_mode, (struct _table *, struct a_line **, struct a_line **)); 
  83. PROTO (int first_mode, (struct _table *, struct a_line **,struct a_line **, int, int));
  84. PROTO (int get_ipidx, (int, int, struct ipf *));
  85. PROTO (int inquire_mode, (struct _table *, struct a_line **,struct a_line **, int, int));
  86. PROTO (int last_mode, (struct _table *, struct a_line **,struct a_line **, int, int));
  87. PROTO (int make_list, (struct _table *, struct a_line **, struct a_line **, struct a_line *, struct a_line *)); 
  88. PROTO (int next_mode, (struct _table *, struct a_line ** ,struct a_line **, int, int));
  89. PROTO (int prev_mode, (struct _table *, struct a_line ** ,struct a_line **, int, int));
  90. PROTO (int rewrite_batch, (struct _table *, struct a_line **,struct a_line **));
  91. PROTO (int rewrite_mode, (struct _table *, struct a_line **,struct a_line **));
  92. PROTO (int start_field, (int, struct ipf *));
  93. PROTO (struct a_line *scan_table, (struct _table *, struct a_line **, struct a_line **, int));
  94. PROTO (void after_input, (FIELD *, struct _table *, struct fldinfx *));
  95. PROTO (void before_input, (FIELD *, struct _table *, struct fldinfx *));
  96. PROTO (void comm_p, (struct _table *));
  97. PROTO (void delete_list, (struct _table *, struct a_line **, struct a_line **, int *));
  98. PROTO (void do_page_mode, (struct _table *, struct a_line **,struct a_line **, int));
  99. PROTO (void freelist_mode, (struct _table *, struct a_line **,struct a_line **));
  100. PROTO (void head_list, (struct _table *, struct a_line **,struct a_line **, int));
  101. PROTO (void new_line, (struct _table *, struct a_line **,struct a_line ** ));
  102. PROTO (void new_line_2, (struct _table *, struct a_line **,struct a_line ** ));
  103. PROTO (void new_record, (struct _table *, struct a_line **,struct a_line ** ));
  104. PROTO (void next_field, (int *, int, struct ipf *));
  105. PROTO (void prev_field, (int *, int, struct ipf *));
  106. PROTO (void reorder_mode, (struct _table *, struct a_line **,struct a_line **, int ));
  107. PROTO (void roll_p, (struct _table *));
  108. PROTO (void shuffle_down, (struct _table *, struct a_line **,struct a_line **, int ));
  109. PROTO (void shuffle_up, (struct _table *, struct a_line **,struct a_line **));
  110. PROTO (void table_defaults, (struct _table *));
  111. PROTO (void tag_on_record, (struct _table *, struct a_line **,struct a_line **, int ));
  112. PROTO (void tail_list, (struct _table *, struct a_line **,struct a_line **, int));
  113. PROTO (void tran_p, (struct _table *));
  114. PROTO (void valid_field, (int *, int, struct ipf *));
  115.  
  116. PROTO (int cmp_rec, (struct _table *, struct a_line *));
  117. PROTO (int first_match_mode, (struct _table *, struct a_line **,struct a_line **, int, int));
  118.  
  119.