DFINDLK C-3

NAME

dfindlk - find last record with given primary key

SYNOPSIS

#include <cbase/dirio.h>

rno_t dfindlk (buffer, fcb)

char *buffer;

DFILE *fcb;

DESCRIPTION

Dfindlk finds the last occurrence of a keyed record in an opened RMSfile. The primary key for the record desired must be stored in buffer before calling dfindlk.

Fcb is the file block pointer returned by dlopen(C-3) or dopen(C-3).

The returned record number may be saved and used on a subsequent call to dread(C-3). The record found is returned in buffer.

All character positions in the primary key field are used in determining the key value. The function strncpy is recommended for storing string key values in buffer.

SEE ALSO

dlopen(C-3), dopen(C-3), dread(C-3), strncpy(C-3)

Chapter 4,

RMS Programming Guide

DIAGNOSTICS

Dfindlk returns a value of BAD (-1) if the record is not found or if an I/O error occurred. If the record is not found, the contents of buffer are undefined.