dbaddtype - Add a datatype


int dbaddtype(name, type, size)
char *name;
int type;
int size;


the new name for the type. It should not start with the string "var", as that is reserved for declaring the variable size form of the datatype.
an integer which is used to refer to the type in functions etc. For a user added type this number should be between 32 and 63 inclusive. This number should be unique.
the size of one element of the datatype. When one item of this type is written to the database, at least size bytes will be transferred.

The function will return 0 if successful, and -1 if there is no room for more datatypes, or if a type with a different name already exists with the same type number.


typedef struct tagTIMESTAMP
   short           year;
   unsigned short  month;
   unsigned short  day;
   unsigned short  hour;
   unsigned short  minute;
   unsigned short  second;
   unsigned long   fraction;

dbaddtype("timestamp", 32, sizeof(TIMESTAMP);

Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.