Dbmopen()

From Recital Documentation Wiki
Revision as of 13:48, 1 May 2009 by Yvonnemilne (Talk | contribs)

Jump to: navigation, search

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 filw 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);
	}


SEE ALSO

dbgetm(), dbmclose(), dbmcreat(), dbopen(), dbputm()