EPICS Base
7.0.6.1
|
Routines to get and set EPICS environment parameters. More...
#include "libComAPI.h"
Go to the source code of this file.
Classes | |
struct | ENV_PARAM |
A structure to hold a single environment parameter. More... | |
Functions | |
LIBCOM_API char *epicsStdCall | envGetConfigParam (const ENV_PARAM *pParam, int bufDim, char *pBuf) |
Get value of a configuration parameter. More... | |
LIBCOM_API const char *epicsStdCall | envGetConfigParamPtr (const ENV_PARAM *pParam) |
Get a configuration parameter's value or default string. More... | |
LIBCOM_API long epicsStdCall | envPrtConfigParam (const ENV_PARAM *pParam) |
Print the value of a configuration parameter. More... | |
LIBCOM_API long epicsStdCall | envGetInetAddrConfigParam (const ENV_PARAM *pParam, struct in_addr *pAddr) |
Get value of an inet addr config parameter. More... | |
LIBCOM_API long epicsStdCall | envGetDoubleConfigParam (const ENV_PARAM *pParam, double *pDouble) |
Get value of a double configuration parameter. More... | |
LIBCOM_API long epicsStdCall | envGetLongConfigParam (const ENV_PARAM *pParam, long *pLong) |
Get value of a long configuration parameter. More... | |
LIBCOM_API unsigned short epicsStdCall | envGetInetPortConfigParam (const ENV_PARAM *pEnv, unsigned short defaultPort) |
Get value of a port number configuration parameter. More... | |
LIBCOM_API long epicsStdCall | envGetBoolConfigParam (const ENV_PARAM *pParam, int *pBool) |
Get value of a boolean configuration parameter. More... | |
LIBCOM_API long epicsStdCall | epicsPrtEnvParams (void) |
Prints all configuration parameters and their current value. More... | |
LIBCOM_API void epicsStdCall | epicsEnvSet (const char *name, const char *value) |
Set an environment variable's value. More... | |
LIBCOM_API void epicsStdCall | epicsEnvUnset (const char *name) |
Clear the value of an environment variable. More... | |
LIBCOM_API void epicsStdCall | epicsEnvShow (const char *name) |
Print value of an environment variable, or all variables. More... | |
Variables | |
LIBCOM_API const ENV_PARAM | EPICS_CA_ADDR_LIST |
LIBCOM_API const ENV_PARAM | EPICS_CA_CONN_TMO |
LIBCOM_API const ENV_PARAM | EPICS_CA_AUTO_ADDR_LIST |
LIBCOM_API const ENV_PARAM | EPICS_CA_REPEATER_PORT |
LIBCOM_API const ENV_PARAM | EPICS_CA_SERVER_PORT |
LIBCOM_API const ENV_PARAM | EPICS_CA_MAX_ARRAY_BYTES |
LIBCOM_API const ENV_PARAM | EPICS_CA_AUTO_ARRAY_BYTES |
LIBCOM_API const ENV_PARAM | EPICS_CA_MAX_SEARCH_PERIOD |
LIBCOM_API const ENV_PARAM | EPICS_CA_NAME_SERVERS |
LIBCOM_API const ENV_PARAM | EPICS_CA_MCAST_TTL |
LIBCOM_API const ENV_PARAM | EPICS_CAS_INTF_ADDR_LIST |
LIBCOM_API const ENV_PARAM | EPICS_CAS_IGNORE_ADDR_LIST |
LIBCOM_API const ENV_PARAM | EPICS_CAS_AUTO_BEACON_ADDR_LIST |
LIBCOM_API const ENV_PARAM | EPICS_CAS_BEACON_ADDR_LIST |
LIBCOM_API const ENV_PARAM | EPICS_CAS_SERVER_PORT |
LIBCOM_API const ENV_PARAM | EPICS_CA_BEACON_PERIOD |
deprecated | |
LIBCOM_API const ENV_PARAM | EPICS_CAS_BEACON_PERIOD |
LIBCOM_API const ENV_PARAM | EPICS_CAS_BEACON_PORT |
LIBCOM_API const ENV_PARAM | EPICS_BUILD_COMPILER_CLASS |
LIBCOM_API const ENV_PARAM | EPICS_BUILD_OS_CLASS |
LIBCOM_API const ENV_PARAM | EPICS_BUILD_TARGET_ARCH |
LIBCOM_API const ENV_PARAM | EPICS_TZ |
LIBCOM_API const ENV_PARAM | EPICS_TS_NTP_INET |
LIBCOM_API const ENV_PARAM | EPICS_IOC_IGNORE_SERVERS |
LIBCOM_API const ENV_PARAM | EPICS_IOC_LOG_PORT |
LIBCOM_API const ENV_PARAM | EPICS_IOC_LOG_INET |
LIBCOM_API const ENV_PARAM | EPICS_IOC_LOG_FILE_LIMIT |
LIBCOM_API const ENV_PARAM | EPICS_IOC_LOG_FILE_NAME |
LIBCOM_API const ENV_PARAM | EPICS_IOC_LOG_FILE_COMMAND |
LIBCOM_API const ENV_PARAM | IOCSH_PS1 |
LIBCOM_API const ENV_PARAM | IOCSH_HISTSIZE |
LIBCOM_API const ENV_PARAM | IOCSH_HISTEDIT_DISABLE |
LIBCOM_API const ENV_PARAM * | env_param_list [] |
This file defines environment parameters used by EPICS and the routines used to get and set those parameter values.
The ENV_PARAM's declared here are defined in the generated file envData.c by the bldEnvData.pl Perl script, which parses this file and the build system's CONFIG_ENV and CONFIG_SITE_ENV files. User programs can define their own environment parameters for their own use–the only caveat is that such parameters aren't automatically setup by EPICS.
Definition in file envDefs.h.
LIBCOM_API char* epicsStdCall envGetConfigParam | ( | const ENV_PARAM * | pParam, |
int | bufDim, | ||
char * | pBuf | ||
) |
Gets the value of a configuration parameter from the environment and copies it into the caller's buffer. If the parameter isn't set in the environment, the default value for the parameter is copied instead. If neither provides a non-empty string the buffer is set to '\0' and NULL is returned.
pParam | Pointer to config param structure. |
bufDim | Dimension of parameter buffer |
pBuf | Pointer to parameter buffer |
LIBCOM_API const char* epicsStdCall envGetConfigParamPtr | ( | const ENV_PARAM * | pParam | ) |
pParam | Pointer to config param structure. |
LIBCOM_API long epicsStdCall envPrtConfigParam | ( | const ENV_PARAM * | pParam | ) |
pParam | Pointer to config param structure. |
LIBCOM_API long epicsStdCall envGetInetAddrConfigParam | ( | const ENV_PARAM * | pParam, |
struct in_addr * | pAddr | ||
) |
Gets the value of a configuration parameter and copies it into the caller's (struct in_addr) buffer. If the configuration parameter isn't found in the environment, the default value for that parameter will be used. The resulting string is converted from a dotted-quad format or looked up using the DNS and copied into the inet structure.
If no parameter is found and there is no default, then -1 is returned and the callers buffer is unmodified.
pParam | Pointer to config param structure. |
pAddr | Pointer to struct to receive inet addr. |
LIBCOM_API long epicsStdCall envGetDoubleConfigParam | ( | const ENV_PARAM * | pParam, |
double * | pDouble | ||
) |
Gets the value of a configuration parameter, converts it into a double
value and copies that into the caller's buffer. If the configuration parameter isn't found in the environment, the default value for the parameter is used instead.
If no parameter is found and there is no default, then -1 is returned and the callers buffer is unmodified.
pParam | Pointer to config param structure. |
pDouble | Pointer to place to store value. |
LIBCOM_API long epicsStdCall envGetLongConfigParam | ( | const ENV_PARAM * | pParam, |
long * | pLong | ||
) |
Gets the value of a configuration parameter, converts it into a long
value and copies that into the caller's buffer. If the configuration parameter isn't found in the environment, the default value for the parameter is used instead.
If no parameter is found and there is no default, then -1 is returned and the callers buffer is unmodified.
pParam | Pointer to config param structure. |
pLong | Pointer to place to store value. |
LIBCOM_API unsigned short epicsStdCall envGetInetPortConfigParam | ( | const ENV_PARAM * | pEnv, |
unsigned short | defaultPort | ||
) |
Returns the value of a configuration parameter that represents an inet port number. If no environment variable is found the default parameter value is used, and if that is also unset the defaultPort
argument returned instead. The integer value must fall between the values IPPORT_USERRESERVED and USHRT_MAX or the defaultPort
argument will be substituted instead.
pEnv | Pointer to config param structure. |
defaultPort | Port number to be used if environment settings invalid. |
LIBCOM_API long epicsStdCall envGetBoolConfigParam | ( | const ENV_PARAM * | pParam, |
int * | pBool | ||
) |
Gets the value of a configuration parameter, and puts the value 0 or 1 into the caller's buffer depending on the value. If the configuration parameter isn't found in the environment, the default value for the parameter is used instead.
A value is treated as True (1) if it compares equal to the string "yes" with a case-independent string comparison. All other strings are treated as False (0).
If no parameter is found and there is no default, then -1 is returned and the callers buffer is unmodified.
pParam | Pointer to config param structure. |
pBool | Pointer to place to store value. |
LIBCOM_API long epicsStdCall epicsPrtEnvParams | ( | void | ) |
LIBCOM_API void epicsStdCall epicsEnvSet | ( | const char * | name, |
const char * | value | ||
) |
The setenv() routine is not available on all operating systems. This routine provides a portable alternative for all EPICS targets.
name | Environment variable name. |
value | New value for environment variable. |
LIBCOM_API void epicsStdCall epicsEnvUnset | ( | const char * | name | ) |
name | Environment variable name. |
LIBCOM_API void epicsStdCall epicsEnvShow | ( | const char * | name | ) |
name | Environment variable name, or NULL to show all. |