home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / t / tcu_32.zip / TCU32_DB.ZIP / TCU.H < prev    next >
Text File  |  1991-08-01  |  28KB  |  544 lines

  1. /*==========================================================================*
  2.  *                                                                          *
  3.  *          Header #include file for Turbo-C Utilities version 3.2          *
  4.  *          ------------------------------------------------------          *
  5.  *                                                                          *
  6.  *                    (c) Copyright Karl Keyte, 1990-91                     *
  7.  *                                                                          *
  8.  *  Karl Keyte                           Phone:  +(49) 6150 2499            *                       *
  9.  *  Gross-Gerauer Strasse 10                                                *
  10.  *  D-6108 Weiterstadt                   e-Mail: KKEYTE@ESOC.BITNET         *
  11.  *  Germany                              Bix:    kkeyte                     *
  12.  *                                                                          *
  13.  *==========================================================================*/
  14.  
  15.  
  16. #if     !defined(__TCU__)
  17. #define __TCU__
  18.  
  19. #define TCU_BOX_SINGLE              1      /* Box bordered by single lines */
  20. #define TCU_BOX_DOUBLE              2      /* Box bordered by double lines */
  21. #define TCU_BOX_BLANK               3      /* Box bordered by spaces       */
  22.  
  23.  
  24. #define TCU_ESC_ESC              0x01      /* ESCAPE key exit */
  25. #define TCU_ESC_PGUP             0x02      /* Page Up key exit */
  26. #define TCU_ESC_PGDN             0x04      /* Page Down key exit */
  27. #define TCU_ESC_CLEFT            0x08      /* Cursor left exit */
  28. #define TCU_ESC_CRIGHT           0x10      /* Cursor right exit */
  29. #define TCU_ESC_FUNC             0x20      /* Function key exit */
  30. #define TCU_ESC_CNTL_C           0x40      /* Control-C exit */
  31. #define TCU_ESC_PULLDOWN         0x80      /* Pulldown bar selection */
  32.  
  33. #define TCU_ESC_USERKEY        0x0100      /* User defined escape key */
  34.  
  35. #define TCU_ESC_MOUSE_CLICK_L  0xE000      /* Left mouse button click */
  36. #define TCU_ESC_MOUSE_CLICK_R  0xE100      /* Right mouse button click */
  37. #define TCU_USER_DEFINED_SAVE  0xE200      /* User defined accept key */
  38. #define TCU_USER_DEFINED_ESC   0xE300      /* User defined escape key */
  39.  
  40.  
  41. #define TCU_MENU_TITLE              1      /* Title */
  42. #define TCU_MENU_BOX                2      /* Surrounding box */
  43. #define TCU_MENU_OPTION             3      /* Option line */
  44. #define TCU_MENU_SELECT             4      /* Selected option line */
  45. #define TCU_MENU_UNAVAIL            5      /* Unavailable option line */
  46.  
  47.  
  48. #define TCU_OK                      0      /* Successful TCU service */
  49. #define TCU_ERROR                   1      /* Unsuccessful TCU service */
  50.  
  51.  
  52. #define TCU_FORM_EDIT               1      /* Enable edit ability for field */
  53. #define TCU_FORM_NOEDIT             2      /* Disable edit ability for field */
  54. #define TCU_FORM_ECHO               3      /* Echo field when input */
  55. #define TCU_FORM_NOECHO             4      /* No echo on input field */
  56. #define TCU_FORM_ENTER              5      /* Enter the field in edit */
  57. #define TCU_FORM_NOENTER            6      /* Don't enter the field in edit */
  58. #define TCU_FORM_CONFIRM            7      /* Field needs ENTER to confirm */
  59. #define TCU_FORM_NOCONFIRM          8      /* No ENTER needed to confirm */
  60. #define TCU_FORM_ESCS               9      /* Escape keys work in forms */
  61. #define TCU_FORM_NOESCS            10      /* Disable escape keys in forms */
  62.  
  63. #define TCU_DB_IGNORE_CASE          1      /* Ignore case on DB searches */
  64. #define TCU_DB_NO_IGNORE_CASE       2      /* Don't ignore case */
  65. #define TCU_DB_TRIM_SPACES          3      /* Ignore trailing spaces */
  66. #define TCU_DB_NO_TRIM_SPACES       4      /* Use all spaces in search */
  67.  
  68.  
  69. #define TCU_FRM_MAXFIELD          128      /* Maximum fields on form */
  70. #define TCU_MAX_SCREEN_LINES       25      /* Number of lines on screen */
  71.  
  72.  
  73. #define TCU_FLD_INT                 1      /* Integer (32 bits) */
  74. #define TCU_FLD_FLOAT               2      /* Floating point (64 bits) */
  75. #define TCU_FLD_STRING              3      /* String, ASCIIZ format */
  76. #define TCU_FLD_DATE                4      /* Date (01.01.70 ...) */
  77. #define TCU_FLD_LOGICAL             5      /* True/False, Yes/No, On/Off */
  78. #define TCU_FLD_CHOICE              6      /* Enumerated choice type */
  79. #define TCU_FLD_BUTTON              7      /* Button selection field */
  80.  
  81.  
  82. #define TCU_FLD_DAYFIRST            1      /* Dates with day number first */
  83. #define TCU_FLD_MONTHFIRST          2      /* Dates with month number first */
  84.                                            
  85.  
  86. #define TCU_FLD_TRUEFALSE           1      /* Logicals as TRUE/FALSE */
  87. #define TCU_FLD_YESNO               2      /* Logicals as YES/NO */
  88. #define TCU_FLD_ONOFF               3      /* Logicals as ON/OFF */
  89.  
  90.  
  91. #define TCU_FLD_ESCNEXT             1      /* NEXT FIELD field edit escape */
  92. #define TCU_FLD_ESCPREV             2      /* PREVIOUS FIELD escape */
  93. #define TCU_FLD_ESCFIRST            3      /* FIRST FIELD escape */
  94. #define TCU_FLD_ESCLAST             4      /* LAST FIELD escape */
  95. #define TCU_FLD_SELECT              5      /* Field select escape */
  96. #define TCU_FLD_CLICKSELECT         6      /* Mouse click field select */
  97. #define TCU_FLD_ESCESC             -1      /* ESC key escape */
  98. #define TCU_FLD_ESCCNTLC           -2      /* CNTL/C key escape */
  99. #define TCU_FLD_ESCPGUP            -3      /* Page-Up key escape */
  100. #define TCU_FLD_ESCPGDN            -4      /* Page-Down key escape */
  101. #define TCU_FLD_FNKEYSAVE          -5      /* Function key save escape */
  102. #define TCU_FLD_FNKEYESC           -6      /* Function key abort escape */
  103. #define TCU_FLD_BUTTONSAVE         -7      /* Button save escape */
  104. #define TCU_FLD_BUTTONESC          -8      /* Button abort escape */
  105. #define TCU_FLD_USERSAVE           -9      /* User defined accept key */
  106. #define TCU_FLD_USERESC           -10      /* User defined escape key */
  107.  
  108.  
  109. typedef struct {
  110.    short               x, y;               /* X and Y coords of current pos */
  111.    short               height,             /* External size of menu */
  112.                        width;              /* External width of menu */
  113.    char               *title;              /* Title of menu */
  114.    unsigned char       title_attrib,       /* Attributes of title */
  115.                        box_attrib,         /* Attributes of surrounding box */
  116.                        option_attrib,      /* Attributes of menu option */
  117.                        select_attrib,      /* Attributes of selected option */
  118.                        unavail_attrib;     /* Attributes of unavailables */
  119.    unsigned char       escape_keys;        /* Keys which allow exit */
  120.    unsigned char       box_type;           /* Type of external box */
  121.    unsigned char       last_selection;     /* Last selected option */
  122.    void far          (*help_fn)(int);      /* User's help function */
  123.    char              **options;            /* Pointer to list of options */
  124.    unsigned char      *cover_zone;         /* Pointer to covered screen */
  125.    unsigned char       short_code;         /* Flags if short code select on */
  126.    unsigned long       option_avail;       /* Option availability flags */
  127. } TCU_MENU;
  128.  
  129.  
  130. typedef struct {
  131.    int                 in_use;             /* Flags current use mode */
  132.    char               *cover_zone,
  133.                       *title;
  134.    int                 height,
  135.                        width;
  136.    unsigned char       box_attrib,
  137.                        window_attrib,
  138.                        input_attrib,
  139.                        title_attrib,
  140.                        box_type;
  141.    unsigned char       with_input;
  142.    int                 input_x,
  143.                        input_y;
  144.    char               *input_str;
  145.    char               *txt_line[TCU_MAX_SCREEN_LINES - 2];
  146.    int                 txt_lines;
  147. } TCU_NOTICE;
  148.  
  149.  
  150. typedef struct {
  151.    int                 in_use;             /* Flags current use mode */
  152.    char               *cover_zone;
  153.    char               *title;
  154.    int                 cursor_x,
  155.                        cursor_y,
  156.                height,
  157.                        width,
  158.                        pos_x,
  159.                        pos_y;
  160.    unsigned char       box_attrib,
  161.                        title_attrib,
  162.                        window_attrib,
  163.                        box_type;
  164. } TCU_WINDOW;
  165.  
  166.  
  167. typedef struct {
  168.    unsigned char       linecolour,         /* Colour of header line */
  169.                        optioncolour,       /* Colour of possible options */
  170.                        selectcolour;       /* Colour of selected option */
  171.    char              **headings;           /* List of header titles */
  172.    TCU_MENU          **menus;              /* List of menus */
  173.    void far          (*help_fn)(int);      /* User's help function */
  174.    unsigned char       selected,           /* Currently selected menu */
  175.                        use_mode;           /* Current mode of use */
  176.    unsigned char      *cover_zone;         /* Screen contents area */
  177.    unsigned char       short_code;         /* Flags if short code select on */
  178. } TCU_PULLDOWN;
  179.  
  180.  
  181. typedef struct {
  182.    unsigned char       sel,                /* Selected choice */
  183.                        max;                /* Maximum choices available */
  184.    char               *str;                /* String of separated choices */
  185. } TCU_CHOICE_TYPE;
  186.  
  187.  
  188. typedef union {
  189.    long                v_int;              /* Integer field value */
  190.    double              v_float;            /* Floating field value */
  191.    char               *v_string;           /* String field value */
  192.    unsigned short      v_date;             /* Date value (days -> 01.01.70) */
  193.    unsigned char       v_logical;          /* Logical field value */
  194.    TCU_CHOICE_TYPE     v_choice;           /* Enumerated choice type */
  195. } TCU_FIELD_VALUE;
  196.  
  197.  
  198. typedef struct {
  199.    char                   f_name[9];       /* Field name */
  200.    unsigned char          f_type,          /* Type of field */
  201.                           f_size,          /* Width of field on screen */
  202.                           f_decimal,       /* Decimal places if numeric */
  203.                           f_present,       /* Presentation form of data */
  204.                           f_xpos,          /* Window x-coordinate */
  205.                           f_ypos;          /* Window y-coordinate */
  206.    unsigned char          f_usemin,        /* Flags use of minimum range */
  207.                           f_usemax,        /* Flags use of maximum range */
  208.                           f_useval,        /* Flags if initial value used */
  209.                           f_usetmp;        /* Flags if string template used */
  210.    union {
  211.       struct {
  212.          long             f_min,           /* Minimum value */
  213.                           f_max;           /* Maximum value */
  214.       } i;
  215.       struct {
  216.          double           f_min,           /* Minimum value */
  217.                           f_max;           /* Maximum value */
  218.       } f;
  219.       struct {
  220.          unsigned short   f_min,           /* Minimum value */
  221.                           f_max;           /* Maximum value */
  222.       } d;
  223.    } range;
  224.    unsigned char          f_colour,        /* Colour attributes */
  225.                           f_editcolour;    /* Colour during field editing */
  226.    struct {
  227.       unsigned int        a_ronly : 1,     /* Read only flag */
  228.                           a_noecho : 1,    /* No-echo input flag */
  229.                           a_fixtext : 1,   /* Fixed text field flag */
  230.                           a_param : 1,     /* Non-editable variable field */
  231.                           a_confirm : 1;   /* ENTER confirmation needed flag */
  232.    } attrib;
  233.    TCU_FIELD_VALUE        val;             /* Value of field */
  234.    unsigned char          dummy;           /* Marker for start of pointers */
  235.    char                  *f_template;      /* Template for string inputs */
  236. } TCU_FIELD;
  237.  
  238.  
  239. typedef struct {
  240.    unsigned int           num_fields;      /* Number of fields */
  241.    unsigned char          colour,          /* Colour attribute */
  242.                           input_colour;    /* Input field colour default */
  243.    char                   title[77];       /* Form title string */
  244.    unsigned char          xpos,            /* x-coordinate on screen */
  245.                           ypos,            /* y-coordinate on screen */
  246.                           height,          /* Height of form */
  247.                           width,           /* Width of form */
  248.                           type,            /* Form surround type */
  249.                           title_attrib,    /* Colour attributes for title */
  250.                           current_field,   /* Current field with focus */
  251.                           use_mode;        /* Flags whether in use/displayed */
  252.    struct {
  253.       unsigned int        ronly : 1,       /* Form is read only */
  254.                           no_esc : 1;      /* No direct escape keys allowed */
  255.    } attrib;
  256.    unsigned char          dummy;           /* Marker for start of pointers */
  257.    TCU_FIELD             *field[TCU_FRM_MAXFIELD]; /* Fields */
  258.    int far              (*verify_fn)
  259.                             (void *, int, TCU_FIELD_VALUE *); /* verify fn */
  260.    void far             (*help_fn)
  261.                             (void *, int);         /* User's help function */
  262.    int far              (*fn_key_fn)
  263.                             (void *, int, int);    /* Function key handler */
  264.    int far              (*button_fn)
  265.                             (void *, int);         /* Button select handler */
  266.    unsigned char         *cover_zone;      /* Screen cover buffer */
  267. } TCU_FORM;
  268.  
  269.  
  270. typedef struct {
  271.    char                   name[9];         /* Field name */
  272.    unsigned char          type,            /* Type of field */
  273.                           size,            /* Width of field on screen */
  274.                           decimal,         /* Decimal places if numeric */
  275.                           present,         /* Presentation form of data */
  276.                           xpos,            /* Window x-coordinate */
  277.                           ypos,            /* Window y-coordinate */
  278.                           usemin,          /* Flags use of minimum range */
  279.                           usemax,          /* Flags use of maximum range */
  280.                           useval,          /* Flags if initial value used */
  281.                           usetmp;          /* Flags if string template used */
  282.    union {
  283.       struct {
  284.          long             min,             /* Minimum value */
  285.                           max;             /* Maximum value */
  286.       } i;
  287.       struct {
  288.          double           min,             /* Minimum value */
  289.                           max;             /* Maximum value */
  290.       } f;
  291.       struct {
  292.          unsigned short   min,             /* Minimum value */
  293.                           max;             /* Maximum value */
  294.       } d;
  295.    } range;
  296.    unsigned char          colour,          /* Colour attributes */
  297.                           editcolour;      /* Colour during field editing */
  298.    struct {
  299.       unsigned int        ronly : 1,       /* Read only flag */
  300.                           noecho : 1,      /* No-echo input flag */
  301.                           fixtext : 1,     /* Fixed text field flag */
  302.                           param : 1,       /* Non-editable variable field */
  303.                           confirm : 1;     /* ENTER confirmation needed flag */
  304.    } attr;
  305.    TCU_FIELD_VALUE        val;             /* Value of field */
  306. } TCU_FIELD_INFO;
  307.  
  308.  
  309. typedef struct {
  310.    unsigned int           num_fields;      /* Number of fields */
  311.    char                  *title;           /* Title string of form */
  312.    unsigned char          text_colour,     /* Colour attribute */
  313.                           field_colour,    /* Input field colour default */
  314.                           title_colour,    /* Title string colour */
  315.                           xpos,            /* x-coordinate on screen */
  316.                           ypos,            /* y-coordinate on screen */
  317.                           height,          /* Height of form */
  318.                           width,           /* Width of form */
  319.                           box_type,        /* Form surround type */
  320.                           mode,            /* Flags whether in use/displayed */
  321.                           verify_fn,       /* Verification function active */
  322.                           help_fn,         /* Help function active */
  323.                           fn_key_fn,       /* 1 if fn. key handler active */
  324.                           button_fn;       /* 1 if button select handler */
  325.    struct {
  326.       unsigned int        ronly : 1,       /* Form is read only */
  327.                           no_esc : 1;      /* Escape keys disabled */
  328.    } attr;
  329. } TCU_FORM_INFO;
  330.  
  331.  
  332. typedef struct {
  333.    long            db_next,                /* Next free database slot */
  334.                    db_current;             /* Current location of ptr */
  335.    TCU_FORM       *form_ref,               /* Pointer to registered form */
  336.                   *temp_form;              /* Copy of above during form edit */
  337.    char           *formbuf,                /* Pointer to field buffer */
  338.                   *index;                  /* Pointer to b-tree index */
  339.    int             db_file,                /* Database file handle */
  340.                    db_recsize;             /* Size of form record */
  341.    unsigned short  db_idxdir;              /* Sort direction for keys */
  342.    struct {                                /* String search attributes */
  343.       unsigned     rtrim : 1,              /* Ignore trailing blanks */
  344.                    ignorecase : 1;         /* Ignore case */
  345.    } s_attr;
  346.    unsigned char   db_duplicates,          /* Number of keys to check */
  347.                    ix_fields[16][2],       /* Index field ID and type */
  348.                    number_of_keys,         /* Total number of fields in key */
  349.                    search_keys,            /* Number of fields to look for */
  350.                    use_mode;               /* Flags current in-use mode */
  351. } TCU_DB;
  352.  
  353.  
  354.  
  355. /* External objects */
  356.  
  357. extern TCU_FORM *_TCU_UPDATE_form;
  358.  
  359.  
  360.  
  361. /* Add prefix to function prototypes for C++ compilation */
  362.  
  363. #ifdef __cplusplus
  364. #define c_cpp extern "C"
  365. #else
  366. #define c_cpp
  367. #endif
  368.  
  369.  
  370. /*--------------------------------------------------------------------------*/
  371. /*                                                                          */
  372. /*                            Database Services                             */
  373. /*                                                                          */
  374. /*--------------------------------------------------------------------------*/
  375.  
  376.  
  377. c_cpp int  tcu_db_at_bof               (TCU_DB *);
  378. c_cpp int  tcu_db_at_eof               (TCU_DB *);
  379. c_cpp int  tcu_db_close                (TCU_DB *);
  380. c_cpp int  tcu_db_create               (TCU_DB *, TCU_FORM *, char *, int,
  381.                                         char **);
  382. c_cpp int  tcu_db_delete               (TCU_DB *);
  383. c_cpp void tcu_db_end_form_edit        (TCU_DB *);
  384. c_cpp int  tcu_db_find                 (TCU_DB *, TCU_FIELD_VALUE *);
  385. c_cpp int  tcu_db_first                (TCU_DB *);
  386. c_cpp int  tcu_db_last                 (TCU_DB *);
  387. c_cpp int  tcu_db_next                 (TCU_DB *);
  388. c_cpp int  tcu_db_open                 (TCU_DB *, TCU_FORM *, char *, int);
  389. c_cpp int  tcu_db_previous             (TCU_DB *);
  390. c_cpp int  tcu_db_read                 (TCU_DB *);
  391. c_cpp int  tcu_db_read_index_field     (TCU_DB *, int, TCU_FIELD_VALUE *);
  392. c_cpp long tcu_db_record_count         (TCU_DB *);
  393. c_cpp int  tcu_db_remove               (char *);
  394. c_cpp int  tcu_db_rewrite              (TCU_DB *);
  395. c_cpp int  tcu_db_save                 (TCU_DB *);
  396. c_cpp int  tcu_db_search               (TCU_DB *, TCU_FIELD_VALUE *);
  397. c_cpp int  tcu_db_set_search_indices   (TCU_DB *, int);
  398. c_cpp int  tcu_db_set_search_mode      (TCU_DB *, int);
  399. c_cpp void tcu_db_start_form_edit      (TCU_DB *);
  400. c_cpp int  tcu_db_write                (TCU_DB *);
  401.  
  402.  
  403.  
  404. /*--------------------------------------------------------------------------*/
  405. /*                                                                          */
  406. /*                  Pop-Up & Pulldown Menu Services                         */
  407. /*                                                                          */
  408. /*--------------------------------------------------------------------------*/
  409.  
  410.  
  411. c_cpp int tcu_change_menu_attribs      (TCU_MENU *, int, unsigned char);
  412. c_cpp int tcu_change_menu_escapes      (TCU_MENU *, unsigned char);
  413. c_cpp int tcu_clear_menu_in_pulldown   (TCU_PULLDOWN *);
  414. c_cpp int tcu_define_menu              (TCU_MENU *, char *, unsigned char,
  415.                                         unsigned char, unsigned char,
  416.                                         unsigned char, unsigned char,
  417.                                         unsigned char, unsigned char, char **,
  418.                                         unsigned char);
  419. c_cpp int tcu_define_pulldown          (TCU_PULLDOWN *, unsigned char,
  420.                                         unsigned char, unsigned char, char **,
  421.                                         unsigned char, TCU_MENU **);
  422. c_cpp int tcu_display_menu             (TCU_MENU *, int, int);
  423. c_cpp int tcu_display_pulldown_header  (TCU_PULLDOWN *);
  424. c_cpp int tcu_escape_fkey              (void);
  425. c_cpp int tcu_new_pulldown_cover       (TCU_PULLDOWN *);
  426. c_cpp int tcu_read_menu_selection      (TCU_MENU *);
  427. c_cpp int tcu_read_pulldown_selection  (TCU_PULLDOWN *, int *, int *);
  428. c_cpp int tcu_remove_menu              (TCU_MENU *);
  429. c_cpp int tcu_remove_pulldown          (TCU_PULLDOWN *);
  430. c_cpp int tcu_set_menu_help            (TCU_MENU *, void far (*)(int));
  431. c_cpp int tcu_set_menu_option          (TCU_MENU *, int, int);
  432. c_cpp int tcu_set_pulldown_help        (TCU_PULLDOWN *, void far (*)(int));
  433.  
  434.  
  435.  
  436. /*--------------------------------------------------------------------------*/
  437. /*                                                                          */
  438. /*                       Prompt & Notice Utilities                          */
  439. /*                                                                          */
  440. /*--------------------------------------------------------------------------*/
  441.  
  442.  
  443. c_cpp int tcu_clear_notice             (TCU_NOTICE *);
  444. c_cpp int tcu_display_notice           (TCU_NOTICE *, int, int);
  445. c_cpp int tcu_get_confirm              (int, int, unsigned char, unsigned char,
  446.                                         char *, ...);
  447. c_cpp int tcu_notice_text              (TCU_NOTICE *, char *, ...);
  448. c_cpp int tcu_prepare_notice           (TCU_NOTICE *, char *, unsigned char,
  449.                                         unsigned char, unsigned char,
  450.                                         unsigned char);
  451. c_cpp int tcu_prompt_input             (TCU_NOTICE *, int, int, char *,
  452.                                         unsigned char);
  453.  
  454.  
  455.  
  456. /*--------------------------------------------------------------------------*/
  457. /*                                                                          */
  458. /*                           Screen/Form Utilities                          */
  459. /*                                                                          */
  460. /*--------------------------------------------------------------------------*/
  461.  
  462.  
  463. c_cpp int tcu_clear_form_fields        (TCU_FORM *);
  464. c_cpp int tcu_display_form             (TCU_FORM *, int, int);
  465. c_cpp int tcu_edit_form                (TCU_FORM *, int, int *);
  466. c_cpp int tcu_form_record_size         (TCU_FORM *);
  467. c_cpp int tcu_get_field                (TCU_FORM *, int, TCU_FIELD_VALUE *);
  468. c_cpp int tcu_get_field_choice_string  (TCU_FORM *, int, char *);
  469. c_cpp int tcu_get_field_id             (TCU_FORM *, char *, int *);
  470. c_cpp int tcu_get_field_info           (TCU_FORM *, int, TCU_FIELD_INFO *);
  471. c_cpp int tcu_get_form_info            (TCU_FORM *, TCU_FORM_INFO *);
  472. c_cpp int tcu_load_form                (TCU_FORM *, char *);
  473. c_cpp int tcu_load_image_form          (TCU_FORM *, TCU_FORM *);
  474. c_cpp int tcu_put_field                (TCU_FORM *, int, TCU_FIELD_VALUE *);
  475. c_cpp int tcu_read_formrec             (TCU_FORM *, char *);
  476. c_cpp int tcu_remove_form              (TCU_FORM *);
  477. c_cpp int tcu_select_field             (TCU_FORM *, int, int *);
  478. c_cpp int tcu_set_button_fn            (TCU_FORM *, int far (*)(TCU_FORM *,
  479.                                                                 int));
  480. c_cpp int tcu_set_field_attrib         (TCU_FORM *, int, unsigned char);
  481. c_cpp int tcu_set_field_mode           (TCU_FORM *, int, int);
  482. c_cpp int tcu_set_field_verify         (TCU_FORM *, int far (*)
  483.                                                     (TCU_FORM *, int,
  484.                                                      TCU_FIELD_VALUE *));
  485. c_cpp int tcu_set_form_fnkey_fn        (TCU_FORM *, int far (*)
  486.                                                     (TCU_FORM *, int, int));
  487. c_cpp int tcu_set_form_help            (TCU_FORM *, void far (*)
  488.                                                     (TCU_FORM *, int));
  489. c_cpp int tcu_set_form_mode            (TCU_FORM *, int);
  490. c_cpp int tcu_unload_form              (TCU_FORM *);
  491. c_cpp int tcu_write_formrec            (TCU_FORM *, char *);
  492.  
  493.  
  494.  
  495. /*--------------------------------------------------------------------------*/
  496. /*                                                                          */
  497. /*                          Windowing Utilities                             */
  498. /*                                                                          */
  499. /*--------------------------------------------------------------------------*/
  500.  
  501.  
  502. c_cpp int tcu_change_colour            (TCU_WINDOW *, unsigned char);
  503. c_cpp int tcu_clear_window             (TCU_WINDOW *);
  504. c_cpp int tcu_close_window             (TCU_WINDOW *);
  505. c_cpp int tcu_open_window              (TCU_WINDOW *, int, int, int, int,
  506.                                         char *, unsigned char, unsigned char,
  507.                                         unsigned char, unsigned char);
  508. c_cpp int tcu_position_cursor          (TCU_WINDOW *, int, int);
  509. c_cpp int tcu_wprintf                  (TCU_WINDOW *, char *, ...);
  510. c_cpp int tcu_wgets                    (TCU_WINDOW *, int, char *, int *);
  511.  
  512.  
  513.  
  514. /*--------------------------------------------------------------------------*/
  515. /*                                                                          */
  516. /*                            General Utilities                             */
  517. /*                                                                          */
  518. /*--------------------------------------------------------------------------*/
  519.  
  520.  
  521. c_cpp unsigned char  tcu_colour_attrib        (int, int);
  522. c_cpp char          *tcu_date_string          (unsigned short, unsigned char);
  523. c_cpp unsigned short tcu_date_value           (char *, unsigned char);
  524. c_cpp unsigned short tcu_get_user_keypress    (void);
  525. c_cpp unsigned long  tcu_hash_value           (char *, unsigned long);
  526. c_cpp void           tcu_restore_environment  (void);
  527. c_cpp void           tcu_save_environment     (void);
  528. c_cpp int            tcu_set_idle_loop        (int far (*)(unsigned long));
  529. c_cpp int            tcu_set_mouse_mode       (unsigned char);
  530. c_cpp int            tcu_set_user_key_handler (int far (*)(unsigned short *));
  531. c_cpp void           tcu_warnbeep             (void);
  532.  
  533.  
  534.  
  535. /* If TCU compatibility mode is selected to be compatible with pre version */
  536. /* 3.2 then we must include the 'tcupre32.h' file here to alias the right */
  537. /* bits.  Don't rely on this always being here... it won't be! */
  538.  
  539. #if      defined(__TCUPRE32__)
  540. #include <usr\tcupre32.h>
  541. #endif
  542.  
  543. #endif
  544.