--- /dev/null
+Author: Benjamin Sailer
+ TUM/E12
+ Benjamin.Sailer@ph.tum.de
+Version: 0.1
+Date: 2000-09-10
+
+libcaParam.a
+============
+
+Content
+-------
+
+1. Compiletime requirements
+2. Linktime requirements
+3. Runtime requirments
+4. Known bugs and further developement perspectives
+
+1. Compiletime requirements
+---------------------------
+
+ To compile the channel access param library, you need the enviroment variable
+EPICS_HOME set to the root of the EPICS tree. Make assumes that the used base
+directory is right below the EPICS_HOME and called 'base/'. Tested with
+R3.13.3, libcaParam.a can happen to work with earlier versions.
+
+2. Linktime requirements
+------------------------
+
+Ensure, that the EPICS libraries linked to the final objects are the same ones
+you use to compile the libcaParam.a.
+
+3. Runtime requirments
+----------------------
+
+ At runtime the library assumes to have a channel access server within the
+EPICS_CA_ADDR_LIST that serves the parameters requested by the hosting program.
+The requested channel names are
+HAD:PARA:(uppercase <name>):(uppercase <idx>)
+and the library only asks for DBR_STRING types (as the EPICS conversion does
+not treat hex-numbers like strtoul(3) does). So conversion to integers is done
+by the library itself.
+
+4. Known bugs and further developement perspectives
+---------------------------------------------------
+
+ Behaviour with timeouts is not understood quite well.
+
+Please send bug reports to
+
+Benjamin.Sailer@ph.tum.de
+
int retVal = 0;
int i;
char *endptr;
- char *value[PARAM_MAX_NVALS];
+ char *value[PARAM_MAX_ARRAY_LEN];
- for (i = 0 ; i < PARAM_MAX_NVALS ; i++) {
+ for (i = 0 ; i < PARAM_MAX_ARRAY_LEN ; i++) {
value[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char));
}
*rows = 0;
}
- for (i = 0 ; i < PARAM_MAX_NVALS ; i++) {
+ for (i = 0 ; i < PARAM_MAX_ARRAY_LEN ; i++) {
free(value[i]);
}
return retVal;
#ifndef PARAM_H
#define PARAM_H
-#define PARAM_MAX_NVALS 1024
+#define PARAM_MAX_ARRAY_LEN 128
#define PARAM_MAX_VALUE_LEN 128
#define PARAM_MAX_NAME_LEN 128
--- /dev/null
+Author: Benjamin Sailer
+ TUM/E12
+ Benjamin.Sailer@ph.tum.de
+Version: 0.1
+Date: 2000-09-10
+
+libfileParam.a
+==============
+
+Content
+-------
+
+1. Compiletime requirements
+2. Linktime requirments
+3. Runtime requirments
+4. Known bugs and further developement perspectives
+
+1. Compiletime requirements
+---------------------------
+
+ libfileParam.a only needs os APIs for file opening and closing. Therefore
+no special libraries are needed at compiletime.
+
+2. Linktime requirments
+-----------------------
+
+ See compiletime requirements.
+
+3. Runtime requirments
+----------------------
+
+ At runtime a file is opened containing data in a tcl-shaped way (arrays are
+sets of parameters with a succeeding array index number in the tcl idx). When
+the enviroment variable DAQSLOW_PARAM_FILE is set, the library looks up there
+if it can find the data. If DAQSLOW_PARAM_FILE is not set, the library assumes
+the param file to be 'param.tcl' in the working directory.
+
+4. Known bugs and further developement perspectives
+---------------------------------------------------
+
+ Note that libfileParam.a is only existing for historical reasons and for the
+poor people who don't have tcl available on their system. It is a little clone
+of the libtclParam.a without requirnig the libtcl.so and has two
+disadvantages:
+- The simple algorithm does not allow the string values (and notations of a int
+ value, too) to contain whitespaces.
+- The constructor of param allocates much memory to copy the entire file to
+ it. There is a magic maximum size for the number of single requested elements
+ set to PARAM_MAX_NVALS which is now set to 1024.
+libfileParam.a is not likely to be developed any further but anyhow:
+
+Please send bug reports to
+
+Benjamin.Sailer@ph.tum.de
+
int retVal = 0;
int i;
char *endptr;
- char *strval[PARAM_MAX_NVALS];
+ char *strval[PARAM_MAX_ARRAY_LEN];
for (i = 0 ; i < maxrows ; i++) {
strval[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char));
#ifndef PARAM_H
#define PARAM_H
-#define PARAM_MAX_NVALS 1024
+#define PARAM_MAX_ARRAY_LEN 128
#define PARAM_MAX_VALUE_LEN 128
#define PARAM_MAX_NAME_LEN 128
* Section containing struct Param (different in the different param.h's) *
**************************************************************************/
+#define PARAM_MAX_NVALS 1024
+
typedef struct ParamS {
char *strerror;
int nVals;
CFLAGS = -g -ansi -Wall -I$(ORACLE_HOME)/precomp/public/
-ORA_USER = daq/daqall@db-hades.gsi.de
+ORA_USER = hades/hades@db-hades.gsi.de
PROC = $(ORACLE_HOME)/bin/proc
PROCFLAGS = oraca=yes parse=partial sqlcheck=semantics \
--- /dev/null
+Author: Benjamin Sailer
+ TUM/E12
+ Benjamin.Sailer@ph.tum.de
+Version: 0.1
+Date: 2000-09-10
+
+liboraParam.a
+=============
+
+Content
+-------
+
+1. Compiletime requirements
+2. Linktime requirments
+3. Runtime requirments
+4. Known bugs and further developement perspectives
+
+1. Compiletime requirements
+---------------------------
+
+ At compiletime liboraParam.a needs the enviroment variable ORACLE_HOME
+pointing to the root of the oracle development tree (containing the precompiler
+proc, the include files oraca.h and sqlca.h). Additionally, you must have a
+network connection to the hades oracle database on the GSI linux cluster. User
+and password for a reading access are hardwired in the code (which is not very
+elegant but an intrinsic feature of proc).
+
+2. Linktime requirments
+-----------------------
+
+ The above mentioned ORACLE_HOME must also exist at linktime, in this case to
+provide the oracle sql libraries which are listed in the test directory
+Makefile.
+
+3. Runtime requirments
+----------------------
+
+ At runtime you also use hard wired access information and have to have a the
+connection to the database, to. Therein the used parameters are all stored in
+a table (view, to be more precise) that is called DAQ.PARAMS and has the
+attributes NAME, IDX, SEQ_NUM, VALUE (which correspond to name, idx and value
+respectively contain the sorting criterium for any array asked for). Of course,
+this view contains a lookup in various tables that hold only specific data sets
+and to supply these is a vast field not yet made applicable for normal users.
+
+4. Known bugs and further developement perspectives
+---------------------------------------------------
+
+ The only data yet contained in the database are not very structured. Thus,
+developing power has to be invested largely to work out the different database
+tables and their content rather than looking for bugs (which I have not
+disvovered up to now). Anyhow:
+
+Please send bug reports to
+
+Benjamin.Sailer@ph.tum.de
+
#ifndef PARAM_H
#define PARAM_H
-#define PARAM_MAX_NVALS 1024
+#define PARAM_MAX_ARRAY_LEN 128
#define PARAM_MAX_VALUE_LEN 128
#define PARAM_MAX_NAME_LEN 128
int conParam(Param *my)
{
my->strerror = NULL;
- my->user = "daq@db-hades.gsi.de";
- my->passwd = "daqall";
+ my->user = "hades@db-hades.gsi.de";
+ my->passwd = "hades";
return 0;
}
const char* pw;
char sqlname[PARAM_MAX_NAME_LEN];
char sqlidx[PARAM_MAX_NAME_LEN];
- char value[PARAM_MAX_NVALS][PARAM_MAX_VALUE_LEN];
+ char value[PARAM_MAX_ARRAY_LEN][PARAM_MAX_VALUE_LEN];
EXEC SQL END DECLARE SECTION;
for(i = 0 ; i <= strlen(name) ; i++) {
const char* pw;
char sqlname[PARAM_MAX_NAME_LEN];
char sqlidx[PARAM_MAX_NAME_LEN];
- char value[PARAM_MAX_NVALS][PARAM_MAX_VALUE_LEN];
+ char value[PARAM_MAX_ARRAY_LEN][PARAM_MAX_VALUE_LEN];
EXEC SQL END DECLARE SECTION;
for(i = 0 ; i <= strlen(name) ; i++) {
--- /dev/null
+Author: Benjamin Sailer
+ TUM/E12
+ Benjamin.Sailer@ph.tum.de
+Version: 0.1
+Date: 2000-09-10
+
+libpsqlParam.a
+==============
+
+Content
+-------
+
+1. Compiletime requirements
+2. Linktime requirments
+3. Runtime requirments
+4. Known bugs and further developement perspectives
+
+1. Compiletime requirements
+---------------------------
+
+ The PostgreSQL frontend header used here (which is delivered with the
+posrgresql-devel package on actual Linux distributions) is called libpq-fe.h
+and was found in /usr/include/pgsql on my system. As libpsqlParam.a was only
+developed as a side path and is not really useful for the broad hades collab,
+I didn't loos time investigating the situation on other os' or only other
+distributions.
+
+2. Linktime requirments
+-----------------------
+
+ According to the above said, there is also no information available where to
+find the libpq.[a|so] and the libcrypt.[a|so] on the diverse systems while at
+redhat 6.0 they can be found in the normal library search path (/usr/lib).
+
+3. Runtime requirments
+----------------------
+
+ libpsqlParam.a will try to open a connection to a postgres database located
+on casino.e12.physik.tu-muenchen.de and called 'hadaq'. Note that actual data
+are not likely to be available there, but the testing enviroment should be
+in the current setup.
+
+4. Known bugs and further developement perspectives
+---------------------------------------------------
+
+ As a testing object for independent database connections, libpsqlParam.a is
+not rcommended for use at normal runtime. Anyway, if developing database
+concepts on another machine with a tiny free database is wanted, libpsqlParam.a
+can be a good choice together with some changes to the source code. So if you
+are interested in libpsqlParam.a:
+
+Please send bug reports to
+
+Benjamin.Sailer@ph.tum.de
+
}
*rows = 0;
- conn = PQconnectdb("host=casino dbname=bsailer user=bsailer");
+ conn = PQconnectdb("host=casino.e12.physik.tu-muenchen.de dbname=hadaq user=bsailer");
sprintf(whereClause, "WHERE name = '%s' AND idx = '%s' ", lname, lidx);
sprintf(query, "SELECT * FROM card_params %s UNION SELECT * FROM cpus %s UNION SELECT * FROM crate_params %s UNION SELECT * FROM crate_setup %s ORDER BY seq_num;", whereClause, whereClause, whereClause, whereClause);
#ifndef PARAM_H
#define PARAM_H
-#define PARAM_MAX_NVALS 1024
+#define PARAM_MAX_ARRAY_LEN 128
#define PARAM_MAX_VALUE_LEN 128
#define PARAM_MAX_NAME_LEN 128
--- /dev/null
+Author: Benjamin Sailer
+ TUM/E12
+ Benjamin.Sailer@ph.tum.de
+Version: 0.1
+Date: 2000-09-10
+
+libtclParam.a
+=============
+
+Content
+-------
+
+1. Compiletime requirements
+2. Linktime requirments
+3. Runtime requirments
+4. Known bugs and further developement perspectives
+
+1. Compiletime requirements
+---------------------------
+
+ At compiletime the only requirement for libtclParam.a is tcl.h, which should
+be available on most UNIX systems in the default include path.
+
+2. Linktime requirments
+-----------------------
+
+ The library needs libtcl.a (or libtcl.so), which is normally located in the
+defaut library path ('/usr/lib'). Anyhow, on some systems (like GSI Linux
+cluster) there is no link from the actual version of the tcl library (somthing
+like libtcl8.0.so) set to libtcl.so which forces you to change the Makefile in
+that respect. Additionally sometimes there seems to be no static library but
+only a shared object - which must not, but can, cause trouble if required other
+libraries are not available (such as libm.a or libdl.a).
+
+3. Runtime requirments
+----------------------
+
+ libtclParam.a starts a tcl-interpreter the input file of which has - of
+course - to be a tcl file. The library looks up for the enviroment variable
+DAQSLOW_PARAM_FILE and tries to open the file pointed to by it. If the variable
+is not defined, libtclParam.a looks for param.tcl in the working directory. The
+simple syntax of the tcl-file is just
+set <name>(<idx>) <value>
+(where <idx> is either the supplied idx string or the latter combined with a
+decimal representing the sequence number within an array). <name> and <value>
+are their corresponting values of the param function call.
+
+4. Known bugs and further developement perspectives
+---------------------------------------------------
+
+ In the tcl file, arrays are only recognized up to the size where the first
+sequence number is missing (this is due to performance reasons). For example
+card0(threshold0) 7
+card0(threshold1) 4
+card0(threshold2) 6
+card0(threshold3) 7
+card0(threshold4) 9
+card0(threshold6) 8
+card0(threshold7) 6
+card0(threshold8) 7
+will only return the first 4 threshold values, if requested via
+Param_getIntArray(param, "card0", "threshold", 8, &rows, value);
+In this respect, libtclParam.a (and also libfileParam.a) have a different
+behaviour than the database oriented param sources (that return all values,
+while the index of the single value is lost). Both behaviors are not the best
+ways and will hopefully be canged to a third one, in which a placeholder value
+is sent for all missing values. As in all READMEs, my request to you is:
+
+Please send additional bug reports to
+
+Benjamin.Sailer@ph.tum.de
+
int retVal = 0;
int i;
char *endptr;
- char *strval[PARAM_MAX_NVALS];
+ char *strval[PARAM_MAX_ARRAY_LEN];
for (i = 0 ; i < maxrows ; i++) {
strval[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char));
#ifndef PARAM_H
#define PARAM_H
-#define PARAM_MAX_NVALS 1024
+#define PARAM_MAX_ARRAY_LEN 128
#define PARAM_MAX_VALUE_LEN 128
#define PARAM_MAX_NAME_LEN 128