libjulius/src/m_options.c File Reference

Option parsing. More...

#include <julius/julius.h>

Go to the source code of this file.

Defines

#define FREE_MEMORY(p)   {if (p) {free(p); p = NULL;}}
 Free memory and fill it with NULL.
#define GET_TMPARG   if ((tmparg = next_arg(&i, argc, argv)) == NULL) return FALSE

Functions

char * filepath (char *filename, char *dirname)
 Change relative path to full path.
static char * next_arg (int *cur, int argc, char *argv[])
 Returns next argument string.
boolean opt_parse (int argc, char *argv[], char *cwd, Jconf *jconf)
 Option parsing.
void opt_release (Jconf *jconf)
 Free memories of variables allocated by option arguments.


Detailed Description

Option parsing.

These functions read option strings from jconf file or command line and set values to the configuration structure.

Author:
Akinobu Lee
Date:
Thu May 12 18:52:07 2005
Revision
1.1.1.1

Definition in file m_options.c.


Define Documentation

#define FREE_MEMORY (  )     {if (p) {free(p); p = NULL;}}

Free memory and fill it with NULL.

Parameters:
p [i/o] pointer to pointer that holds allocated address
Note:
Nothing will happen if p equals to NULL.

Definition at line 113 of file m_options.c.

Referenced by opt_parse(), and opt_release().


Function Documentation

char* filepath ( char *  filename,
char *  dirname 
)

Change relative path to full path.

If the file path is given as relative, prepend the dirname to it. If the file path is full, just copy it to new buffer and return.

Parameters:
filename [in] file path name
dirname [in] full path of current directory
Returns:
newly malloced buffer holding the full path name.

Definition at line 58 of file m_options.c.

Referenced by multigram_add_prefix_filelist(), multigram_add_prefix_list(), and opt_parse().

static char* next_arg ( int *  cur,
int  argc,
char *  argv[] 
) [static]

Returns next argument string.

Parameters:
cur [i/o] pointer to current point of the argment array
argc [in] total number of argments
argv [in] argment array
Returns:
pointer to the next argument, or NULL if no more argument vailable.

Definition at line 91 of file m_options.c.

boolean opt_parse ( int  argc,
char *  argv[],
char *  cwd,
Jconf jconf 
)

Option parsing.

Parameters:
argc [in] number of elements in argv
argv [in] array of argument strings
cwd [in] current directory
jconf [out] jconf structure to store data
Returns:
TRUE on success, or FALSE on error.

Definition at line 141 of file m_options.c.

Referenced by config_file_parse(), j_config_load_args(), and j_config_load_args_new().

Here is the caller graph for this function:

void opt_release ( Jconf jconf  ) 

Free memories of variables allocated by option arguments.

Parameters:
jconf [i/o] jconf configuration data

Definition at line 1081 of file m_options.c.

Referenced by j_jconf_free().

Here is the caller graph for this function:


Generated on Tue Dec 18 16:01:18 2007 for Julius by  doxygen 1.5.4