Difference between revisions of "Dbmopen()"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 37: | Line 37: | ||
<code lang="c"> | <code lang="c"> | ||
#include "dbl.h" | #include "dbl.h" | ||
− | char *dbt; /* .DBT | + | char *dbt; /* .DBT file descriptor */ |
int rc; /* Return code */ | int rc; /* Return code */ | ||
Latest revision as of 13:49, 1 May 2009
PURPOSE
open an existing .DBT file
SYNOPSIS
#include "dbl.h" int dbmopen(dbtname, dbt) <input parameters> char *dbtname; /* Address of a buffer containing the name of a .DBT file to be opened */ <output parameter> char *dbt; /* The .DBT file descriptor */
RETURN VALUE
The dbmopen() 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 opens a .DBT file whose name is passed to the function. The .DBT file descriptor is returned. A call to the dbmclose() function which closes a .DBT file releases the file descriptor for reuse.
EXAMPLE
This example opens an existing memo file "MEMO.DBT" and returns its file descriptor in "char *dbt".
#include "dbl.h" char *dbt; /* .DBT file descriptor */ int rc; /* Return code */ rc = dbmopen("memo.dbt", &dbt); if (rc == SUCCESS) printf("memo opened \n"); else { printf("error number %d \n", rc); exit (1); }