smax-clib v0.9
A C/C++ client library for SMA-X
Loading...
Searching...
No Matches
smax-easy.c File Reference

A set of functions for simplified access to SMA-X for specific variable types. More...

Functions

XFieldsmaxCreate1DField (const char *name, XType type, int size, const void *value)
 
XFieldsmaxCreateBooleanField (const char *name, boolean value)
 
XFieldsmaxCreateDoubleField (const char *name, double value)
 
XFieldsmaxCreateIntField (const char *name, int value)
 
XFieldsmaxCreateLongField (const char *name, long long value)
 
XFieldsmaxCreateScalarField (const char *name, XType type, const void *value)
 
XFieldsmaxCreateStringField (const char *name, const char *value)
 
int smaxGetArrayField (const XStructure *s, const char *name, void *dst, XType type, int count)
 
boolean smaxGetBooleanField (const XStructure *s, const char *name, boolean defaultValue)
 
double smaxGetDoubleField (const XStructure *s, const char *name, double defaultValue)
 
long long smaxGetLongField (const XStructure *s, const char *name, long long defaultValue)
 
char * smaxGetRawField (const XStructure *s, const char *name, char *defaultValue)
 
double smaxPullDouble (const char *table, const char *key)
 
double smaxPullDoubleDefault (const char *table, const char *key, double defaultValue)
 
double * smaxPullDoubles (const char *table, const char *key, XMeta *meta, int *n)
 
int smaxPullInt (const char *table, const char *key, int defaultValue)
 
int * smaxPullInts (const char *table, const char *key, XMeta *meta, int *n)
 
long long smaxPullLong (const char *table, const char *key, long long defaultValue)
 
long long * smaxPullLongs (const char *table, const char *key, XMeta *meta, int *n)
 
char * smaxPullRaw (const char *table, const char *key, XMeta *meta, int *status)
 
char * smaxPullString (const char *table, const char *key)
 
char ** smaxPullStrings (const char *table, const char *key, XMeta *meta, int *n)
 
XStructuresmaxPullStruct (const char *id, XMeta *meta, int *status)
 
int smaxShareBoolean (const char *table, const char *key, boolean value)
 
int smaxShareBooleans (const char *table, const char *key, const boolean *values, int n)
 
int smaxShareBytes (const char *table, const char *key, const char *values, int n)
 
int smaxShareDouble (const char *table, const char *key, double value)
 
int smaxShareDoubles (const char *table, const char *key, const double *values, int n)
 
int smaxShareFloats (const char *table, const char *key, const float *values, int n)
 
int smaxShareHex (const char *table, const char *key, long long value)
 
int smaxShareInt (const char *table, const char *key, long long value)
 
int smaxShareInts (const char *table, const char *key, const int *values, int n)
 
int smaxShareLongs (const char *table, const char *key, const long long *values, int n)
 
int smaxShareShorts (const char *table, const char *key, const short *values, int n)
 
int smaxShareString (const char *table, const char *key, const char *sValue)
 
int smaxShareStrings (const char *table, const char *key, const char **sValues, int n)
 
int smaxWaitOnSubscribed (const char *table, const char *key, int timeout)
 
int smaxWaitOnSubscribedGroup (const char *matchTable, char **changedKey, int timeout)
 
int smaxWaitOnSubscribedVar (const char *matchKey, char **changedTable, int timeout)
 

Detailed Description

A set of functions for simplified access to SMA-X for specific variable types.

Date
Apr 6, 2019
Author
Attila Kovacs

Function Documentation

◆ smaxCreate1DField()

XField * smaxCreate1DField ( const char *  name,
XType  type,
int  size,
const void *  value 
)

Creates a field for 1-D array of a given name and type using specified native values. It is like xCreate1DField() except that the field is created in serialized form.

Parameters
nameField name
typeStorage type, e.g. X_INT.
sizeArray size.
valuePointer to the native array in memory.
Returns
A newly created field with the supplied data, or NULL if there was an error.
See also
xSetField()

References smaxCreateField(), and x_trace_null().

◆ smaxCreateBooleanField()

XField * smaxCreateBooleanField ( const char *  name,
boolean  value 
)

Creates a field holding a single boolean value. It is like xCreateBooleanField() except that the field is created in serialized form.

Parameters
nameField name
valueAssociated value
Returns
A newly created field with the supplied data, or NULL if there was an error.
See also
xSetField()

References smaxCreateScalarField(), X_BOOLEAN, and x_trace_null().

