home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
DOOG
/
CBASE09.ZIP
/
BTREE.ZIP
/
BTGETLCK.C
< prev
next >
Wrap
Text File
|
1989-08-31
|
1KB
|
45 lines
/* Copyright (c) 1989 Citadel */
/* All Rights Reserved */
/* #ident "btgetlck.c 1.1 - 89/07/03" */
#include "btree_.h"
/*man---------------------------------------------------------------------------
NAME
btgetlck - get btree lock status
SYNOPSIS
#include <btree.h>
int btgetlck(btp)
btree_t *btp;
DESCRIPTION
The btgetlck function reports the lock status of a btree. The btp
argument is an open btree. The function returns the status of the
lock currently held by the calling process. Locks held by other
processes are not reported.
The possible return values are:
BT_RDLCK btree locked for reading
BT_WRLCK btree locked for reading and writing
BT_UNLCK btree not locked
SEE ALSO
btlock.
------------------------------------------------------------------------------*/
int btgetlck(btp)
btree_t *btp;
{
if (!(btp->flags & BTLOCKS)) {
return BT_UNLCK;
} else if (btp->flags & BTWRLCK) {
return BT_WRLCK;
}
return BT_RDLCK;
}