#include <julius/julius.h>
Go to the source code of this file.
Defines | |
#define | ISTOKEN(A) (A == ' ' || A == '\t' || A == '\n') |
Determine token characters. | |
Functions | |
static char * | fgets_jconf (char *buf, int size, FILE *fp) |
line reading function for jconf file. | |
void | get_dirname (char *path) |
Get directory name from a path name of a file. | |
static char * | expand_env (char *str) |
Envronment valuable expansion for a string. | |
boolean | config_file_parse (char *conffile, Jconf *jconf) |
Read and parse a jconf file, and set the specified option values. |
These functions are for reading jconf configuration file and set the parameters into jconf structure. String bracing by double quotation, and escaping character with backslash are supproted. Characters after '#' at each line will be ignored.
Note that all relative paths in jconf file are treated as relative to the jconf file, not the run-time current directory.
You can expand environment variables in a format of $HOME, ${HOME} or /home/ri in jconf file.
Definition in file m_jconf.c.
static char* fgets_jconf | ( | char * | buf, | |
int | size, | |||
FILE * | fp | |||
) | [static] |
line reading function for jconf file.
This function has capability of character escaping and newline codes on Win/Mac. Blank line will be skipped and newline characters will be stripped.
buf | [out] buffer to store the read text per line | |
size | [in] size of buf in bytes | |
fp | [in] file pointer |
Definition at line 87 of file m_jconf.c.
Referenced by config_file_parse().
void get_dirname | ( | char * | path | ) |
Get directory name from a path name of a file.
The trailing slash will be left, and the given buffer will be modified.
path | [i/o] file path name, will be modified to directory name |
Definition at line 153 of file m_jconf.c.
Referenced by config_file_parse(), and multigram_add_prefix_filelist().
static char* expand_env | ( | char * | str | ) | [static] |
Envronment valuable expansion for a string.
This function expands environment valuable in a string. When an expantion occurs, the given buffer will be released inside this function and newly allocated buffer that holds the resulting string will be returned.
Environment valuables should be in a form of $HOME, ${HOME} or /home/ri. '$' can be escaped by back slash, and strings enbraced by single quote will be treated as is (no expansion).
str | [in] target string |
Definition at line 206 of file m_jconf.c.
Referenced by config_file_parse().
boolean config_file_parse | ( | char * | conffile, | |
Jconf * | jconf | |||
) |
Read and parse a jconf file, and set the specified option values.
conffile | [in] jconf file path name | |
jconf | [out] global configuration data to be written. |
Definition at line 376 of file m_jconf.c.
Referenced by j_config_load_file(), j_config_load_file_new(), and opt_parse().