◆ smaxCreateDoubleField()

XField * smaxCreateDoubleField ( const char *  name,
double  value 
)

Creates a field holding a single double-precision value. It is like xCreateDoubleField() except that the field is created in serialized form.

Parameters
nameField name
valueAssociated value
Returns
A newly created field with the supplied data, or NULL if there was an error.
See also
xSetField()

References smaxCreateScalarField(), X_DOUBLE, and x_trace_null().

◆ smaxCreateIntField()

XField * smaxCreateIntField ( const char *  name,
int  value 
)

Creates a field holding a single integer value. It is like xCreateIntField() except that the field is created in serialized form.

Parameters
nameField name
valueAssociated value
Returns
A newly created field with the supplied data, or NULL if there was an error.
See also
xSetField()

References smaxCreateScalarField(), X_INT, and x_trace_null().

◆ smaxCreateLongField()

XField * smaxCreateLongField ( const char *  name,
long long  value 
)

Creates a field holding a single wide (64-bit) integer value. It is like xCreateLongField() except that the field is created in serialized form.

Parameters
nameField name
valueAssociated value
Returns
A newly created field with the supplied data, or NULL if there was an error.
See also
xSetField()

References smaxCreateScalarField(), X_LONG, and x_trace_null().

◆ smaxCreateScalarField()

XField * smaxCreateScalarField ( const char *  name,
XType  type,
const void *  value 
)

Creates a scalar field of a given name and type using the specified native value. It is like xCreateScalarField() except that the field is created in serialized form.

Parameters
nameField name
typeStorage type, e.g. X_INT.
valuePointer to the native data location in memory.
Returns
A newly created scalar field with the supplied data, or NULL if there was an error.
See also
xSetField()

References smaxCreate1DField(), and x_trace_null().

◆ smaxCreateStringField()

XField * smaxCreateStringField ( const char *  name,
const char *  value 
)

Creates a field holding a single string value. It is like xCreateStringField() except that the field is created in serialized form.

Parameters
nameField name
valueAssociated value
Returns
A newly created field referencing the supplied string, or NULL if there was an error.

References smaxCreateScalarField(), X_STRING, and x_trace_null().

◆ smaxGetArrayField()

int smaxGetArrayField ( const XStructure s,
const char *  name,
void *  dst,
XType  type,
int  count 
)

Gets the data of an SMA-X structure field as an array of values of the specified type and element count. The field's data will be truncated or padded with zeroes to provide the requested element count always.

Parameters
sPointer to SMA-X structure
nameField name
[out]dstArray to return values in.
typeType of data.
countNumber of elements in return array. The field data will be truncated or padded as necessary.
Returns
X_SUCCESS (0) if successful, or X_STRUCT_INVALID if the input structure is NULL, X_NULL if dst is NULL, X_SIZE_INVALID if n is 0 or negative, X_NAME_INVALID if the structure does not have a field by the specified name, or else an error returned by smaxStringtoValues().

References smaxStringToValues(), XField::value, x_error(), X_NAME_INVALID, X_NULL, X_SIZE_INVALID, X_STRUCT_INVALID, X_SUCCESS, and xGetField().

◆ smaxGetBooleanField()

boolean smaxGetBooleanField ( const XStructure s,
const char *  name,
boolean  defaultValue 
)

Returns the first value in a structure's field as an integer, or the specified default value if there is no such field in the structure, or the content cannot be parse into an integer.

Parameters
sPointer to the XStructure.
nameField name
defaultValueValue to return if no corresponding integer field value.
Returns
The (first) field value as a long long, or the default value if there is no such field.
See also
xGetField()

References XField::value, xGetField(), and xParseBoolean().

◆ smaxGetDoubleField()

double smaxGetDoubleField ( const XStructure s,
const char *  name,
double  defaultValue 
)

Returns the first value in a structure's field as a double precision float, or the specified default value if there is no such field in the structure, or the content cannot be parse into an double.

Parameters
sPointer to the XStructure.
nameField name
defaultValueValue to return if no corresponding integer field value.
Returns
The (first) field value as a double, or the specified default if there is no such field.
See also
xGetField()

References XField::value, and xGetField().

◆ smaxGetLongField()

long long smaxGetLongField ( const XStructure s,
const char *  name,
long long  defaultValue 
)

Returns the first value in a structure's field as an integer, or the specified default value if there is no such field in the structure, or the content cannot be parse into an integer.

