Difference between revisions of "Dbdcache()"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
(One intermediate revision by one user not shown)
Line 12: Line 12:
 
<input parameters>
 
<input parameters>
  
int size; /* Database cache size in records */
+
int size; /* Database cache size in records */
  
 
<output parameters>
 
<output parameters>
Line 36: Line 36:
 
<code lang="c">
 
<code lang="c">
 
#include <dbl.h
 
#include <dbl.h
char *dbf; /* .DBF file descriptor */
+
char *dbf; /* .DBF file descriptor */
long dbsize; /* Size of the .DBF file */
+
long dbsize; /* Size of the .DBF file */
int rc; /* Return code */
+
int rc; /* Return code */
  
 
rc = dbsize(dbf, &dbsize);
 
rc = dbsize(dbf, &dbsize);
if (rc = = SUCCESS) dbdcache(dbsize);
+
if (rc == SUCCESS) dbdcache(dbsize);
 
else {
 
else {
printf("error number %d n", rc);
+
printf("error number %d \n", rc);
 
exit (1);
 
exit (1);
 
}
 
}

Latest revision as of 12:48, 1 May 2009

PURPOSE

specify the database cache size


SYNOPSIS

#include "dbl.h"
 
	int	dbdcache(size)
 
	<input parameters>
 
	int	size;		/* Database cache size in records */
 
	<output parameters>
	none


RETURN VALUE

The dbdcache() function returns 0 for success. See the section on return code values for a detailed list of return codes.


DESCRIPTION

The dbdcache() function specifies the amount of records to be cached in memory.


EXAMPLE

This example sets the database cache to the total number of records stored in the database specified in the file descriptor stored in "char *dbf".

#include <dbl.h
	char	*dbf;		/* .DBF file descriptor */
	long	dbsize;	/* Size of the .DBF file */
	int	rc;		/* Return code */
 
	rc = dbsize(dbf, &dbsize);
	if (rc == SUCCESS) dbdcache(dbsize);
	else {
		printf("error number %d \n", rc);
		exit (1);
	}


SEE ALSO

dbflush(), dbgetnr(), dbgetr(), dbgetrk(), dbicache(), dbrecall()