Difference between revisions of "Dbiopen()"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 11: Line 11:
  
 
<input parameter>
 
<input parameter>
char *name; /* Address of a buffer containing the .NDX file name */
+
char *name; /* Address of a buffer containing the .NDX file name */
  
 
<output parameters>
 
<output parameters>
char *ndx; /* .NDX file descriptor */
+
char *ndx; /* .NDX file descriptor */
  
 
</code>
 
</code>
Line 36: Line 36:
 
#include "dbl.h"
 
#include "dbl.h"
  
char *ndx; /* .NDX file descriptor */
+
char *ndx; /* .NDX file descriptor */
int rc; /* Return code */
+
int rc; /* Return code */
  
 
rc = dbiopen("person.ndx", &ndx);
 
rc = dbiopen("person.ndx", &ndx);
if (rc = = SUCCESS) printf("index opened n");
+
if (rc == SUCCESS) printf("index opened \n");
 
else {
 
else {
printf("error number %d n", rc);
+
printf("error number %d \n", rc);
 
exit (1);
 
exit (1);
 
}
 
}

Latest revision as of 13:29, 1 May 2009

PURPOSE

open an existing index file


SYNOPSIS

#include "dbl.h"
 
	int	dbiopen(name, ndx)
 
	<input parameter>
	char	*name;		/* Address of a buffer containing the .NDX file name */
 
	<output parameters>
	char	*ndx;		/* .NDX file descriptor */


RETURN VALUE

The dbiopen() function returns 0 for success, or < 0 if an error occurs. See the section on return value codes for a detailed list of failure codes.


DESCRIPTION

This function opens an existing .NDX file and returns its file descriptor. The file descriptor is released after The dbiclose() function has been called for this file.


EXAMPLE

The following example opens the .NDX file "person.ndx". The file descriptor is returned by the function dbiopen() in "char *ndx".

#include "dbl.h"
 
	char	*ndx;	/* .NDX file descriptor */
	int	rc;		/* Return code */
 
	rc = dbiopen("person.ndx", &ndx);
	if (rc == SUCCESS) printf("index opened \n");
	else {
		printf("error number %d \n", rc);
		exit (1);
	}


SEE ALSO

dbfilemode(), dbicache(), dbiclose(), dbiflsh(), dbopen()