Parameters
sPointer to the XStructure.
nameField name
defaultValueValue to return if no corresponding integer field value.
Returns
The (first) field value as a long long, or the default value if there is no such field.
See also
xGetField()

References XField::value, and xGetField().

◆ smaxGetRawField()

char * smaxGetRawField ( const XStructure s,
const char *  name,
char *  defaultValue 
)

Returns the string value in a structure's field, or the specified default value if there is no such field in the structure.

Parameters
sPointer to the XStructure.
nameField name
defaultValueValue to return if no corresponding integer field value.
Returns
The field's string (raw) value, or the specified default if there is no such field.
See also
xGetField()

References XField::value, and xGetField().

◆ smaxPullDouble()

double smaxPullDouble ( const char *  table,
const char *  key 
)

Returns a single floating-point value for a given SMA-X variable, or a NAN if the value could not be retrieved.

Parameters
tableHash table name.
keyVariable name under which the data is stored.
Returns
The floating-point value stored in SMA-X, or NAN if the value could not be retrieved.
See also
smaxLazyPullDouble()
smaxPullDoubleDefault()

References NAN, and smaxPullDoubleDefault().

◆ smaxPullDoubleDefault()

double smaxPullDoubleDefault ( const char *  table,
const char *  key,
double  defaultValue 
)

Returns a single floating-point value for a given SMA-X variable, or a specified default value if the SMA-X value could not be retrieved.

Parameters
tableHash table name.
keyVariable name under which the data is stored.
defaultValueThe value to return in case of an error.
Returns
The floating-point value stored in SMA-X, or the specified default if the value could not be retrieved.
See also
smaxLazyPullDoubleDefault()
smaxPullDouble()

References smaxPull(), and X_DOUBLE.

◆ smaxPullDoubles()

double * smaxPullDoubles ( const char *  table,
const char *  key,
XMeta meta,
int *  n 
)

Returns a dynamically allocated array of doubles stored in an SMA-X variable.

Parameters
[in]tableThe hash table name.
[in]keyThe variable name under which the data is stored.
[out]meta(optional) Pointer to metadata to be filled or NULL if not required.
[out]nPointer to which the number of double is returned (if *n > 0) or else an error code.
Returns
Pointer to C double[] array containing *n elements, or NULL.
See also
smaxPullDouble()
smaxPullFloats()

References X_DOUBLE, and x_trace_null().

◆ smaxPullInt()

int smaxPullInt ( const char *  table,
const char *  key,
int  defaultValue 
)

Returns a single integer value for a given SMA-X variable, or a default value if the value could not be retrieved.

Parameters
tableThe hash table name.
keyThe variable name under which the data is stored.
defaultValueThe value to return in case of an error.
Returns
The integer value stored in SMA-X, or the specified default if the value could not be retrieved.
See also
smaxLazyPullInt()
smaxPullInts()
smaPullLong()

References smaxPull(), and X_INT.

◆ smaxPullInts()

int * smaxPullInts ( const char *  table,
const char *  key,
XMeta meta,
int *  n 
)

Returns a dynamically allocated array of integers stored in an SMA-X variable.

Parameters
[in]tableThe hash table name.
[in]keyThe variable name under which the data is stored.
[out]meta(optional) Pointer to metadata to be filled or NULL if not required.
[out]nPointer to which the number of integers is returned (if *n > 0) or else an error code.
Returns
Pointer to C int[] array containing *n elements, or NULL.
See also
smaxPullShorts()
smaxPullLongs()
smaxPullInt()

References X_INT, and x_trace_null().

◆ smaxPullLong()

long long smaxPullLong ( const char *  table,
const char *  key,
long long  defaultValue 
)

Returns a single integer value for a given SMA-X variable, or a default value if the value could not be retrieved.

Parameters
tableThe hash table name.
keyThe variable name under which the data is stored.
defaultValueThe value to return in case of an error.
Returns
The integer value stored in SMA-X, or the specified default if the value could not be retrieved.
See also
smaxLazyPullLong()
smaxPullLongs()
smaxPullInt()

References smaxPull(), and X_LONG.

◆ smaxPullLongs()

long long * smaxPullLongs ( const char *  table,
const char *  key,
XMeta meta,
int *  n 
)

Returns a dynamically allocated array of long long (int64) integers stored in an SMA-X variable.

