Difference between revisions of "Dbrmvkey()"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 11: | Line 11: | ||
<input parameters> | <input parameters> | ||
− | char *ndx; /* .NDX file descriptor | + | char *ndx; /* .NDX file descriptor */ |
− | char *key; /* Address of a buffer containing the key to be removed */ | + | char *key; /* Address of a buffer containing the key to be removed */ |
− | long recno; /* Record number associated with the key to be removed */ | + | long recno; /* Record number associated with the key to be removed */ |
<output parameter> | <output parameter> | ||
Line 38: | Line 38: | ||
#include "dbl.h" | #include "dbl.h" | ||
− | char *ndx; | + | char *ndx; /* .NDX file descriptor */ |
− | char key[20]; /* Character key to be removed */ | + | char key[20]; /* Character key to be removed */ |
− | long recno; | + | long recno; /* Record number */ |
− | int rc; /* Return code | + | int rc; /* Return code */ |
rc = dbrmvkey(ndx, key, recno); | rc = dbrmvkey(ndx, key, recno); | ||
− | if (rc = = SUCCESS) printf("key removed n"); | + | if (rc == SUCCESS) printf("key removed \n"); |
else { | else { | ||
− | printf("error number %d n", rc); | + | printf("error number %d \n", rc); |
exit(1); | exit(1); | ||
} | } |
Latest revision as of 14:37, 1 May 2009
PURPOSE
remove key from index file
SYNOPSIS
#include "dbl.h" int dbrmvkey(ndx(ndx, key, recno) <input parameters> char *ndx; /* .NDX file descriptor */ char *key; /* Address of a buffer containing the key to be removed */ long recno; /* Record number associated with the key to be removed */ <output parameter> none
RETURN VALUE
The dbrmvkey() 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 physically removes a key and its associated record number from a .NDX file.
EXAMPLE
This example removes a character key specified in "char key[20]" and its associated record number specified in "long recno" from a .NDX file whose file descriptor is in "char *ndx".
#include "dbl.h" char *ndx; /* .NDX file descriptor */ char key[20]; /* Character key to be removed */ long recno; /* Record number */ int rc; /* Return code */ rc = dbrmvkey(ndx, key, recno); if (rc == SUCCESS) printf("key removed \n"); else { printf("error number %d \n", rc); exit(1); }