dbaddtype - Add a datatype

SYNOPSIS

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


DESCRIPTION
Parameters

name
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.
type
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.
size
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.


EXAMPLE

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

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


Copyright © Thunderstone Software     Last updated: Dec 10 2018
Copyright © 2019 Thunderstone Software LLC. All rights reserved.