DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
Functions
stbdbram.h File Reference

Header file - Function prototypes for RAM database. More...

#include "techtype.h"
#include "dba_nvm.h"

Go to the source code of this file.

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...
 

Detailed Description

Header file - Function prototypes for RAM database.

Date
06/09/2000

Function Documentation

void* STB_CreateRAMRecord ( U8BIT  rec_id,
U16BIT  size,
U16BIT  nvm_block,
void *  parent 
)

Creates a record of the type given in RAM (mallocs block).

Parameters
U8BITrec_id - the ID of the record to be created
U16BITsize - the size the record to be created (in bytes)
U16BITnvm_block - the ID of the corresponding NVM block
void*parent - the pointer to record parent
Returns
void* - pointer to record created, NULL if failed.
void STB_DestroyRAMRecord ( void *  rec_ptr)

Destroys record given in RAM (frees block).

Parameters
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.

Parameters
U8BITrec_id - the ID of the record
void*parent - the parent of the record
void*last_rec - last record found (NULL in none)
Returns
void* - pointer to next record (NULL if no more).
void* STB_FindRAMRecordFromNVMBlock ( U16BIT  nvm_block)

Returns pointer to RAM structure which relates to the given NVM record block no.

Parameters
U16BITnvm_blk - the block number of the NVM record
Returns
void* - pointer to RAM record (NULL if not found).
U8BIT STB_GetRAMRecordId ( void *  rec_ptr)

Returns record type id for given record pointer.

Parameters
void*rec_ptr - pointer to the record
Returns
U8BIT - record id.
U16BIT STB_GetRAMRecordNextNVMBlock ( void *  rec_ptr)

Returns NVM block number for next record of given pointer.

Parameters
void*rec_ptr - pointer to the record
Returns
U16BIT - NVM block.
U32BIT STB_GetRAMRecordNumber ( void *  rec_ptr,
U16BIT  offset,
U16BIT  size 
)

Reads the specified value of a field from a RAM record.

Parameters
void*rec_ptr - pointer to the start of the RAM record
U16BIToffset - field byte offset into the record
U16BITsize - field byte size in the record
Returns
U32BIT - the numeric value of the field.
U16BIT STB_GetRAMRecordNVMBlock ( void *  rec_ptr)

Returns NVM block number for given record pointer.

Parameters
void*rec_ptr - pointer to the record
Returns
U16BIT - NVM block.
void* STB_GetRAMRecordParent ( void *  rec_ptr)

Returns parent pointer for given record pointer.

Parameters
void*rec_ptr - pointer to the record
Returns
void* - pointer to the parent.
void* STB_GetRAMRecordPointer ( void *  rec_ptr,
U16BIT  offset 
)

Reads the specified value of a field from a RAM record.

Parameters
void*rec_ptr - pointer to the start of the RAM record
U16BIToffset - field byte offset into the record
U16BITsize - field byte size in the record
Returns
U32BIT - the numeric value of the field.
U16BIT STB_GetRAMRecordPrevNVMBlock ( void *  rec_ptr)

Returns NVM block number for previous record of given pointer.

Parameters
void*rec_ptr - pointer to the record
Returns
U16BIT - NVM block.
U8BIT* STB_GetRAMRecordString ( void *  rec_ptr,
U16BIT  offset,
U16BIT  size 
)

Reads the specified value of a field from a RAM record.

Parameters
void*rec_ptr - pointer to the start of the RAM record
U16BIToffset - field byte offset into the record
U16BITsize - field byte size in the record
U8BITtype - the datatype of 'value'
Returns
U32BIT - the numeric value of the field.
void STB_MoveRAMRecordAfter ( void *  rec_ptr,
void *  dst_ptr 
)

Moves RAM record after the specified record in the RAM linked list.

Parameters
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.

Parameters
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.

Parameters
void*rec_ptr - pointer to the start of the RAM record
U16BIToffset - field byte offset into the record
U16BITsize - field byte size in the record
U32BITvalue - the numeric value of the field
void STB_SetRAMRecordParent ( void *  rec_ptr,
void *  parent 
)

Sets parent pointer for given record pointer.

Parameters
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.

Parameters
void*rec_ptr - pointer to the start of the RAM record
U16BIToffset - field byte offset into the record
U16BITsize - field byte size in the record
U32BITvalue - 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.

Parameters
void*rec_ptr - pointer to the start of the RAM record
U16BIToffset - field byte offset into the record
U16BITsize - field byte size in the record
U8BIT*string - pointer to string field