ARA ROOT Test BEd Software

AraWebPlotter/configLib/configLib.h

Go to the documentation of this file.
00001 
00009 /*
00010  *
00011  * Current CVS Tag:
00012  * $Header: /work1/anitaCVS/flightSoft/common/configLib/configLib.h,v 1.3 2005/06/15 16:22:00 rjn Exp $
00013  */
00014  
00015 /* 
00016  * Modification History : DO NOT EDIT - MAINTAINED BY CVS 
00017  * $Log: configLib.h,v $
00018  * Revision 1.3  2005/06/15 16:22:00  rjn
00019  * Fixed a lot of silly warnings
00020  *
00021  * Revision 1.2  2004/09/07 13:52:21  rjn
00022  * Added dignified multiple port handling capabilities to socketLib. Not fully functional... but getting there.
00023  *
00024  * Revision 1.1  2004/08/31 15:48:09  rjn
00025  * Um... lots of additions. The biggest ones are switching from shared to static libraries, and the additon of configLib and kvpLib to read formatted config files. These two libraries were created by Gordon Crone (gjc@hep.ucl.ac.uk) and are in spirit released under the GPL license.
00026  * Also the first of the actually programs (Eventd) has been started. At the moment it just opens a socket to fakeAcqd. Other sockets and better handling of multiple sockets in socketLib are the next things on my to do list.
00027  *
00028  * Revision 1.2  2001/07/27 12:56:36  gjc
00029  * Added CONFIG_E_UNNAMED error code and configValidate prototype.
00030  *
00031  * Revision 1.1  2001/07/24 13:36:43  gjc
00032  * First check in of new package
00033  *
00034  *
00035  */ 
00036 
00037 #ifndef _config_H
00038 #define _config_H
00039 #ifdef __cplusplus 
00040 extern "C" { 
00041 #endif /* __cplusplus */
00042  
00043 /* includes */
00044 #include "time.h"
00045 
00046 /* defines */
00047 #define CONFIG_VAR "DAQ_CONFIG_DIR"
00048 #define BLOCKNAME_MAX 64
00049 #define MAX_BLOCKS 32
00050 #define RECLEN_MAX 4096
00051 
00052 /* typedefs */
00053    typedef enum {
00054       CONFIG_E_OK = 0,
00055       CONFIG_E_NOFILE = 0x100,
00056       CONFIG_E_NESTING,
00057       CONFIG_E_EOF,
00058       CONFIG_E_SYSTEM,
00059       CONFIG_E_KVP,
00060       CONFIG_E_SECTION,
00061       CONFIG_E_UNNAMED
00062    } ConfigErrorCode ;
00063 /* global variable declarations*/   
00064 
00065 /* function prototype declarations */
00066    char* configFileSpec (char* fileName) ;
00067    ConfigErrorCode configLoad (const char* fleName, const char* blockList) ;
00068    ConfigErrorCode configLoadFullPath (char* fleName, char* blockList) ;
00069    ConfigErrorCode configStore (char* fileName, char* blockName) ;
00070    const char* configErrorString (ConfigErrorCode code) ;
00071    ConfigErrorCode configValidate (char* fileName) ;
00072 
00073 /* RJN additions */
00074     ConfigErrorCode configAppend (char* fileName, char* blockName) ;
00075     ConfigErrorCode readBlocks(char *fileName,char blockList[MAX_BLOCKS][BLOCKNAME_MAX],int *numBlocks);
00076     
00077     ConfigErrorCode configModifyInt(char *fileName,char *blockName,char *key,int value, time_t *rawTimePtr);
00078     ConfigErrorCode configModifyIntArray(char *fileName,char *blockName,char *key,int *values, int length, time_t *rawTimePtr);
00079     ConfigErrorCode configModifyUnsignedIntArray(char *fileName,char *blockName,char *key,unsigned int *values, int length, time_t *rawTimePtr);
00080     ConfigErrorCode configModifyFloatArray(char *fileName,char *blockName,char *key,float *values, int length, time_t *rawTimePtr);
00081     ConfigErrorCode configModifyUnsignedInt(char *fileName,char *blockName,char *key,unsigned long value, time_t *rawTimePtr);
00082     ConfigErrorCode configModifyFloat(char *fileName,char *blockName,char *key,float value, time_t *rawTimePtr);
00083     ConfigErrorCode configModifyString(char *fileName,char *blockName,char *key,char *value, time_t *rawTimePtr);
00084 
00085     ConfigErrorCode configReplace(char *oldFileName, char *newFileName, time_t *rawTimePtr);
00086     ConfigErrorCode configSwitch(char *configFile, char whichConfig, time_t *rawTimePtr);
00087     ConfigErrorCode configSwitchToLast(char *configFile, time_t *rawTimePtr);
00088 #ifdef __cplusplus 
00089 } 
00090 #endif /* __cplusplus */ 
00091 
00092 #endif /* _config_H */

Generated on Wed Aug 8 16:20:07 2012 for ARA ROOT Test Bed Software by doxygen 1.4.7