home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume43 / dbf / part02 / sql.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-27  |  1.4 KB  |  81 lines

  1. /*
  2.  * Copyright (c) 1994 Brad Eacker,
  3.  *              (Music, Intuition, Software, and Computers)
  4.  * All Rights Reserved
  5.  */
  6.  
  7. /* link lists */
  8. #define    LE_BASIC    0
  9. #define    LE_STRING    1
  10. #define    LE_REFS        2
  11. #define    CE_DECL        3
  12. #define    CE_NAME        4
  13. #define    EXP_ELEM    5
  14. #define    TBL_CONSTRAINT    6
  15. #define    COL_CONSTRAINT    7
  16. #define    NM_DEF        8
  17.  
  18. struct list_elem {
  19.     struct list_elem *l_next;
  20.     short        l_info_type;
  21.     short        l_flags;
  22.     char        *l_info;
  23. };
  24. typedef struct list_elem list_elem_t;
  25.  
  26. /*
  27.  * column types
  28.  */
  29.  
  30. #define    CT_CHAR        1        /* character type */
  31.  
  32. struct col_elem_decl {
  33.     list_elem_t    *col_name;    /* overlaps l_info */
  34.     list_elem_t    *col_extras;
  35.     int        col_type;
  36.     int        col_len;
  37.     int        col_decl;
  38. };
  39. typedef struct col_elem_decl    col_elem_decl_t;
  40.  
  41. /* Expression types */
  42.  
  43. #define    P_EQUALS    0
  44. #define    P_AND        1
  45. #define    P_OR        2
  46. #define    P_NOT        3
  47. #define    P_NULL        4
  48. #define    P_NOT_NULL    5
  49. #define    P_LIKE        6
  50. #define    P_NOT_LIKE    7
  51. #define    P_LESS        8
  52. #define    P_GREATER    9
  53. #define    P_LESS_EQ    10
  54. #define    P_GREATER_EQ    11
  55. #define    P_NOT_EQ    12
  56.  
  57. #define    BINARY        16
  58. #define    B_ADD        (BINARY | 1)
  59. #define    B_MINUS        (BINARY | 2)
  60. #define    B_MULT        (BINARY | 3)
  61. #define    B_DIV        (BINARY | 4)
  62.  
  63. /* Column constraints */
  64. #define    CC_NOT_NULL    0
  65. #define    CC_UNIQUE    1
  66. #define    CC_PRIMARY    2
  67. #define    CC_REFS        3
  68. #define    CC_CHECK    4
  69.  
  70. /* Table constraints */
  71. #define    TC_UNIQUE    0
  72. #define    TC_PRIMARY    1
  73. #define    TC_CHECK    2
  74. #define    TC_FOREIGN    3
  75. #define    TC_FOR_REFS    4
  76.  
  77. extern int debug_output;
  78. extern int verbose;
  79.  
  80. extern char *get_list_name();
  81.