Difference between revisions of "Dbunlocki()"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
Line 11: Line 11:
  
 
<input parameter>
 
<input parameter>
char *ndx; /* File descriptor of a .NDX file to be unlocked */
+
char *ndx; /* File descriptor of a .NDX file to be unlocked */
  
 
<output parameter>
 
<output parameter>
Line 38: Line 38:
 
#include "dbl.h"
 
#include "dbl.h"
  
char *ndx; /* Index file descriptor */
+
char *ndx; /* Index file descriptor */
int rc; /* Return code */
+
int rc; /* Return code */
  
 
rc = dbunlock(ndx);
 
rc = dbunlock(ndx);
if (rc = SUCCESS) printf("index is unlocked n");
+
if (rc == SUCCESS) printf("index is unlocked \n");
 
else {
 
else {
printf("error number %d n", rc);
+
printf("error number %d \n", rc);
 
return (ERROR);
 
return (ERROR);
 
}
 
}

Latest revision as of 15:46, 1 May 2009

PURPOSE

unlock an index file


SYNOPSIS

#include "dbl.h"
 
	int	dbunlocki(ndx)
 
	<input parameter>
	char	*ndx;	/* File descriptor of a .NDX file to be unlocked */
 
	<output parameter>
	none


RETURN VALUE

The dbunlocki() 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 dbunlocki() function unlocks the index file from the given file descriptor "char *ndx".


EXAMPLE

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

#include "dbl.h"
 
	char	*ndx;	/* Index file descriptor */
	int	rc;		/* Return code */
 
	rc = dbunlock(ndx);
	if (rc == SUCCESS) printf("index is unlocked \n");
	else {
		printf("error number %d \n", rc);
		return (ERROR);
	}


SEE ALSO

dbfilemode(), dblockf(), dblocki(), dblockr(), dbtlockf(), dbtlockr(), dbunlockf(), dbunlockr()