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

access the configuration 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/operaConfigurationAccess.h"
Include dependency graph for operaConfigurationAccess.c:

Namespaces

namespace  operaConfigurationAccess

Defines

#define OPERAERRRORCODESONLY
#define PATH_MAX   1024

Functions

static int startsWith (const char *aString, const char *substring)
 returns > 0 if astring startswith substring.
operaErrorCode operaConfigurationAccessSetConfigurationFilepath (const char *filepath)
 This function sets the static filepath for a module calling this library.
operaErrorCode operaConfigurationAccessGet (const char *name, char **value)
 This function gets a value [list] for a given name.
operaErrorCode operaConfigurationAccessSet (const char *name, const char *value)
 This function sets a value for a given name.
operaErrorCode operaConfigurationAccessAdd (const char *name, const char *value)
 This function adds a name value listentry .
operaErrorCode operaConfigurationAccessDelete (const char *name, const char *value)
 This function deletes a value from a given name.
operaErrorCode operaConfigurationAccessRemove (const char *name)
 This function removes a name value entry.

Variables

static char configurationfilename [PATH_MAX]
static FILE * stream = NULL
const char * configurationfilebasename = "/harness/Makefile.configuration"

Detailed Description

access the configuration file.


Define Documentation

#define OPERAERRRORCODESONLY
#define PATH_MAX   1024

Function Documentation

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

This function adds a name value listentry .

operaConfigurationAccessAdd(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 operaConfigurationAccessDelete ( const char *  name,
const char *  value 
)

This function deletes a value from a given name.

operaConfigurationAccessDelete(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 operaConfigurationAccessGet ( const char *  name,
char **  value 
)

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

operaErrorCode operaConfigurationAccessGet(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:
value = value of name or NULL if not known

Here is the call graph for this function:

operaErrorCode operaConfigurationAccessRemove ( const char *  name)

This function removes a name value entry.

operaConfigurationAccessRemove(const char *name)

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

Here is the call graph for this function:

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

This function sets a value for a given name.

operaConfigurationAccessSet(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 operaConfigurationAccessSetConfigurationFilepath ( const char *  filepath)

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

operaErrorCode operaConfigurationAccessSetParamaterFilepath(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]

returns > 0 if astring startswith substring.

startsWith

Author:
Doug Teeple
  • aString - the string to search
  • substring - the snippet
Returns:
EXIT_STATUS

Variable Documentation

const char* configurationfilebasename = "/harness/Makefile.configuration"
char configurationfilename[PATH_MAX] [static]
FILE* stream = NULL [static]