dbState.h

Generic IOC state facility.

This library provides a simple global flag facility that can be used to synchronize e.g. plugins with IOC-wide states, that may be derived from events (either soft events or hard events coming from specialized timing and event hardware).

A subset of this API is provided as IOC Shell commands to allow command line debugging.

Typedefs

typedef struct dbState *dbStateId

Functions

dbStateId dbStateCreate(const char *name)

Create db state.

Creates a new db state with the specified ‘name’, returning the new id. If state with that name already exists, the existing state’s id is returned.

Also provided as an IOC Shell command.

Parameters:

name – Db state name.

Returns:

Id of db state, NULL for failure.

dbStateId dbStateFind(const char *name)

Find db state.

Parameters:

name – Db state name.

Returns:

Id of db state, NULL if not found.

void dbStateSet(dbStateId id)

Set db state to TRUE.

Also provided as an IOC Shell command.

Parameters:

id – Db state id.

void dbStateClear(dbStateId id)

Set db state to FALSE.

Also provided as an IOC Shell command.

Parameters:

id – Db state id.

int dbStateGet(dbStateId id)

Get db state.

Parameters:

id – Db state id.

Returns:

Current db state (0|1).

void dbStateShow(dbStateId id, unsigned int level)

Print info about db state.

Also provided as an IOC Shell command.

Parameters:
  • id – Db state id.

  • level – Interest level.

void dbStateShowAll(unsigned int level)

Print info about all db states.

Also provided as an IOC Shell command.

Parameters:

level – Interest level.