Parameters
[in]tableThe hash table name.
[in]keyThe variable name under which the data is stored.
[out]meta(optional) Pointer to metadata to be filled or NULL if not required.
[out]nPointer to which the number of integers is returned (if *n > 0) or else an error code.
Returns
Pointer to C int[] array containing *n elements, or NULL.
See also
smaxPullInts()
smaxPullShorts()
smaxPullLong()

References X_INT, and x_trace_null().

◆ smaxPullRaw()

char * smaxPullRaw ( const char *  table,
const char *  key,
XMeta meta,
int *  status 
)

Returns a dynamically allocated buffer with the raw string value stored in SMA-X. This call can also be used to get single string values from SMA-X, since for single string the stored raw value is simply the string itself. However, to properly retrieve string arrays, you want to use smaxPullStrings() instead.

Parameters
[in]tableThe hash table name.
[in]keyThe variable name under which the data is stored.
[out]meta(optional) Pointer to metadata to be filled or NULL if not required.
[out]statusPointer int which an error status is returned.
Returns
Pointer to C array containing the elements of the specified type, or NULL.
See also
smaxPullStrings()

References smaxPull(), x_error(), X_RAW, and x_trace_null().

◆ smaxPullString()

char * smaxPullString ( const char *  table,
const char *  key 
)

Returns a single string value for a given SMA-X variable, or a NULL if the value could not be retrieved.

Parameters
tableHash table name.
keyVariable name under which the data is stored.
Returns
Pouinter to the string value stored in SMA-X, or NULL if the value could not be retrieved.
See also
smaxLazyPullString()
smaxPullStrings()

References smaxPull(), X_STRING, and x_trace_null().

◆ smaxPullStrings()

char ** smaxPullStrings ( const char *  table,
const char *  key,
XMeta meta,
int *  n 
)

Returns an array of pointers to individuals strings inside the retrieved contiguous data buffer. Thus, to discard the returned data after use, you must first discard the underlying buffer (as pointed by the first element) before discarding the array of pointers themselves. E.g.:

char **array = smaxPullStrings("mygroup", "myfield", &meta); ... if(array != NULL) { free(array[0]); // discards the underlying contiguous buffer free(array); // discards the array of pointers. }

Parameters
[in]tableThe hash table name.
[in]keyThe variable name under which the data is stored.
[out]meta(optional) Pointer to metadata to be filled or NULL if not required.
[out]nPointer to which the number of double is returned (if *n > 0) or else an error code.
Returns
Pointer to a an array of strings (char *) containing *n elements, or NULL.
See also
smaxPullString()
smaxPullRaw()

References smaxGetMetaCount(), smaxPullRaw(), XMeta::storeBytes, x_error(), X_META_INIT, and x_trace_null().

◆ smaxPullStruct()

XStructure * smaxPullStruct ( const char *  id,
XMeta meta,
int *  status 
)

Returns a dynamically allocated XStrucure for the specified hashtable in SMA-X.

Parameters
[in]idAggregated structure ID.
[out]meta(optional) Pointer to metadata to be filled or NULL if not required.
[out]statusPointer int which an error status is returned.
Returns
Pointer to an XStructure, or NULL.
See also
smaxLazyPullStruct()
xDestroyStruct()

References smaxPull(), x_error(), X_STRUCT, and x_trace_null().

◆ smaxShareBoolean()

int smaxShareBoolean ( const char *  table,
const char *  key,
boolean  value 
)

Shares a single boolean value to SMA-X. All non-zero values are mapped to "1".

Parameters
tableThe hash table name.
keyThe variable name under which the data is stored.
valueA boolean value.
Returns
X_SUCCESS (0), or else an appropriate error code (<0) from smaxShare().
See also
smaxShareBooleans()

References smaxShareBooleans(), and X_SUCCESS.

◆ smaxShareBooleans()

int smaxShareBooleans ( const char *  table,
const char *  key,
const boolean values,
int  n 
)

Shares an array of boolean values to SMA-X. All non-zero values are mapped to "1".

Parameters
tableHash table name.
keyVariable name under which the data is stored.
valuesPointer to boolean[] array.
nNumber of elements in array to share.
Returns
X_SUCCESS (0), or else an appropriate error code (<0) from smaxShare().
See also
smaxShareBoolean()

References smaxShare(), X_BOOLEAN, and X_SUCCESS.

◆ smaxShareBytes()

int smaxShareBytes ( const char *  table,
const char *  key,
const char *  values,
int  n 
)

Shares a binary sequence to SMA-X.

Parameters
tableThe hash table name.
keyThe variable name under which the data is stored.
valuespointer to the byte buffer.
nNumber of bytes in buffer to share.
Returns
X_SUCCESS (0), or else an appropriate error code (<0) from smaxShare().
See also
smaxShareShorts()
smaxShareInts()
smaxShareLongs()
smaxShareInt()

References smaxShare(), X_BYTE, and X_SUCCESS.

◆ smaxShareDouble()

int smaxShareDouble ( const char *  table,
const char *  key,
double  value 
)

Shares a single floating point value to SMA-X.

Parameters
tableThe hash table name.
keyThe variable name under which the data is stored.
valuefloating-point value.
Returns
X_SUCCESS (0), or else an appropriate error code (<0) from smaxShare().
See also
smaxShareDoubles()
smaxShareFloats()

References smaxShareDoubles(), and X_SUCCESS.

◆ smaxShareDoubles()

int smaxShareDoubles ( const char *  table,
const char *  key,
const double *  values,
int  n 
)

Shares an array of doubles to SMA-X.

Parameters
tableThe hash table name.
keyThe variable name under which the data is stored.
valuesPointer to double[] array.
nNumber of elements in array to share.
Returns
X_SUCCESS (0), or else an appropriate error code (<0) from smaxShare().
See also
smaxShareDouble()
smaxShareFloats()

References smaxShare(), X_DOUBLE, and X_SUCCESS.

◆ smaxShareFloats()

int smaxShareFloats ( const char *  table,
const char *  key,
const float *  values,
int  n 
)

Shares an array of floats to SMA-X.

Parameters
tableThe hash table name.
keyThe variable name under which the data is stored.
valuesPointer to float[] array.
nNumber of elements in array to share.
Returns
X_SUCCESS (0), or else an appropriate error code (<0) from smaxShare().
See also
smaxShareDouble()
smaxShareDoubles()

References smaxShare(), X_FLOAT, and X_SUCCESS.

◆ smaxShareHex()

int smaxShareHex ( const char *  table,
const char *  key,
long long  value 
)

Shares a single integer value to SMA-X in a hexadecimal representatin.

Parameters
tableThe hash table name.
keyThe variable name under which the data is stored.
valueInteger value.
Returns
X_SUCCESS (0), or else an appropriate error code (<0) from smaxShare().
See also
smaxShareInt()

References smaxShare(), X_LONG_HEX, and X_SUCCESS.

◆ smaxShareInt()

int smaxShareInt ( const char *  table,
const char *  key,
long long  value 
)

Shares a single integer value to SMA-X.

Parameters
tableHash table name.
keyVariable name under which the data is stored.
valueInteger value.
Returns
X_SUCCESS (0), or else an appropriate error code (<0) from smaxShare().
See also
smaxShareHex()
smaxShareInts()

References smaxShareLongs(), and X_SUCCESS.

◆ smaxShareInts()

int smaxShareInts ( const char *  table,
const char *  key,
const int *  values,
int  n 
)

Shares an array of long integers to SMA-X.

Parameters
tableThe hash table name.
keyThe variable name under which the data is stored.
valuesPointer to int[] array.
nNumber of elements in array to share.
Returns
X_SUCCESS (0), or else an appropriate error code (<0) from smaxShare().
See also
smaxShareLongs()
smaxShareShorts()
smaxShareBytes()
smaxShareInt()

References smaxShare(), X_INT, and X_SUCCESS.

◆ smaxShareLongs()

int smaxShareLongs ( const char *  table,
const char *  key,
const long long *  values,
int  n 
)

Shares an array of wide integers to SMA-X.

Parameters
tableThe hash table name.
keyThe variable name under which the data is stored.
valuesPointer to long long[] array.
nNumber of elements in array to share.
Returns
X_SUCCESS (0), or else an appropriate error code (<0) from smaxShare().
See also
smaxShareInts()
smaxShareShorts()
smaxShareBytes()
smaxShareInt()

References smaxShare(), X_LONG, and X_SUCCESS.

◆ smaxShareShorts()

int smaxShareShorts ( const char *  table,
const char *  key,
const short *  values,
int  n 
)

Shares an array of shorts to SMA-X.

Parameters
tableThe hash table name.
keyThe variable name under which the data is stored.
valuesPointer to short[] array.
nNumber of elements in array to share.
Returns
X_SUCCESS(0), or else an appropriate error code (<0) from smaxShare().
See also
smaxShareInt()
smaxShareBytes()
smaxShareInts()
smaxShareLongs()

References smaxShare(), X_SHORT, and X_SUCCESS.

◆ smaxShareString()

int smaxShareString ( const char *  table,
const char *  key,
const char *  sValue 
)

Shares a single string value to SMA-X.

Parameters
tableThe hash table name.
keyThe variable name under which the data is stored.
sValuePointer to string.
Returns
X_SUCCESS (0), or else an appropriate error code (<0) from smaxShare().
See also
smaxShareStrings()

References smaxShare(), X_RAW, and X_SUCCESS.

◆ smaxShareStrings()

int smaxShareStrings ( const char *  table,
const char *  key,
const char **  sValues,
int  n 
)

Shares an array of strings to SMA-X.

Parameters
tableThe hash table name.
keyThe variable name under which the data is stored.
sValuesPointer to array of string pointers.
nNumber of elements in array to share.
Returns
X_SUCCESS (0), or else an appropriate error code (<0) from smaxShare().
See also
smaxShareString()

References smaxShare(), x_error(), X_NULL, X_RAW, and X_SUCCESS.

◆ smaxWaitOnSubscribed()

int smaxWaitOnSubscribed ( const char *  table,
const char *  key,
int  timeout 
)

Waits for a specific pushed entry. There must be an active subscription that includes the specified group & variable, or else the call will block indefinitely.

Parameters
tableHash table name
keyVariable name to wait on.
timeout(s) Timeout value. 0 or negative values result in an indefinite wait.
Returns
X_SUCCESS (0) if the variable was updated on some host (or owner). X_NO_INIT if the SMA-X sharing was not initialized via smaxConnect(). X_GROUP_INVALID if the 'group' argument is NULL; X_NAME_INVALID if the 'key' argument is NULL. X_REL_PREMATURE if smaxReleaseWaits() was called.
See also
smaxSubscribe()
smaxWaitOnSubscribed()
smaxWaitOnSubscribedGroup()
smaxWaitOnSubscribedVar()
smaxWaitOnAnySubscribed()
smaxReleaseWaits()

References x_error(), X_GROUP_INVALID, X_NAME_INVALID, and X_SUCCESS.

◆ smaxWaitOnSubscribedGroup()

int smaxWaitOnSubscribedGroup ( const char *  matchTable,
char **  changedKey,
int  timeout 
)

Waits for changes on a specific group. The must be an active subscription including that group, or else the call will block indefinitely.

Parameters
[in]matchTableHash table name (e.g. owner ID) to wait on.
[out]changedKeyPointer to the string that holds the name of the variable which unblocked the wait or which is set to NULL. The lease of the buffer is for the call only. The caller should copy its content if persistent storage is required.
[in]timeout(s) Timeout value. 0 or negative values result in an indefinite wait.
Returns
X_SUCCESS (0) if a variable was updated on the host. X_NO_INIT if the SMA-X sharing was not initialized via smaxConnect(). X_GROUP_INVALID if the table name to match is invalid. X_REL_PREMATURE if smaxReleaseWaits() was called.
See also
smaxSubscribe()
smaxWaitOnSubscribedVar()
smaxWaitOnSubscribed()
smaxWaitOnAnySubscribed()
smaxReleaseWaits()

References x_error(), X_GROUP_INVALID, and X_SUCCESS.

◆ smaxWaitOnSubscribedVar()

int smaxWaitOnSubscribedVar ( const char *  matchKey,
char **  changedTable,
int  timeout 
)

Waits for a specific pushed variable from any group/table. There must be an active subscription that includes the specified variable in one or more groups/tables, or else the call will block indefinitely.

Parameters
[in]matchKeyVariable name to wait on.
[out]changedTablePointer to the string that holds the name of the table which unblocked the wait or which is set to NULL. The lease of the buffer is for the call only. The caller should copy its content if persistent storage is required.
[in]timeout(s) Timeout value. 0 or negative values result in an indefinite wait.
Returns
X_SUCCESS (0) if the variable was updated on some host (or owner). X_NO_INIT if the SMA-X sharing was not initialized via smaxConnect(). X_NAME_INVALID if the 'key' argument is NULL. X_REL_PREMATURE if smaxReleaseWaits() was called.
See also
smaxSubscribe()
smaxWaitOnSubscribedGroup()
smaxWaitOnSubscribed()
smaxWaitOnAnySubscribed()
smaxReleaseWaits()

References x_error(), X_NAME_INVALID, and X_SUCCESS.