![]() |
DVBCore
22.3.0
Open Source DVB Engine
|
RAM database functions. More...
#include <string.h>
#include <techtype.h>
#include <dbgfuncs.h>
#include "dba.h"
#include "dba_nvm.h"
#include "stbdbram.h"
#include "stbdbnvm.h"
#include "stbllist.h"
#include "stbheap.h"
Classes | |
struct | RAM_DB_HEADER |
Functions | |
void | STB_InitRAMAccess (void) |
Initialises parameters needed for RAM record access. | |
void | STB_PurgeRAMRecords (void) |
Initialises RAM database by destroying all records and linked lists. | |
void * | STB_CreateRAMRecord (U8BIT rec_id, U16BIT size, U16BIT nvm_block, void *parent) |
Creates a record of the type given in RAM (mallocs block). More... | |
void | STB_DestroyRAMRecord (void *rec_ptr) |
Destroys record given in RAM (frees block). More... | |
U8BIT | STB_GetRAMRecordId (void *rec_ptr) |
Returns record type id for given record pointer. More... | |
U16BIT | STB_GetRAMRecordNVMBlock (void *rec_ptr) |
Returns NVM block number for given record pointer. More... | |
U16BIT | STB_GetRAMRecordPrevNVMBlock (void *rec_ptr) |
Returns NVM block number for previous record of given pointer. More... | |
U16BIT | STB_GetRAMRecordNextNVMBlock (void *rec_ptr) |
Returns NVM block number for next record of given pointer. More... | |
void * | STB_GetRAMRecordParent (void *rec_ptr) |
Returns parent pointer for given record pointer. More... | |
void | STB_SetRAMRecordParent (void *rec_ptr, void *parent) |
Sets parent pointer for given record pointer. More... | |
void | STB_MoveRAMRecordBefore (void *rec_ptr, void *dst_ptr) |
Moves RAM record before the specified record in the RAM linked list. More... | |
void | STB_MoveRAMRecordAfter (void *rec_ptr, void *dst_ptr) |
Moves RAM record after the specified record in the RAM linked list. More... | |
void * | STB_FindRAMRecordFromId (U8BIT rec_id, void *parent, void *last_rec) |
Returns pointer to RAM structure for the given record type. Finds the next record in the list after the last_rec or first if NULL. More... | |
void * | STB_FindRAMRecordFromNVMBlock (U16BIT nvm_block) |
Returns pointer to RAM structure which relates to the given NVM record block no. More... | |
void | STB_SetRAMRecordString (void *rec_ptr, U16BIT offset, U16BIT size, U8BIT *string) |
Writes the specified string into a field of a RAM record. More... | |
void | STB_SetRAMRecordNumber (void *rec_ptr, U16BIT offset, U16BIT size, U32BIT value) |
Writes the specified value into a field of a RAM record. More... | |
void | STB_SetRAMRecordPointer (void *rec_ptr, U16BIT offset, void *ptr) |
Writes the specified value into a field of a RAM record. More... | |
U8BIT * | STB_GetRAMRecordString (void *rec_ptr, U16BIT offset, U16BIT size) |
Reads the specified value of a field from a RAM record. More... | |
U32BIT | STB_GetRAMRecordNumber (void *rec_ptr, U16BIT offset, U16BIT size) |
Reads the specified value of a field from a RAM record. More... | |
void * | STB_GetRAMRecordPointer (void *rec_ptr, U16BIT offset) |
Reads the specified value of a field from a RAM record. More... | |
RAM database functions.
void* STB_CreateRAMRecord | ( | U8BIT | rec_id, |
U16BIT | size, | ||
U16BIT | nvm_block, | ||
void * | parent | ||
) |
Creates a record of the type given in RAM (mallocs block).
U8BIT | rec_id - the ID of the record to be created |
U16BIT | size - the size the record to be created (in bytes) |
U16BIT | nvm_block - the ID of the corresponding NVM block |
void* | parent - the pointer to record parent |
void STB_DestroyRAMRecord | ( | void * | rec_ptr | ) |
Destroys record given in RAM (frees block).
void* | rec_ptr - pointer to the record to be deleted |
void* STB_FindRAMRecordFromId | ( | U8BIT | rec_id, |
void * | parent, | ||
void * | last_rec | ||
) |
Returns pointer to RAM structure for the given record type. Finds the next record in the list after the last_rec or first if NULL.
U8BIT | rec_id - the ID of the record |
void* | parent - the parent of the record |
void* | last_rec - last record found (NULL in none) |
void* STB_FindRAMRecordFromNVMBlock | ( | U16BIT | nvm_block | ) |
Returns pointer to RAM structure which relates to the given NVM record block no.
U16BIT | nvm_blk - the block number of the NVM record |
U8BIT STB_GetRAMRecordId | ( | void * | rec_ptr | ) |
Returns record type id for given record pointer.
void* | rec_ptr - pointer to the record |
U16BIT STB_GetRAMRecordNextNVMBlock | ( | void * | rec_ptr | ) |
Returns NVM block number for next record of given pointer.
void* | rec_ptr - pointer to the record |
U32BIT STB_GetRAMRecordNumber | ( | void * | rec_ptr, |
U16BIT | offset, | ||
U16BIT | size | ||
) |
Reads the specified value of a field from a RAM record.
void* | rec_ptr - pointer to the start of the RAM record |
U16BIT | offset - field byte offset into the record |
U16BIT | size - field byte size in the record |
U16BIT STB_GetRAMRecordNVMBlock | ( | void * | rec_ptr | ) |
Returns NVM block number for given record pointer.
void* | rec_ptr - pointer to the record |
void* STB_GetRAMRecordParent | ( | void * | rec_ptr | ) |
Returns parent pointer for given record pointer.
void* | rec_ptr - pointer to the record |
void* STB_GetRAMRecordPointer | ( | void * | rec_ptr, |
U16BIT | offset | ||
) |
Reads the specified value of a field from a RAM record.
void* | rec_ptr - pointer to the start of the RAM record |
U16BIT | offset - field byte offset into the record |
U16BIT | size - field byte size in the record |
U16BIT STB_GetRAMRecordPrevNVMBlock | ( | void * | rec_ptr | ) |
Returns NVM block number for previous record of given pointer.
void* | rec_ptr - pointer to the record |
U8BIT* STB_GetRAMRecordString | ( | void * | rec_ptr, |
U16BIT | offset, | ||
U16BIT | size | ||
) |
Reads the specified value of a field from a RAM record.
void* | rec_ptr - pointer to the start of the RAM record |
U16BIT | offset - field byte offset into the record |
U16BIT | size - field byte size in the record |
U8BIT | type - the datatype of 'value' |
void STB_MoveRAMRecordAfter | ( | void * | rec_ptr, |
void * | dst_ptr | ||
) |
Moves RAM record after the specified record in the RAM linked list.
void* | rec_ptr - pointer to the record |
void* | dst_ptr - pointer to destination |
void STB_MoveRAMRecordBefore | ( | void * | rec_ptr, |
void * | dst_ptr | ||
) |
Moves RAM record before the specified record in the RAM linked list.
void* | rec_ptr - pointer to the record |
void* | dst_ptr - pointer to destination |
void STB_SetRAMRecordNumber | ( | void * | rec_ptr, |
U16BIT | offset, | ||
U16BIT | size, | ||
U32BIT | value | ||
) |
Writes the specified value into a field of a RAM record.
void* | rec_ptr - pointer to the start of the RAM record |
U16BIT | offset - field byte offset into the record |
U16BIT | size - field byte size in the record |
U32BIT | value - the numeric value of the field |
void STB_SetRAMRecordParent | ( | void * | rec_ptr, |
void * | parent | ||
) |
Sets parent pointer for given record pointer.
void* | rec_ptr - pointer to the record |
void* | parent - pointer to the required parent. Could be NULL for no parent. |
void STB_SetRAMRecordPointer | ( | void * | rec_ptr, |
U16BIT | offset, | ||
void * | ptr | ||
) |
Writes the specified value into a field of a RAM record.
void* | rec_ptr - pointer to the start of the RAM record |
U16BIT | offset - field byte offset into the record |
U16BIT | size - field byte size in the record |
U32BIT | value - the numeric value of the field |
void STB_SetRAMRecordString | ( | void * | rec_ptr, |
U16BIT | offset, | ||
U16BIT | size, | ||
U8BIT * | string | ||
) |
Writes the specified string into a field of a RAM record.
void* | rec_ptr - pointer to the start of the RAM record |
U16BIT | offset - field byte offset into the record |
U16BIT | size - field byte size in the record |
U8BIT* | string - pointer to string field |