- Adapted indenation to new agreed upon system

- Added support for second generation scriptcontext based counter
This commit is contained in:
koennecke
2009-02-13 09:00:03 +00:00
parent a3dcad2bfa
commit 91d4af0541
405 changed files with 88101 additions and 88173 deletions

View File

@@ -16,22 +16,22 @@
/*======================== callback error codes ===============================*/
#define SICSCBRO -607
#define SICSCBPERM -608
#define SICSCBRANGE -609
#define SICSCBRANGE -609
#define SICSCBBADFIXED -610
#define SICSNOPAR -611
/*======================== SICS Messages ======================================*/
typedef struct {
char *type;
int ID;
}hdbIDMessage, *pHdbIDMessage;
char *type;
int ID;
} hdbIDMessage, *pHdbIDMessage;
/*------------------------------------------------------------------------------*/
pHdbIDMessage GetKillIDMessage(pHdbMessage message);
pHdbIDMessage GetKillInternalIDMessage(pHdbMessage message);
/*-----------------------------------------------------------------------------*/
typedef struct {
char *type;
void *pPtr;
}hdbPtrMessage, *pHdbPtrMessage;
char *type;
void *pPtr;
} hdbPtrMessage, *pHdbPtrMessage;
/*-----------------------------------------------------------------------------*/
pHdbPtrMessage GetKillPtrMessage(pHdbMessage message);
pHdbMessage GetHdbStartMessage(pHdbMessage message);
@@ -39,10 +39,10 @@ pHdbMessage GetHdbStopMessage(pHdbMessage message);
void SendHdbStatusMessage(pHdb node, char *status);
/*======================== data structure for automatic parameter update =======*/
typedef struct {
SConnection *pCon;
int updateList;
int iEnd;
}hdbUpdateTask, *pHdbUpdateTask;
SConnection *pCon;
int updateList;
int iEnd;
} hdbUpdateTask, *pHdbUpdateTask;
/*======================== common callbacks =====================================*/
/**
* make a ReadOnly callback
@@ -93,7 +93,7 @@ pHdbCallback MakeSICSReadDriveCallback(void *sicsObject);
* @return a suitably initialized callback structure for
* automatic notification.
*/
pHdbCallback MakeNotifyCallback(SConnection *pCon, int id);
pHdbCallback MakeNotifyCallback(SConnection * pCon, int id);
/**
* make a callback for checking if a parameter is within a given
* range of integers
@@ -142,13 +142,13 @@ pHdbCallback MakeMemSetCallback(float *address);
* @param pCon The connection to notfy on tree chnages
* @param id The ID of this callback
* @return a suitable callback for notififications about tree changes.
*/
pHdbCallback MakeTreeChangeCallback(SConnection *pCon, int id);
*/
pHdbCallback MakeTreeChangeCallback(SConnection * pCon, int id);
/**
* make a clalback to invoke a function node
*/
pHdbCallback MakeSICSFuncCallback(void *obj);
pHdbCallback MakeSICSFuncCallback(void *obj);
/*======================== parameter creation ===================================*/
/**
* make a simple SICS hdb parameter. Setting it will call update immediately. Use
@@ -169,7 +169,7 @@ pHdb MakeSICSHdbPar(char *name, int priv, hdbValue v);
* @param datatype The datatype of this variable
* @return A new suitably configured Hdb parameter or NULL when out of memory.
*/
pHdb MakeSICSHdbDriv(char *name, int priv,void *sicsObject, int datatype);
pHdb MakeSICSHdbDriv(char *name, int priv, void *sicsObject, int datatype);
/**
* make SICS hdb variable which is connected to a memory location, perhaps in
* an objects data structure.
@@ -183,7 +183,7 @@ pHdb MakeSICSMemPar(char *name, int priv, float *address);
* @param name The name of the parameter
* @param v The initial value and datatype of this parameter
* @return A new suitably configured Hdb parameter or NULL when out of memory.
*/
*/
pHdb MakeSICSROPar(char *name, hdbValue v);
/**
* make a SICS scriptable parameter. I.e. when this parameter is set or read,
@@ -194,7 +194,8 @@ pHdb MakeSICSROPar(char *name, hdbValue v);
* @param v The initial value and datatype of this parameter
* @return A new suitably configured Hdb parameter or NULL when out of memory.
*/
pHdb MakeSICSScriptPar(char *name, char *setScript, char *readScript, hdbValue v);
pHdb MakeSICSScriptPar(char *name, char *setScript, char *readScript,
hdbValue v);
/**
* remove a SICS paramameter node and its children. In contrast to the
@@ -238,7 +239,7 @@ pHdb AddSICSHdbROPar(pHdb parent, char *name, hdbValue v);
* @return the created node on success, NULL else
*/
pHdb AddSICSHdbMemPar(pHdb parent, char *name, int priv,
void *data, int datalength, int type, int length);
void *data, int datalength, int type, int length);
/*============== access support functions =================================*/
/** Find the parent of a node to be created
* @param rootpath the root path (where to start). May be NULL for absolute paths
@@ -256,7 +257,8 @@ pHdb AddSICSHdbMemPar(pHdb parent, char *name, int priv,
* Nodes anchored in the sics object list are also found when
* the path starts with "/sics/"
*/
pHdb FindHdbParent(char *rootpath, char *relpath, char **namePtr, SConnection *pCon);
pHdb FindHdbParent(char *rootpath, char *relpath, char **namePtr,
SConnection * pCon);
/** FindHdbNode finds a node
* @param rootpath the root path (where to start). May be NULL for absolute paths.
* @param relpath an absolute or relative path
@@ -269,7 +271,7 @@ pHdb FindHdbParent(char *rootpath, char *relpath, char **namePtr, SConnection *p
* Nodes anchored in the sics object list are also found when
* the path starts with "/sics/"
*/
pHdb FindHdbNode(char *rootpath, char *relpath, SConnection *pCon);
pHdb FindHdbNode(char *rootpath, char *relpath, SConnection * pCon);
/** Get the absolute path of a node anchored in the
* Hipadaba root or in a sics object
* @param nodeArg the input node
@@ -289,8 +291,8 @@ void RemoveSICSInternalCallback(void *internalID);
* @param path The path to the parameter.
* @param v the value
* @return 1 on success, a negative error code else.
*/
int SICSHdbGetPar(void *obj, SConnection *pCon, char *path, hdbValue *v);
*/
int SICSHdbGetPar(void *obj, SConnection * pCon, char *path, hdbValue * v);
/**
* SICSHdbUpdatePar updates the value of a parameter.
* @param obj The object for which to get a parameter.
@@ -298,8 +300,9 @@ int SICSHdbGetPar(void *obj, SConnection *pCon, char *path, hdbValue *v);
* @param path The path to the parameter.
* @param v the value
* @return 1 on success, a negative error code else.
*/
int SICSHdbUpdatePar(void *obj, SConnection *pCon, char *path, hdbValue v);
*/
int SICSHdbUpdatePar(void *obj, SConnection * pCon, char *path,
hdbValue v);
/**
* SICSHdbSetPar sets the value of a parameter.
* @param obj The object for which to set a parameter.
@@ -307,14 +310,14 @@ int SICSHdbUpdatePar(void *obj, SConnection *pCon, char *path, hdbValue v);
* @param path The path to the parameter.
* @param v the value
* @return positive on success, a negative error code else.
*/
int SICSHdbSetPar(void *obj, SConnection *pCon, char *path, hdbValue v);
*/
int SICSHdbSetPar(void *obj, SConnection * pCon, char *path, hdbValue v);
/**
* query function if a parameter is read only.
* @param node The ndoe to query
* @return 1 when RO, 0 else
*/
int isSICSHdbRO(pHdb node);
int isSICSHdbRO(pHdb node);
/*============= common SICS Interactions ===================================*/
/**
* Install a SICS automatic notification callback on the node. This is
@@ -328,13 +331,13 @@ int isSICSHdbRO(pHdb node);
* installed to all nodes recursively.
* @return 1 on success, 0 when out of memory.
*/
int InstallSICSNotify(pHdb node, SConnection *pCon, int id, int recurse);
int InstallSICSNotify(pHdb node, SConnection * pCon, int id, int recurse);
/**
* remove all Callbacks associated with a given conenction
* @param root Where to start removing callbacks
* @param pCon The connection for which to remove callbacks
*/
void RemoveConnectionCallbacks(pHdb root, SConnection *pCon);
*/
void RemoveConnectionCallbacks(pHdb root, SConnection * pCon);
/**
* handles the common task of checking for, and processing a SICS parameter.
* @param root The node at which to search for parameters
@@ -345,17 +348,17 @@ void RemoveConnectionCallbacks(pHdb root, SConnection *pCon);
* @param argv The arguments to process. argv[0] should be the parameter
* name.
* @return -1 when argv[0] is no parameter, 0 on failure, 1 on success.
*/
int ProcessSICSHdbPar(pHdb root, SConnection *pCon, char *printPrefix,
int argc, char *argv[]);
*/
int ProcessSICSHdbPar(pHdb root, SConnection * pCon, char *printPrefix,
int argc, char *argv[]);
/**
* 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 to
* @param prefix The prefix to use for printing
*/
void PrintSICSParList(pHdb node, SConnection *pCon, char *prefix);
*/
void PrintSICSParList(pHdb node, SConnection * pCon, char *prefix);
/**
* save the content of the Hipadaba starting at node into a file. This can
* be used to save the configuration of an instrument. This routine is
@@ -363,8 +366,8 @@ void PrintSICSParList(pHdb node, SConnection *pCon, char *prefix);
* @param fd The file to write to
* @param node The node to print from
* @param prefix A prefix to use for printing.
*/
void SaveSICSHipadaba(FILE *fd, pHdb node, char *prefix);
*/
void SaveSICSHipadaba(FILE * fd, pHdb node, char *prefix);
/**
* A SICS task which scans a Hipadaba and reads and updates all parameters,
* one per invocation. TODO: how to distinguish between automatic pars which
@@ -382,7 +385,7 @@ void SICSHipadabaSignal(void *pData, int iSignal, void *pSigData);
* @param node The Hdb node (for format property)
* @return a dynamic string holding the formatted data. NULL when
* out of memory
*/
*/
pDynString formatValue(hdbValue v, pHdb node);
/**
* read values for a Hdb value from a string.
@@ -394,7 +397,7 @@ pDynString formatValue(hdbValue v, pHdb node);
* @param errlen The length of the error string
* @return 0 on failure, 1 on success
*/
int readHdbValue(hdbValue *v, char *data, char *error, int errlen);
int readHdbValue(hdbValue * v, char *data, char *error, int errlen);
/**
* convert from test to a Hipadaba type
* @param text The type text
@@ -419,16 +422,16 @@ hdbValue MakeSICSFunc(SICSOBJFunc func);
* @param argv[] The text arguments
* @return 0 on filaure, 1 on success
*/
int InstallSICSHipadaba(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]);
int InstallSICSHipadaba(SConnection * pCon, SicsInterp * pSics,
void *pData, int argc, char *argv[]);
/**
* get the root of the SICS Hipadaba tree
* @return The root node of the hipdaba
*/
pHdb GetHipadabaRoot();
*/
pHdb GetHipadabaRoot();
/**
* kill the SICS hierarchical database
* Only to be called when shutting down the SICServer
*/
void killSICSHipadaba(void);
#endif /*SICSHIPADABA_H_*/
void killSICSHipadaba(void);
#endif /*SICSHIPADABA_H_ */