Difference between revisions of "Dbiflsh()"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
Line 11: Line 11:
  
 
<input parameter>
 
<input parameter>
char *ndx; /* .NDX file descriptor */
+
char *ndx; /* .NDX file descriptor */
  
 
<output parameters>
 
<output parameters>
Line 36: Line 36:
 
<code lang="c">
 
<code lang="c">
 
#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 = dbiflsh(ndx);
 
rc = dbiflsh(ndx);
if (rc = = SUCCESS) printf("index buffer flushed n");
+
if (rc == SUCCESS) printf("index buffer flushed \n");
 
else {
 
else {
printf("error number %d n", rc);
+
printf("error number %d \n", rc);
 
exit (1);
 
exit (1);
 
}
 
}

Latest revision as of 11:13, 1 May 2009

PURPOSE

flush I/O buffer cache for index file


SYNOPSIS

#include "dbl.h"
 
	int	dbiflsh(ndx)
 
	<input parameter>
	char	*ndx;		/* .NDX file descriptor */
 
	<output parameters>
	none


RETURN VALUE

The dbiflsh() function return 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 forces the I/O buffer cache of the specified .NDX file to be written to the disk.


EXAMPLE

The following example flushes the .NDX file whose file descriptor is in "char *ndx".


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


SEE ALSO

dbakey(), dbflush(), dbiopen(), dbputrk()