- add MskeSICSFunc

- changed return value of AddSICSHdbPar et al.
This commit is contained in:
zolliker
2008-05-15 07:43:05 +00:00
parent 2b558550fb
commit b03ddddd8f
7 changed files with 68 additions and 92 deletions

View File

@@ -12,6 +12,7 @@
#include <hipadaba.h>
#include <sics.h>
#include <dynstring.h>
#include <sicsobj.h>
/*======================== callback error codes ===============================*/
#define SICSCBRO -607
#define SICSCBPERM -608
@@ -203,37 +204,37 @@ void RemoveSICSPar(pHdb node, void *callData);
/*=============== Add par functions =======================================*/
/**
* add a new simple hdb parameter as child to node
* @param node The node to add the new node too.
* @param parent The parent node to add the new node to.
* @param name The name of the new node
* @param priv The privilege required to change that parameter
* @param v The initial value and datatype of this parameter
* @return 1 on success, 0 else
* @return the created node on success, NULL else
*/
int AddSICSHdbPar(pHdb node, char *name, int priv, hdbValue v);
pHdb AddSICSHdbPar(pHdb parent, char *name, int priv, hdbValue v);
/**
* add a new read only hdb parameter as child to node
* @param node The node to add the new node too.
* @param parent The parent node to add the new node to.
* @param name The name of the new node
* @param v The initial value and datatype of this parameter
* @return 1 on success, 0 else
* @return the created node on success, NULL else
*/
int AddSICSHdbROPar(pHdb node, char *name, hdbValue v);
pHdb AddSICSHdbROPar(pHdb parent, char *name, hdbValue v);
/**
* Add a new hdb parameter as child to node. Updates are synced
* to the memory location data. This works for simple variables, fixed size
* arrays and fixed sized strings. This does not work for dynamically sized
* arrays or strings.
* @param node The node to add the new node too.
* @param parent The parent node to add the new node to.
* @param name The name of the new node
* @param priv The privilege required to change that parameter
* @param data The pointer to map this parameter too. This must be in
* @param data The pointer to map this parameter to. This must be in
* dynamically allocated memory.
* @param datalength The length of the data area pointed to by data.
* @param type The data type of the parameter
* @param length The length of the type. Used for array types.
* @return 1 on success, 0 else
* @return the created node on success, NULL else
*/
int AddSICSHdbMemPar(pHdb node, char *name, int priv,
pHdb AddSICSHdbMemPar(pHdb parent, char *name, int priv,
void *data, int datalength, int type, int length);
/*============== access support functions =================================*/
/** Find the parent of a node to be created
@@ -348,7 +349,7 @@ int ProcessSICSHdbPar(pHdb root, SConnection *pCon, char *printPrefix,
* print a listing of the parameters of node to pCon, using the
* specified prefix.
* @param node The node to print
* @param pCon The connection to print too
* @param pCon The connection to print to
* @param prefix The prefix to use for printing
*/
void PrintSICSParList(pHdb node, SConnection *pCon, char *prefix);
@@ -386,7 +387,7 @@ pDynString formatValue(hdbValue v, pHdb node);
* already have been initialised before this call in order to allow for
* checks. Arrays should also have been allocated in the right size.
* @param data The string to parse and convert.
* @param error A string to copy failure reasons too
* @param error A string to copy failure reasons to
* @param errlen The length of the error string
* @return 0 on failure, 1 on success
*/
@@ -397,6 +398,12 @@ int readHdbValue(hdbValue *v, char *data, char *error, int errlen);
* @return The converted Hipadaba type
*/
int convertHdbType(char *text);
/**
* wrap a SICSOBJFunc function as an hdbValue
* @param func the function
* @return: A properly initialized hdbValue structure
*/
hdbValue MakeSICSFunc(SICSOBJFunc func);
/*================= SICS Interpreter Interface ===========================*/
/**