hamsterdb Embedded Database 1.1.13
Data Fields

ham_record_t Struct Reference

#include <hamsterdb.h>

Data Fields

ham_size_t size
void * data
ham_u32_t flags
ham_u32_t partial_offset
ham_size_t partial_size
ham_u32_t _intflags
ham_u64_t _rid

Detailed Description

A generic record.

A record represents data items in hamsterdb. Before using a record, it is important to initialize all record fields with zeroes, i.e. with the C library routines memset(3) or bzero(2).

When hamsterdb returns a record structure, the pointer to the record data is provided in data. This pointer is only temporary and will be overwritten by subsequent hamsterdb API calls.

To avoid this, the calling application can allocate the data pointer. In this case, you have to set the flag HAM_RECORD_USER_ALLOC. The size parameter will then return the size of the record. It's the responsibility of the caller to make sure that the data parameter is large enough for the record.

Definition at line 161 of file hamsterdb.h.


Field Documentation

For internal use

Definition at line 179 of file hamsterdb.h.

For internal use

Definition at line 182 of file hamsterdb.h.

Pointer to the record data

Definition at line 167 of file hamsterdb.h.

Referenced by ham::record::get_data(), main(), ham::record::record(), and ham::record::set_data().

The record flags; see HAM_RECORD_USER_ALLOC

Definition at line 170 of file hamsterdb.h.

Referenced by ham::record::get_flags(), ham::record::record(), and ham::record::set_flags().

Offset for partial reading/writing; see HAM_PARTIAL

Definition at line 173 of file hamsterdb.h.

Size for partial reading/writing; see HAM_PARTIAL

Definition at line 176 of file hamsterdb.h.

The size of the record data, in bytes

Definition at line 164 of file hamsterdb.h.

Referenced by ham::record::get_size(), main(), ham::record::record(), and ham::record::set_size().


The documentation for this struct was generated from the following file: