Dbrewind()
From Recital Documentation Wiki
Revision as of 14:29, 1 May 2009 by Yvonnemilne (Talk | contribs)
PURPOSE
rewind index file
SYNOPSIS
#include "dbl.h" int dbrewind(ndx) <input parameter> char *ndx; /* .NDX file descriptor */ <output parameter> none
RETURN VALUE
The dbrewind() function returns 0 for success, or < 0 if an error occurs. See the section on return code values for a detailed list of return codes.
DESCRIPTION
This function positions the access pointer at the beginning of the .NDX file. The subsequent dbnkey() locates the first key.
EXAMPLE
This example rewinds the .NDX file whose file descriptor is in "char *ndx" and then reads the first key from the file.
#include "dbl.h" char *ndx; /* .NDX file descriptor */ char key[100]; /* Key buffer */ long recnum; /* Record number */ int rc; /* Return code */ rc = dbrewind(ndx); if (rc == SUCCESS){ rc = dbnkey(ndxfd, key, recnum); if (rc == SUCCESS) printf("key read \n"); else { printf("error number %d \n", rc); exit(1); } }