#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y))
#endif
+#ifndef FD_SETSIZE
+#define FD_SETSIZE 256
+#endif
#ifndef FD_SET
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#define FD_ZERO(p) bzero(p, sizeof(*(p)))
+typedef long fd_mask;
+typedef struct fd_set {fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];} fd_set;
#endif
-
+/* 32-bit type for consistency in data sent across the network */
+#ifdef SIXTYFOUR
+#define int32 int
+#define uint32 u_int
+#else
+#define int32 long
+#define uint32 u_long
+#endif
/*----------------------------------------------------------*
*
#define GDB_ROUNDUP(n,b) ((((n)+(b)-1)/(b))*(b))
+extern int gdb_Options; /* Control optional features */
+#define GDB_OPT_KEEPALIVE 1
extern int gdb_Debug; /* debugging flags are */
/* stored here */
extern FILE *gdb_log; /* file descriptor for */
/* integer */
int (*f)(); /* as a function pointer */
char *cp; /* character pointer */
+ char *(*cpf)(); /* string function pointer */
};
#define TYPE_PROPERTY_COUNT 8 /* number of properties */
#define ALIGNMENT_PROPERTY 1 /* integer */
#define NULL_PROPERTY 2 /* function */
#define CODED_LENGTH_PROPERTY 3 /* function */
-#define ENCODE_PROPERTY 4 /* function */
-#define DECODE_PROPERTY 5 /* function */
+#define ENCODE_PROPERTY 4 /* string function */
+#define DECODE_PROPERTY 5 /* string function */
#define FORMAT_PROPERTY 6 /* function */
#define NAME_PROPERTY 7 /* char pointer */
/* included in this length */
};
struct tupl_desc {
- long id; /* this should say TPD\0 */
+ int32 id; /* this should say TPD\0 */
int ref_count; /* when this goes to zero, */
/* the descriptor may really */
/* be reclaimed */
/* tuples are linked, as in */
/* a relation. Convention is*/
/* double linked, circular.*/
- long id; /* should say TUP\0 */
+ int32 id; /* should say TUP\0 */
TUPLE_DESCRIPTOR desc; /* pointer to the descriptor */
char data[1]; /* data goes here, word */
/* aligned. Should be [] */
/* as the first fields in */
/* both rel_dat and tuple_dat*/
/* a minor non-portability */
- long id; /* should contain REL\0 */
+ int32 id; /* should contain REL\0 */
TUPLE_DESCRIPTOR desc; /* descriptor for the tuples */
/* in this relation. Should */
/* == that in each tuple */
#define GDB_BIND_RETRY_INTERVAL 10 /* Number of seconds to wait */
/* between attempts to bind */
/* the listening socket */
-#define GDB_MAX_CONNECTIONS 25 /* maximum number of */
+#define GDB_MAX_CONNECTIONS 40 /* maximum number of */
/* connections that */
/* any one process can */
/* control simultaneously */
/* OPSTATUS. tells whether */
/* transmit/receive is */
/* pending.*/
- long flags; /* bit flags */
+ int32 flags; /* bit flags */
#define HCON_PROGRESS 0x00000001 /* used by selection */
/* routines to detect */
/* progress */
#define GDB_CON_ID 0x434f4e00 /*"CON"*/
struct con_data {
- long id; /* should contain CON\0 */
+ int32 id; /* should contain CON\0 */
int status; /* See definitions below. */
/* Do not confuse with */
/* the status sub-fields of */
extern fd_set gdb_crfds, gdb_cwfds, gdb_cefds; /* connection related file */
/* descriptor maps to be */
/* used in select */
-fd_set last_crfds, last_cwfds, last_cefds; /* these file desc. bit */
+extern fd_set last_crfds, last_cwfds, last_cefds;/* these file desc. bit */
/* masks are set up */
/* for each select call */
/* to include the user */
struct oper_data {
struct oper_data *next, *prev; /* forward and back chain */
- long id; /* should contain OPR\0 */
+ int32 id; /* should contain OPR\0 */
int tag; /* unique identifier for */
/* this operation */
int status; /* current state of this */
#define GDB_DB_ID 0x44420000 /* eye catcher */
struct db_struct {
- long id; /* eye catcher */
+ int32 id; /* eye catcher */
CONNECTION connection; /* the GDB connection */
/* used to get at this */
/* database */