![]() |
This is Unofficial EPICS BASE Doxygen Site
|
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include "epicsStdlib.h"
#include "epicsStdio.h"
#include "epicsString.h"
#include "errMdef.h"
#include "errlog.h"
#include "envDefs.h"
#include "epicsAssert.h"
#include "osiSock.h"
Go to the source code of this file.
Functions | |
const char *epicsStdCall | envGetConfigParamPtr (const ENV_PARAM *pParam) |
Get a configuration parameter's value or default string. More... | |
char *epicsStdCall | envGetConfigParam (const ENV_PARAM *pParam, int bufDim, char *pBuf) |
Get value of a configuration parameter. More... | |
long epicsStdCall | envGetDoubleConfigParam (const ENV_PARAM *pParam, double *pDouble) |
Get value of a double configuration parameter. More... | |
long epicsStdCall | envGetInetAddrConfigParam (const ENV_PARAM *pParam, struct in_addr *pAddr) |
Get value of an inet addr config parameter. More... | |
long epicsStdCall | envGetLongConfigParam (const ENV_PARAM *pParam, long *pLong) |
Get value of a long configuration parameter. More... | |
long epicsStdCall | envGetBoolConfigParam (const ENV_PARAM *pParam, int *pBool) |
Get value of a boolean configuration parameter. More... | |
long epicsStdCall | envPrtConfigParam (const ENV_PARAM *pParam) |
Print the value of a configuration parameter. More... | |
long epicsStdCall | epicsPrtEnvParams (void) |
Prints all configuration parameters and their current value. More... | |
LIBCOM_API unsigned short epicsStdCall | envGetInetPortConfigParam (const ENV_PARAM *pEnv, unsigned short defaultPort) |
Get value of a port number configuration parameter. More... | |
long epicsStdCall envGetBoolConfigParam | ( | const ENV_PARAM * | pParam, |
int * | pBool | ||
) |
Get value of a boolean configuration parameter.
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. |
Definition at line 325 of file envSubr.c.
char* epicsStdCall envGetConfigParam | ( | const ENV_PARAM * | pParam, |
int | bufDim, | ||
char * | pBuf | ||
) |
Get value of a configuration parameter.
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 |
Definition at line 139 of file envSubr.c.
const char* epicsStdCall envGetConfigParamPtr | ( | const ENV_PARAM * | pParam | ) |
long epicsStdCall envGetDoubleConfigParam | ( | const ENV_PARAM * | pParam, |
double * | pDouble | ||
) |
Get value of a double configuration parameter.
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. |
Definition at line 191 of file envSubr.c.
long epicsStdCall envGetInetAddrConfigParam | ( | const ENV_PARAM * | pParam, |
struct in_addr * | pAddr | ||
) |
Get value of an inet addr config parameter.
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. |
Definition at line 246 of file envSubr.c.
LIBCOM_API unsigned short epicsStdCall envGetInetPortConfigParam | ( | const ENV_PARAM * | pEnv, |
unsigned short | defaultPort | ||
) |
Get value of a port number configuration parameter.
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. |
Definition at line 398 of file envSubr.c.
long epicsStdCall envGetLongConfigParam | ( | const ENV_PARAM * | pParam, |
long * | pLong | ||
) |
Get value of a long configuration parameter.
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. |
Definition at line 303 of file envSubr.c.
long epicsStdCall envPrtConfigParam | ( | const ENV_PARAM * | pParam | ) |
Print the value of a configuration parameter.
pParam | Pointer to config param structure. |
Definition at line 353 of file envSubr.c.
long epicsStdCall epicsPrtEnvParams | ( | void | ) |
Prints all configuration parameters and their current value.
Definition at line 384 of file envSubr.c.