Dbtlockr()

From Recital Documentation Wiki
Jump to: navigation, search

PURPOSE

test for a lock on a record in a database table file


SYNOPSIS

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


RETURN VALUE

The dblockr() 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.


DECRIPTION

The dblockr() function tests to see if a record is locked by another user.


EXAMPLE

The following example test locks 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 = dbtlockr(dbf, 5);
	if (rc = SUCCESS) printf("record 5 is locked \n");
	else {
		printf("record 5 could not be locked \n");
		return (ERROR);
	}


SEE ALSO

dbfilemode(), dblockf(), dblocki(), dblockr(), dbunlockf(), dbunlocki(), dbunlockr()