db_get_flag()

Purpose

Obtains a database header entry from a DP4 database

Old name

#define get_db_flag db_get_flag

Syntax (CCOWN)

int db_get_flag(int flag_nr);

Syntax (DP4DBAPI)

int dp4_db_get_flag(DCONN * dconn,int flag_nr);

Parameters

int flag_nr

Value indicating which header flag is to be retrieved

 

This parameter used to be an offset from the nr_system field of the header record (struct DATABASE) stored at the beginning of the index database file. However as of release 4.622 the values are logical flags, and not all flag values corrsespond to the offset of the flag to be read.

Description

The db_get_flag() function obtains the entry for the specified flag in the database header record (struct DATABASE in btrees.h) .

This function is primarily for internal use. The permitted flag values are given in dbflags.h. Most useful values in the header can more easily be accessed by fetching the virtual db_status record for the database.

Return values

Returns the value read from the database header record

Example

/* This returns the value of nr_system */
db_get_flag(DBF_NR_SYSTEM)