OPERA  1.0
Open source echelle spectrograph reduction pipeline
operaParameterAccess.c File Reference

access the parameter file More...

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <sys/types.h>
#include <regex.h>
#include <limits.h>
#include <errno.h>
#include "operaError.h"
#include "libraries/operaParameterAccess.h"
Include dependency graph for operaParameterAccess.c:

Namespaces

namespace  operaParameterAccess

Defines

#define OPERAERRRORCODESONLY
 access the parameter file.
#define PATH_MAX   1024

Functions

static int startsWith (const char *aString, const char *substring)
operaErrorCode operaParameterAccessSetParamaterFilepath (const char *filepath)
 This function sets the static filepath for a module calling this library.
operaErrorCode operaParameterAccessGet (const char *name, char **value)
 This function gets a value [list] for a given name.
operaErrorCode operaParameterAccessSet (const char *name, const char *value)
 This function sets a value for a given name.
operaErrorCode operaParameterAccessAdd (const char *name, const char *value)
 This function adds a name value listentry .
operaErrorCode operaParameterAccessDelete (const char *name, const char *value)
 This function deletes a value from a given name.
operaErrorCode operaParameterAccessRemove (const char *name)
 This function removes a name value entry.

Variables

static char parameterfilename [PATH_MAX]
static FILE * stream = NULL
static const char * parameterfilebasename = "/harness/Makefile.parameters"

Detailed Description

access the parameter file


Define Documentation

#define PATH_MAX   1024

Function Documentation

operaErrorCode operaParameterAccessAdd ( const char *  name,
const char *  value 
)

This function adds a name value listentry .

operaParameterAccessAdd(const char *name, const char *value)

Parameters:
nameis a char pointer to the name
valueis a char pointer to the value [list]
Returns:
operaErrorCode

Here is the call graph for this function:

operaErrorCode operaParameterAccessDelete ( const char *  name,
const char *  value 
)

This function deletes a value from a given name.

operaParameterAccessDelete(const char *name, const char *value)

Parameters:
nameis a char pointer to the name
valueis a char pointer to the value
Returns:
operaErrorCode

Here is the call graph for this function:

operaErrorCode operaParameterAccessGet ( const char *  name,
char **  value 
)

This function gets a value [list] for a given name.

operaErrorCode operaParameterAccessGet(const char *name, char *&value)

Note:
Note that this function allocates storage, which must be freed by the caller.
Parameters:
nameis a char pointer to the name
valueis a char pointer address to the value [list]
Returns:
operaErrorCode or errno
value = value of name or NULL if not known

Here is the call graph for this function:

operaErrorCode operaParameterAccessRemove ( const char *  name)

This function removes a name value entry.

operaParameterAccessRemove(const char *name)

Parameters:
nameis a char pointer to the name
Returns:
operaErrorCode

Here is the call graph for this function:

operaErrorCode operaParameterAccessSet ( const char *  name,
const char *  value 
)

This function sets a value for a given name.

operaParameterAccessSet(const char *name, const char *value)

Parameters:
nameis a char pointer to the name
valueis a char pointer address to the value
Returns:
operaErrorCode

Here is the call graph for this function:

operaErrorCode operaParameterAccessSetParamaterFilepath ( const char *  filepath)

This function sets the static filepath for a module calling this library.

operaErrorCode operaParameterAccessSetParamaterFilepath(const char *filepath)

Note:
Modules should really ony use the default except under extenuatin circumstances.
Parameters:
filepathis a char pointer to the filepath or NULL to set to default
Returns:
operaErrorCode
static int startsWith ( const char *  aString,
const char *  substring 
) [static]

Variable Documentation

const char* parameterfilebasename = "/harness/Makefile.parameters" [static]
char parameterfilename[PATH_MAX] [static]
FILE* stream = NULL [static]