Atoms refer to strings which are allocated once and are stored in the atom table for the lifetime of the application.
More...
|
#define | AT_MAX_ATOM_SIZE 384 |
| Maximum size of an atom.
|
|
|
DECONZ_DLLSPEC void | AT_Init (unsigned max_atoms) |
| Initialize atom table, called by core.
|
|
DECONZ_DLLSPEC void | AT_Destroy (void) |
| Destroyes atom table, called by core.
|
|
DECONZ_DLLSPEC int | AT_AddAtomString (const void *data) |
| Adds an atom from zero terminated C-String.
|
|
DECONZ_DLLSPEC int | AT_AddAtom (const void *data, unsigned size, AT_AtomIndex *ati) |
| Adds an atom with data and size.
|
|
DECONZ_DLLSPEC int | AT_GetAtomIndex (const void *data, unsigned size, AT_AtomIndex *ati) |
| Returns the atom index for given data.
|
|
DECONZ_DLLSPEC AT_Atom | AT_GetAtomByIndex (AT_AtomIndex ati) |
| Returns the atom for given index.
|
|
Atoms refer to strings which are allocated once and are stored in the atom table for the lifetime of the application.
They can be referenced by a unique and stable index.
◆ AT_AddAtom()
DECONZ_DLLSPEC int AT_AddAtom |
( |
const void * |
data, |
|
|
unsigned |
size, |
|
|
AT_AtomIndex * |
ati |
|
) |
| |
Adds an atom with data and size.
This function can be called multiple times, the atom will only be added once.
- Parameters
-
data | the data of the atom (doesn't need to be zero terminated) |
size | size of the data |
ati | pointer to atom index which will be set on success |
- Returns
- 1 on success
◆ AT_AddAtomString()
DECONZ_DLLSPEC int AT_AddAtomString |
( |
const void * |
data | ) |
|
Adds an atom from zero terminated C-String.
- Parameters
-
data | a zero terminated C-string |
- Returns
- 1 on success
◆ AT_GetAtomByIndex()
Returns the atom for given index.
- Parameters
-
- Returns
- a valid atom if found, or zero length atom if not found
◆ AT_GetAtomIndex()
DECONZ_DLLSPEC int AT_GetAtomIndex |
( |
const void * |
data, |
|
|
unsigned |
size, |
|
|
AT_AtomIndex * |
ati |
|
) |
| |
Returns the atom index for given data.
- Parameters
-
data | the data of the atom (doesn't need to be zero terminated) |
size | size of the data |
ati | pointer to atom index which will be set on success |
- Returns
- 1 on success