Dbrmvkey()

From Recital Documentation Wiki
Jump to: navigation, search

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);
	}


SEE ALSO

dbakey(), dbtkey(), dbupdr()