Difference between revisions of "Dbclose()"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
(One intermediate revision by one user not shown)
Line 11: Line 11:
  
 
<input parameter>
 
<input parameter>
char *dbf; /* Database file descriptor */
+
char *dbf; /* Database file descriptor */
  
 
<output parameter>
 
<output parameter>
Line 35: Line 35:
 
<code lang="c">
 
<code lang="c">
 
#include "dbl.h"
 
#include "dbl.h"
char *dbf; /* .DBF file descriptor */
+
char *dbf; /* .DBF file descriptor */
int rc; /* Return code */
+
int rc; /* Return code */
  
 
rc = dbclose(dbf);
 
rc = dbclose(dbf);
if (rc = = SUCCESS) printf("database closed n");
+
if (rc == SUCCESS) printf("database closed \n");
 
else {
 
else {
printf("error number %d n");
+
printf("error number %d \n");
 
exit (1);
 
exit (1);
 
}
 
}

Latest revision as of 11:30, 1 May 2009

PURPOSE

close database file


SYNOPSIS

#include "dbl.h"
 
	int	dbclose(dbf)
 
	<input parameter>
	char	*dbf;		/* Database file descriptor */
 
	<output parameter>
	none


RETURN VALUE

The dbclose() 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

The dbclose() function is used to close the specified database (.DBF) file in the file descriptor.


EXAMPLE

The following example closes a .DBF file whose file descriptor is in "char *dbf;".

#include "dbl.h"
	char	*dbf;		/* .DBF file descriptor */
	int	rc;		/* Return code */
 
	rc = dbclose(dbf);
	if (rc == SUCCESS) printf("database closed \n");
	else {
		printf("error number %d \n");
		exit (1);
	}


SEE ALSO

dbiclose(), dbopen()