DBF LOCKF()

From Lianjapedia
Jump to: navigation, search

PURPOSE

Lock a table

SYNONYM

api_dbf_lockf()

SYNOPSIS

#include "lianja_api.h"
 
int	DBF_LOCKF()
 
<input parameters>
none
 
<output parameters>
none

DESCRIPTION

The DBF_LOCKF() function will lock the table in the current cursor. A value of -1 will be returned if there is no table open in the current cursor.

The file lock will be issued on the shared table when no other user has a file or record lock current.

The table will still be opened shared for readonly access for other users however they will not be able to update any records until you release the file lock.

EXAMPLE

The following example locks the current table.

#include "lianja_api.h"
 
lianjaapi_dbf_lockf()
{
    int	locked;
 
    if  (DBF_ISEXCLUSIVE() == 0 ) {
       locked = DBF_LOCKF();
    } else {
       locked = -1;
    }
 
    _retl( (locked >= 0) ? 1 : 0 );
 
}

SEE ALSO

BLOB_UPDATE(), BLOB_WRITE(), DBF_APPEND(), DBF_DELETE(), DBF_ISEXCLUSIVE(), DBF_ISREADONLY(), DBF_LOCKR(), DBF_RECALL(), DBF_UNLOCKF(), DBF_UNLOCKR(), DBF_UPDATE(), FIELD_UPDATE(), MEMO_UPDATE(), MEMO_WRITE()