Difference between revisions of "Dblocki()"

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 locked */
+
char *ndx; /* File descriptor of a .NDX file to be locked */
  
 
<output parameter>
 
<output parameter>
Line 35: Line 35:
 
<code lang="c">
 
<code lang="c">
 
#include "dbl.h"
 
#include "dbl.h"
char *ndx; /* Index file descriptor */
+
char *ndx; /* Index file descriptor */
int rc; /* Return value */
+
int rc; /* Return value */
  
 
rc = dblocki(ndx);
 
rc = dblocki(ndx);
if (rc = SUCCESS) printf("index is locked n");
+
if (rc == SUCCESS) printf("index is locked \n");
 
else {
 
else {
printf("index could not be locked n");
+
printf("index could not be locked \n");
 
return (ERROR);
 
return (ERROR);
 
}</code>
 
}</code>

Latest revision as of 13:40, 1 May 2009

PURPOSE

lock an index file


SYNOPSIS

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


RETURN VALUE

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


EXAMPLE

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

#include "dbl.h"
	char	*ndx;	/* Index file descriptor */
	int	rc;		/* Return value */
 
	rc = dblocki(ndx);
	if (rc == SUCCESS) printf("index is locked \n");
	else {
		printf("index could not be locked \n");
		return (ERROR);
	}


SEE ALSO

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