Ignore:
Timestamp:
Dec 6, 1999, 7:11:50 PM (26 years ago)
Author:
bird
Message:

VA compilation without db.dll. Fixed bugs in stateupd.cpp.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/database/mysql/mysql.h

    r1936 r1993  
    66#ifndef _mysql_h
    77#define _mysql_h
    8 #ifdef  __cplusplus
     8#ifdef  __cplusplus
    99extern "C" {
    1010#endif
    1111
    12 #ifndef _global_h                               /* If not standard header */
     12#ifndef _global_h               /* If not standard header */
    1313#include <sys/types.h>
    1414typedef char my_bool;
    1515#if !defined(WIN32)
    16 #define STDCALL
     16  #if defined(__IBMC__) || defined(__IBMCPP__)
     17    #define STDCALL _System
     18  #else
     19    #define STDCALL
     20  #endif
    1721#else
    1822#define STDCALL __stdcall
     
    2226#ifndef ST_USED_MEM_DEFINED
    2327#define ST_USED_MEM_DEFINED
    24 typedef struct st_used_mem {                    /* struct for once_alloc */
    25   struct st_used_mem *next;                     /* Next block in use */
    26   unsigned int  left;                           /* memory left in block  */
    27   unsigned int  size;                           /* size of block */
     28typedef struct st_used_mem {            /* struct for once_alloc */
     29  struct st_used_mem *next;         /* Next block in use */
     30  unsigned int  left;               /* memory left in block  */
     31  unsigned int  size;               /* size of block */
    2832} USED_MEM;
    2933typedef struct st_mem_root {
    3034  USED_MEM *free;
    3135  USED_MEM *used;
    32   unsigned int  min_malloc;
    33   unsigned int  block_size;
     36  unsigned int  min_malloc;
     37  unsigned int  block_size;
    3438  void (*error_handler)(void);
    3539} MEM_ROOT;
     
    5054extern char *mysql_unix_port;
    5155
    52 #define IS_PRI_KEY(n)   ((n) & PRI_KEY_FLAG)
    53 #define IS_NOT_NULL(n)  ((n) & NOT_NULL_FLAG)
    54 #define IS_BLOB(n)      ((n) & BLOB_FLAG)
    55 #define IS_NUM(t)       ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR)
     56#define IS_PRI_KEY(n)   ((n) & PRI_KEY_FLAG)
     57#define IS_NOT_NULL(n)  ((n) & NOT_NULL_FLAG)
     58#define IS_BLOB(n)  ((n) & BLOB_FLAG)
     59#define IS_NUM(t)   ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR)
    5660
    5761typedef struct st_mysql_field {
    58   char *name;                   /* Name of column */
    59   char *table;                  /* Table of column if column was a field */
    60   char *def;                    /* Default value (set by mysql_list_fields) */
    61   enum enum_field_types type;   /* Type of field. Se mysql_com.h for types */
    62   unsigned int length;          /* Width of column */
    63   unsigned int max_length;      /* Max width of selected set */
    64   unsigned int flags;           /* Div flags */
    65   unsigned int decimals;        /* Number of decimals in field */
     62  char *name;           /* Name of column */
     63  char *table;          /* Table of column if column was a field */
     64  char *def;            /* Default value (set by mysql_list_fields) */
     65  enum enum_field_types type;   /* Type of field. Se mysql_com.h for types */
     66  unsigned int length;      /* Width of column */
     67  unsigned int max_length;  /* Max width of selected set */
     68  unsigned int flags;       /* Div flags */
     69  unsigned int decimals;    /* Number of decimals in field */
    6670} MYSQL_FIELD;
    6771
    68 typedef char **MYSQL_ROW;               /* return data as array of strings */
     72typedef char **MYSQL_ROW;       /* return data as array of strings */
    6973typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */
    7074
     
    8084
    8185typedef struct st_mysql_rows {
    82   struct st_mysql_rows *next;           /* list of rows */
     86  struct st_mysql_rows *next;       /* list of rows */
    8387  MYSQL_ROW data;
    8488} MYSQL_ROWS;
    8589
    86 typedef MYSQL_ROWS *MYSQL_ROW_OFFSET;   /* offset to current row */
     90typedef MYSQL_ROWS *MYSQL_ROW_OFFSET;   /* offset to current row */
    8791
    8892typedef struct st_mysql_data {
     93  #if defined(__IBMC__) || defined(__IBMCPP__)
     94  unsigned long rows;
     95  unsigned long rows_;
     96  #else
    8997  my_ulonglong rows;
     98  #endif
    9099  unsigned int fields;
    91100  MYSQL_ROWS *data;
     
    102111
    103112enum mysql_option { MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS,
    104                     MYSQL_OPT_NAMED_PIPE, MYSQL_INIT_COMMAND,
    105                     MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP };
     113            MYSQL_OPT_NAMED_PIPE, MYSQL_INIT_COMMAND,
     114            MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP };
    106115
    107116enum mysql_status { MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,
    108                     MYSQL_STATUS_USE_RESULT};
     117            MYSQL_STATUS_USE_RESULT};
    109118
    110119typedef struct st_mysql {
    111   NET           net;                    /* Communication parameters */
    112   char          *host,*user,*passwd,*unix_socket,*server_version,*host_info,
    113                 *info,*db;
    114   unsigned int  port,client_flag,server_capabilities;
    115   unsigned int  protocol_version;
    116   unsigned int  field_count;
    117   unsigned long thread_id;              /* Id for connection in server */
     120  NET       net;            /* Communication parameters */
     121  char      *host,*user,*passwd,*unix_socket,*server_version,*host_info,
     122        *info,*db;
     123  unsigned int  port,client_flag,server_capabilities;
     124  unsigned int  protocol_version;
     125  unsigned int  field_count;
     126  unsigned long thread_id;      /* Id for connection in server */
     127  #if defined(__IBMC__) || defined(__IBMCPP__)
     128  unsigned long affected_rows;
     129  unsigned long _affected_rows;
     130  unsigned long insert_id;       /* id if insert on table with NEXTNR */
     131  unsigned long _insert_id;       /* id if insert on table with NEXTNR */
     132  unsigned long extra_info;      /* Used by mysqlshow */
     133  unsigned long _extra_info;      /* Used by mysqlshow */
     134  #else
    118135  my_ulonglong affected_rows;
    119   my_ulonglong insert_id;               /* id if insert on table with NEXTNR */
    120   my_ulonglong extra_info;              /* Used by mysqlshow */
     136  my_ulonglong insert_id;       /* id if insert on table with NEXTNR */
     137  my_ulonglong extra_info;      /* Used by mysqlshow */
     138  #endif
     139
    121140  unsigned long packet_length;
    122141  enum mysql_status status;
    123   MYSQL_FIELD   *fields;
    124   MEM_ROOT      field_alloc;
    125   my_bool       free_me;                /* If free in mysql_close */
    126   my_bool       reconnect;              /* set to 1 if automatic reconnect */
     142  MYSQL_FIELD   *fields;
     143  MEM_ROOT  field_alloc;
     144  my_bool   free_me;        /* If free in mysql_close */
     145  my_bool   reconnect;      /* set to 1 if automatic reconnect */
    127146  struct st_mysql_options options;
    128147} MYSQL;
     
    130149
    131150typedef struct st_mysql_res {
     151  #if defined(__IBMC__) || defined(__IBMCPP__)
     152  unsigned long row_count;
     153  unsigned long _row_count;
     154  #else
    132155  my_ulonglong row_count;
    133   unsigned int  field_count, current_field;
    134   MYSQL_FIELD   *fields;
    135   MYSQL_DATA    *data;
    136   MYSQL_ROWS    *data_cursor;
    137   MEM_ROOT      field_alloc;
    138   MYSQL_ROW     row;                    /* If unbuffered read */
    139   MYSQL_ROW     current_row;            /* buffer to current row */
    140   unsigned long *lengths;               /* column lengths of current row */
    141   MYSQL         *handle;                /* for unbuffered reads */
    142   my_bool       eof;                    /* Used my mysql_fetch_row */
     156  #endif
     157  unsigned int  field_count, current_field;
     158  MYSQL_FIELD   *fields;
     159  MYSQL_DATA    *data;
     160  MYSQL_ROWS    *data_cursor;
     161  MEM_ROOT  field_alloc;
     162  MYSQL_ROW row;            /* If unbuffered read */
     163  MYSQL_ROW current_row;        /* buffer to current row */
     164  unsigned long *lengths;       /* column lengths of current row */
     165  MYSQL     *handle;        /* for unbuffered reads */
     166  my_bool   eof;            /* Used my mysql_fetch_row */
    143167} MYSQL_RES;
    144168
     
    161185#define mysql_thread_id(mysql) (mysql)->thread_id
    162186
    163 MYSQL *         STDCALL mysql_init(MYSQL *mysql);
    164 MYSQL *         STDCALL mysql_connect(MYSQL *mysql, const char *host,
    165                                       const char *user, const char *passwd);
     187MYSQL *     STDCALL mysql_init(MYSQL *mysql);
     188MYSQL *     STDCALL mysql_connect(MYSQL *mysql, const char *host,
     189                      const char *user, const char *passwd);
    166190#if MYSQL_VERSION_ID >= 32200
    167 MYSQL *         STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
    168                                            const char *user,
    169                                            const char *passwd,
    170                                            const char *db,
    171                                            unsigned int port,
    172                                            const char *unix_socket,
    173                                            unsigned int clientflag);
    174 #else
    175 MYSQL *         STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
    176                                            const char *user,
    177                                            const char *passwd,
    178                                            unsigned int port,
    179                                            const char *unix_socket,
    180                                            unsigned int clientflag);
    181 #endif
    182 void            STDCALL mysql_close(MYSQL *sock);
    183 int             STDCALL mysql_select_db(MYSQL *mysql, const char *db);
    184 int             STDCALL mysql_query(MYSQL *mysql, const char *q);
    185 int             STDCALL mysql_real_query(MYSQL *mysql, const char *q,
    186                                         unsigned int length);
    187 int             STDCALL mysql_create_db(MYSQL *mysql, const char *DB);
    188 int             STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
    189 int             STDCALL mysql_shutdown(MYSQL *mysql);
    190 int             STDCALL mysql_dump_debug_info(MYSQL *mysql);
    191 int             STDCALL mysql_refresh(MYSQL *mysql,
    192                                      unsigned int refresh_options);
    193 int             STDCALL mysql_kill(MYSQL *mysql,unsigned long pid);
    194 int             STDCALL mysql_ping(MYSQL *mysql);
    195 char *          STDCALL mysql_stat(MYSQL *mysql);
    196 char *          STDCALL mysql_get_server_info(MYSQL *mysql);
    197 char *          STDCALL mysql_get_client_info(void);
    198 char *          STDCALL mysql_get_host_info(MYSQL *mysql);
    199 unsigned int    STDCALL mysql_get_proto_info(MYSQL *mysql);
    200 MYSQL_RES *     STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild);
    201 MYSQL_RES *     STDCALL mysql_list_tables(MYSQL *mysql,const char *wild);
    202 MYSQL_RES *     STDCALL mysql_list_fields(MYSQL *mysql, const char *table,
    203                                         const char *wild);
    204 MYSQL_RES *     STDCALL mysql_list_processes(MYSQL *mysql);
    205 MYSQL_RES *     STDCALL mysql_store_result(MYSQL *mysql);
    206 MYSQL_RES *     STDCALL mysql_use_result(MYSQL *mysql);
    207 int             STDCALL mysql_options(MYSQL *mysql,enum mysql_option option,
    208                                       const char *arg);
    209 void            STDCALL mysql_free_result(MYSQL_RES *result);
    210 void            STDCALL mysql_data_seek(MYSQL_RES *result,unsigned int offset);
     191MYSQL *     STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
     192                       const char *user,
     193                       const char *passwd,
     194                       const char *db,
     195                       unsigned int port,
     196                       const char *unix_socket,
     197                       unsigned int clientflag);
     198#else
     199MYSQL *     STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
     200                       const char *user,
     201                       const char *passwd,
     202                       unsigned int port,
     203                       const char *unix_socket,
     204                       unsigned int clientflag);
     205#endif
     206void        STDCALL mysql_close(MYSQL *sock);
     207int     STDCALL mysql_select_db(MYSQL *mysql, const char *db);
     208int     STDCALL mysql_query(MYSQL *mysql, const char *q);
     209int     STDCALL mysql_real_query(MYSQL *mysql, const char *q,
     210                    unsigned int length);
     211int     STDCALL mysql_create_db(MYSQL *mysql, const char *DB);
     212int     STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
     213int     STDCALL mysql_shutdown(MYSQL *mysql);
     214int     STDCALL mysql_dump_debug_info(MYSQL *mysql);
     215int     STDCALL mysql_refresh(MYSQL *mysql,
     216                     unsigned int refresh_options);
     217int     STDCALL mysql_kill(MYSQL *mysql,unsigned long pid);
     218int     STDCALL mysql_ping(MYSQL *mysql);
     219char *      STDCALL mysql_stat(MYSQL *mysql);
     220char *      STDCALL mysql_get_server_info(MYSQL *mysql);
     221char *      STDCALL mysql_get_client_info(void);
     222char *      STDCALL mysql_get_host_info(MYSQL *mysql);
     223unsigned int    STDCALL mysql_get_proto_info(MYSQL *mysql);
     224MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild);
     225MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild);
     226MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table,
     227                    const char *wild);
     228MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql);
     229MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql);
     230MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql);
     231int     STDCALL mysql_options(MYSQL *mysql,enum mysql_option option,
     232                      const char *arg);
     233void        STDCALL mysql_free_result(MYSQL_RES *result);
     234void        STDCALL mysql_data_seek(MYSQL_RES *result,unsigned int offset);
    211235MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET);
    212236MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result,
    213                                            MYSQL_FIELD_OFFSET offset);
    214 MYSQL_ROW       STDCALL mysql_fetch_row(MYSQL_RES *result);
    215 unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result);
    216 MYSQL_FIELD *   STDCALL mysql_fetch_field(MYSQL_RES *result);
    217 unsigned int    STDCALL mysql_escape_string(char *to,const char *from,
    218                                             unsigned int from_length);
    219 void            STDCALL mysql_debug(const char *debug);
     237                       MYSQL_FIELD_OFFSET offset);
     238MYSQL_ROW   STDCALL mysql_fetch_row(MYSQL_RES *result);
     239unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result);
     240MYSQL_FIELD *   STDCALL mysql_fetch_field(MYSQL_RES *result);
     241unsigned int    STDCALL mysql_escape_string(char *to,const char *from,
     242                        unsigned int from_length);
     243void        STDCALL mysql_debug(const char *debug);
    220244
    221245/* new api functions */
     
    223247#define HAVE_MYSQL_REAL_CONNECT
    224248
    225 #ifdef  __cplusplus
     249#ifdef  __cplusplus
    226250}
    227251#endif
Note: See TracChangeset for help on using the changeset viewer.