dblist - set up user record fields


#include <cbase/dirio.h>

long dblist (fldptrs, fcb)

char **fldptrs;

DFILE *fcb;


Dblist declares a list of fields that comprise the user record for an RMSfile. Dblist allows a program to define the fields that shall be accessed from each record in the RMSfile.

Fldptrs is a pointer to a list of pointers that point to strings that contain the names of the fields the calling program wants to access. The order of the fields in fldptrs must match the order of the fields in your user record structure exactly.

After your program calls dblist, all further calls to the RMS system up to the next dblist call use the field list of this call. On a find call, only the fields requested are returned. On an update call, only the fields specified are altered. Finally, when adding records to the RMSfile, only those fields specified are put into the RMSfile; all other fields in that record are zeroed.

Fcb is the file block pointer returned by dlopen(C-3) or dopen(C-3).

The value returned is the size of the new user record in bytes. All fields are properly aligned for each field's data type.


drlist(C-3), dlopen(C-3), dopen(C-3)

Chapter 4,

RMS Programming Guide


Dblist returns a value of BAD (-1) if the dictionary for the RMSfile cannot be found or if one of the fields in the list is not in the dictionary.


The data type and size of each field in your user record structure must match the data type and size of the corresponding field in the RMSfile.

Drlist(C-3) is an improved version of dblist that handles differences between the data type and size of fields in your user record structure and the fields in the RMSfile.