Difference between revisions of "Dbunlockr()"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
Line 11: Line 11:
  
 
<input parameter>
 
<input parameter>
char *dbf; /* File descriptor of a .DBF file to be unlocked */
+
char *dbf; /* File descriptor of a .DBF file to be unlocked */
int recno; /* Record number to unlock */
+
int recno; /* Record number to unlock */
  
 
<output parameter>
 
<output parameter>
Line 39: Line 39:
 
#include "dbl.h"
 
#include "dbl.h"
  
char *dbf; /* Database file descriptor */
+
char *dbf; /* Database file descriptor */
int rc; /* Return code */
+
int rc; /* Return code */
  
 
rc = dbunlockr(dbf, 5);
 
rc = dbunlockr(dbf, 5);
if (rc = SUCCESS) printf("record 5 in unlocked n");
+
if (rc == SUCCESS) printf("record 5 in 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:51, 1 May 2009

PURPOSE

unlock a record in a database table file


SYNOPSIS

#include "dbl.h"
 
	int	dbunlockr(dbf, recno)
 
	<input parameter>
	char	*dbf;			/* File descriptor of a .DBF file to be unlocked */
	int	recno;		/* Record number to unlock */
 
	<output parameter>
	none


RETURN VALUE

The dbunlockr() 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 dbunlockr() function unlocks a record in the database file from the given file descriptor "char *dbf". The record unlocked is the number in "int recno".


EXAMPLE

The following example unlocks record number 5 in the .DBF file whose file descriptor is in "char *dbf".

#include "dbl.h"
 
	char	*dbf;		/* Database file descriptor */
	int	rc;		/* Return code */
 
	rc = dbunlockr(dbf, 5);
	if (rc == SUCCESS) printf("record 5 in unlocked \n");
	else {
		printf("error number %d \n", rc);
		return (ERROR);
	}


SEE ALSO

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