MAOS
Multithreaded Adaptive Optics Simulator
|
Macros | |
#define | format2key |
Functions | |
void | open_config (const char *fn, const char *prefix, int priority) |
void | close_config (const char *format,...) |
int | readcfg_peek (const char *format,...) |
int | readcfg_peek_n (const char *format,...) |
int | readcfg_peek_priority (const char *format,...) |
void | readcfg_ignore (const char *format,...) |
char * | readcfg_str (const char *format,...) |
int | readcfg_int (const char *format,...) |
real | readcfg_dbl (const char *format,...) |
int | readcfg_strarr (char ***res, int len, int relax, const char *format,...) |
int | readcfg_intarr (int **ret, int len, int relax, const char *format,...) |
int | readcfg_dblarr (real **ret, int len, int relax, const char *format,...) |
dmat * | readstr_dmat (int n, int relax, const char *key, const char *str) |
dmat * | readcfg_dmat (int n, int relax, const char *format,...) |
lmat * | readcfg_lmat (int n, int relax, const char *format,...) |
dcell * | readcfg_dcell (const char *format,...) |
Routines to read .conf type config files. Each entry is composed of a key and a value. The entries are maintained in a hash table. Each entry can be retrieved from the key.
#define format2key |
void open_config | ( | const char * | config_in, |
const char * | prefix, | ||
int | priority | ||
) |
Start the read config process by opening .conf files and fill the entries in a hash table. A key has a priority or 0 or higher. A new key with same or higher priority can override previous entry. priority is 0 for default configurations. -1 indicates optional configuration file that fails silently.
[in] | config_in | The .conf file to read |
[in] | prefix | if not NULL, prefix the key with this. |
[in] | priority | Priorities of keys. |
void close_config | ( | const char * | format, |
... | |||
) |
Save all configs to file and check for unused config options.
int readcfg_peek | ( | const char * | format, |
... | |||
) |
Check whether a have a record of a key.
int readcfg_peek_n | ( | const char * | format, |
... | |||
) |
Check the size of an array input
int readcfg_peek_priority | ( | const char * | format, |
... | |||
) |
Check whether the record is overriden by user supplied conf files.
void readcfg_ignore | ( | const char * | format, |
... | |||
) |
Ignore an entry and do not warn if it does not exist.
char* readcfg_str | ( | const char * | format, |
... | |||
) |
Obtain a string value from the key.
int readcfg_int | ( | const char * | format, |
... | |||
) |
Read integer
real readcfg_dbl | ( | const char * | format, |
... | |||
) |
Read real
int readcfg_strarr | ( | char *** | ret, |
int | len, | ||
int | relax, | ||
const char * | format, | ||
... | |||
) |
Read string array of len elements
int readcfg_intarr | ( | int ** | ret, |
int | len, | ||
int | relax, | ||
const char * | format, | ||
... | |||
) |
Read integer array of len elements
int readcfg_dblarr | ( | real ** | ret, |
int | len, | ||
int | relax, | ||
const char * | format, | ||
... | |||
) |
Read integer array of len elements
dmat* readstr_dmat | ( | int | n, |
int | relax, | ||
const char * | key, | ||
const char * | str | ||
) |
Read as a dmat. It can be a file name or an array.
[in] | n | Number of elements requested |
[in] | relax | 1: allow fewer values and fill the rest |
[in] | key | the key that needs the value. |
[in] | str | input |
dmat* readcfg_dmat | ( | int | n, |
int | relax, | ||
const char * | format, | ||
... | |||
) |
Read as a dmat. It can be a file name or an array.
lmat* readcfg_lmat | ( | int | n, |
int | relax, | ||
const char * | format, | ||
... | |||
) |
Read as an lmat.
dcell* readcfg_dcell | ( | const char * | format, |
... | |||
) |
Read dcell