libsent/include/sent/util.h File Reference

Definitions for common utility functions. More...

Go to the source code of this file.

Data Structures

struct  _bmalloc_base
 Information of allocated memory block for mybmalloc(). More...

Defines

#define MYBMALLOC_BLOCK_SIZE   10000
 Memory block size in bytes for mybmalloc().

Typedefs

typedef _bmalloc_base BMALLOC_BASE
 Information of allocated memory block for mybmalloc().

Functions

char * getl (char *, int, FILE *)
 Read one line from file that has been opened by fopen_readfile().
char * getl_fp (char *, int, FILE *)
 Read one line from file pointer.
char * get_line_from_stdin (char *buf, int buflen, char *prompt)
 Get one file name from stdin with a prompt .
FILE * fopen_readfile (char *)
 Open a file with zlib.
int fclose_readfile (FILE *)
 Close a file previously opened by fopen_readfile().
FILE * fopen_writefile (char *)
 Open or create a file for writing (no compression supported),.
int fclose_writefile (FILE *)
 Close file previously opened by open_writefile().
size_t myfread (void *ptr, size_t size, size_t n, FILE *fp)
 Read data from input stream opened by fopen_readfile().
size_t myfwrite (void *ptr, size_t size, size_t n, FILE *fp)
 Write data.
int myfgetc (FILE *fp)
 Read one character from input stream opened by fopen_readfile().
int myfeof (FILE *fp)
 Test if reached end of file, for files opened by fopen_readfile().
int myfrewind (FILE *fp)
 Seek to the first of the file.
void * mybmalloc2 (unsigned int size, BMALLOC_BASE **list)
 Another version of memory block allocation, used for tree lexicon.
char * mybstrdup2 (char *, BMALLOC_BASE **list)
 String duplication using mybmalloc2().
void mybfree2 (BMALLOC_BASE **list)
 Free all memories allocated by mybmalloc2().
void * mymalloc (size_t size)
 Allocate a memory, as the same as malloc.
void * mymalloc_big (size_t elsize, size_t nelem)
 Allocate a memory for huge block, check for limit.
void * myrealloc (void *, size_t)
 Re-allocate memory area, keeping the existing data, as the same as realloc.
void * mycalloc (size_t, size_t)
 Allocate memory area and set it to zero, as the same as calloc.
void swap_sample_bytes (SP16 *buf, int len)
 Byte swapping of 16bit audio samples.
void swap_bytes (char *buf, size_t unitbyte, size_t unitnum)
 Generic byte-swapping functions for any size of unit.
void jlog_set_output (FILE *fp)
 Set file pointer to output the log.
FILE * jlog_get_fp ()
 Return the current file pointer to output log.
void jlog (char *format,...)
 Output a normal message to log.
int jlog_flush ()
 Flush text message.
char * mystrtok_quotation (char *str, char *delim, int left_paren, int right_paren, int mode)
 Generic function to extract tokens from strings, with quotation handling.
char * mystrtok_quote (char *str, char *delim)
 Extract tokens considering quotation by double quotation mark.
char * mystrtok (char *str, char *delim)
 Extract tokens, not considering quotation, just as the same as strtok.
char * mystrtok_movetonext (char *str, char *delim)
 Just move to the beginning of the next token, without modifying the str.
void confout (FILE *strm)
 Output all information of this libsent library.
void confout_version (FILE *strm)
 Output version of this libsent library.
void confout_audio (FILE *strm)
 Output audio configuration of this libsent library.
void confout_lm (FILE *strm)
 Output language model configuration of this libsent library.
void confout_am (FILE *strm)
 Output acoustic model configuration of this libsent library.
void confout_lib (FILE *strm)
 Output about linked libraries of this libsent library.
void confout_process (FILE *strm)
 Output about process handling of this libsent library.
void qsort_reentrant (void *base, int count, int size, int(*compare)(const void *, const void *, void *), void *pointer)
 Quick sort that will pass data poitner to comparison function for re-entrant usage.


Detailed Description

Definitions for common utility functions.

This file contains definitions for common utility functions: text reading and parsing, compressed file input, memory allocation, byte order changing, common printf function (j_printf etc.) and so on.

Author:
Akinobu LEE
Date:
Sat Feb 12 12:30:40 2005
Revision
1.6

Definition in file util.h.


Define Documentation

#define MYBMALLOC_BLOCK_SIZE   10000

Memory block size in bytes for mybmalloc().

mybmalloc() allocate memory per big block to reduce memory management overhead. This value sets the block size to be allocated. Smaller value may leads to finer granularity, but overhead may increase. Larger value may result in reduction of overhead, but too much memory can be allocated for a small memory requirement.

Definition at line 50 of file util.h.

Referenced by mybmalloc_set_param().


Function Documentation

char* getl ( char *  buf,
int  maxlen,
FILE *  fp 
)

Read one line from file that has been opened by fopen_readfile().

Blank line will be skipped.

Parameters:
buf [out] data buffer
maxlen [in] maximum length of above
fp [in] file pointer or gzFile pointer
Returns:
the buffer buf, or NULL on EOF or error.

Definition at line 53 of file readfile.c.

Referenced by add_bigram(), add_unigram(), get_total_info(), ngram_read_arpa(), rddfa(), rdhmmlist(), read_token(), set_unigram(), voca_load_htkdict(), and voca_load_wordlist().

char* getl_fp ( char *  buf,
int  maxlen,
FILE *  fp 
)

Read one line from file pointer.

Blank line will be skipped.

Parameters:
buf [out] data buffer
maxlen [in] maximum length of above
fp [in] file pointer
Returns:
the buffer buf, or NULL on EOF or error.

Definition at line 87 of file readfile.c.

Referenced by adin_file_begin(), adin_sndfile_begin(), htk_config_file_parse(), main_recognition_stream_loop(), multigram_add_prefix_filelist(), rddfa_fp(), voca_load_htkdict_fp(), and voca_load_wordlist_fp().

char* get_line_from_stdin ( char *  buf,
int  buflen,
char *  prompt 
)

Get one file name from stdin with a prompt .

Blank line is omitted.

Parameters:
buf [out] buffer to hold input text line
buflen [in] length of the buffer
prompt [in] prompt string
Returns:
pointer to buf, or NULL on EOF input.

Definition at line 118 of file readfile.c.

Referenced by adin_file_begin(), adin_sndfile_begin(), main(), and main_recognition_stream_loop().

FILE* fopen_readfile ( char *  filename  ) 

Open a file with zlib.

Parameters:
filename [in] file name to open
Returns:
gzFile pointer if succeed, NULL on failure.

Definition at line 55 of file gzfile.c.

Referenced by CMN_load_from_file(), init_dfa(), init_hmminfo(), init_ngram_arpa(), init_ngram_arpa_additional(), init_ngram_bin(), init_voca(), init_wordlist(), new_SS_load_from_file(), and rdparam().

int fclose_readfile ( FILE *  fp  ) 

Close a file previously opened by fopen_readfile().

Parameters:
fp [in] gzFile pointer
Returns:
0 on success, -1 on error.

Definition at line 73 of file gzfile.c.

Referenced by CMN_load_from_file(), init_dfa(), init_hmminfo(), init_ngram_arpa(), init_ngram_arpa_additional(), init_ngram_bin(), init_voca(), init_wordlist(), new_SS_load_from_file(), and rdparam().

FILE* fopen_writefile ( char *  filename  ) 

Open or create a file for writing (no compression supported),.

Parameters:
filename [in] filename
Returns:
the file pointer or NULL on failure.

Definition at line 336 of file gzfile.c.

Referenced by wrwav_open().

int fclose_writefile ( FILE *  fp  ) 

Close file previously opened by open_writefile().

Parameters:
fp [in] file pointer
Returns:
0 on success, -1 on failure.

Definition at line 355 of file gzfile.c.

Referenced by wrwav_close().

size_t myfread ( void *  ptr,
size_t  size,
size_t  n,
FILE *  fp 
)

Read data from input stream opened by fopen_readfile().

Parameters:
ptr [out] data buffer
size [in] size of unit in bytes
n [in] number of unit to be read
fp [in] gzFile pointer
Returns:
number of read units or EOF, -1 on error.

Definition at line 93 of file gzfile.c.

Referenced by adin_stdin_read(), aptree_read(), init_hmminfo(), myread(), and rdnfunc().

size_t myfwrite ( void *  ptr,
size_t  size,
size_t  n,
FILE *  fp 
)

Write data.

Parameters:
ptr [in] data buffer
size [in] size of unit in bytes
n [in] number of unit to write
fp [in] file pointer
Returns:
the number of units successfully written, or 0 if EOF or failed.

Definition at line 374 of file gzfile.c.

Referenced by aptree_write(), mywrite(), save_hmmlist_bin(), and wrtfunc().

int myfgetc ( FILE *  fp  ) 

Read one character from input stream opened by fopen_readfile().

Parameters:
fp [in] gzFile pointer
Returns:
the read character, or -1 on EOF or error.

Definition at line 112 of file gzfile.c.

Referenced by rdn_strfunc().

int myfeof ( FILE *  fp  ) 

Test if reached end of file, for files opened by fopen_readfile().

Parameters:
fp [in] gzFile pointer.
Returns:
1 if already on EOF, 0 if otherwise.

Definition at line 127 of file gzfile.c.

int myfrewind ( FILE *  fp  ) 

Seek to the first of the file.

Parameters:
fp [in] gzFile pointer.
Returns:
0 on success, -1 on error.

Definition at line 143 of file gzfile.c.

Referenced by init_hmminfo().

void* mybmalloc2 ( unsigned int  size,
BMALLOC_BASE **  list 
)

Another version of memory block allocation, used for tree lexicon.

Parameters:
size [in] memory size to be allocated
list [i/o] total memory management information (will be updated here)
Returns:
pointer to the newly allocated area.

Definition at line 84 of file mybmalloc.c.

Referenced by add_ac(), add_to_error(), aptree_read(), bt_new(), bt_relocate_rw(), calc_tied_mix_extend(), dens_new(), dens_read(), hmm_add_physical_to_logical(), hmm_add_pseudo_phones_sub(), htk_hmmdata_new(), htk_hmmdata_read(), make_hmm_basephone_list(), mpdf_new(), mpdf_read(), mybstrdup2(), new_node(), outprob_cache_extend(), param_alloc(), rd_data(), rd_dens(), rd_mpdf(), rd_pdf_sub(), rd_state(), rd_streamweight(), rd_tmix(), rd_trans(), rd_var(), rdhmmlist(), rdn_strfunc(), state_new(), state_read(), sw_new(), sw_read(), tmix_create_codebook_index(), tmix_read(), trans_new(), trans_read(), var_new(), var_read(), voca_append(), voca_load_htkdict_line(), voca_load_wordlist_line(), wchmm_add_word(), and wchmm_duplicate_state().

char* mybstrdup2 ( char *  s,
BMALLOC_BASE **  list 
)

String duplication using mybmalloc2().

Parameters:
s [in] string to be duplicated
list [i/o] total memory management information pointer
Returns:
pointer to the newly allocated string.

Definition at line 122 of file mybmalloc.c.

Referenced by rdhmmdef(), rdhmmlist(), and tmix_read().

void mybfree2 ( BMALLOC_BASE **  list  ) 

Free all memories allocated by mybmalloc2().

Parameters:
list [i/o] total memory management information (will be cleaned here)

Definition at line 138 of file mybmalloc.c.

Referenced by bt_free(), bt_prepare(), calc_tied_mix_free(), free_cdset(), hmminfo_free(), outprob_cache_free(), param_free_content(), wchmm_free(), and word_info_free().

void* mymalloc ( size_t  size  ) 

Allocate a memory, as the same as malloc.

Parameters:
size [in] required size in bytes.
Returns:
pointer to the the newly allocated area.

Definition at line 41 of file mymalloc.c.

Referenced by add_arc(), add_successor(), add_to_error(), add_unigram(), adin_alsa_standby(), adin_cut_callback_store_buffer(), adin_file_open(), adin_initialize(), adin_mic_standby(), adin_setup_param(), adin_tcpip_send_resume(), adin_thread_create(), aptree_read(), aptree_write(), build_gsset(), build_state2gs(), build_wchmm2(), calc_tied_mix_extend(), calc_tied_mix_init(), cdset_new(), cm_init(), CMN_realtime_new(), cn_build_wordlist(), cn_new(), config_file_parse(), confnet_create(), dfa_cp_append(), dfa_find_pause_word(), dfa_info_new(), dfa_pause_word_append(), dfa_state_init(), do_align(), ds48to16(), ds48to16_new(), edit_distance(), expand_env(), filepath(), get_nbest_uniprob(), gmm_gprune_safe_init(), gmm_init(), gms_gprune_init(), gms_init(), gms_prepare(), gprune_beam_init(), gprune_heu_init(), gprune_none_init(), gprune_safe_init(), graph_forward_backward(), hmminfo_new(), init_count_zc_e(), InitFBank(), initialize_GMM(), j_add_option(), j_jconf_am_new(), j_jconf_lm_new(), j_jconf_new(), j_jconf_search_new(), j_launch_recognition_instance(), j_mfcccalc_new(), j_process_am_new(), j_process_lm_new(), j_recog_new(), j_recogprocess_new(), make_costbl_hamming(), make_costbl_makemfcc(), make_fft_table(), make_iwcache_index(), make_phseq(), make_sintbl_wcep(), make_successor_list_unigram_factoring(), make_terminfo(), malloc_dfa_cp(), malloc_nodes(), malloc_wordtrellis(), max_successor_cache_init(), max_successor_prob_iw(), multigram_add(), multigram_add_gramlist(), multigram_add_prefix_filelist(), mybmalloc2(), new_make_word_hmm_with_lm(), new_node(), new_param(), new_SS_calculate(), new_SS_load_from_file(), new_str2phseq(), new_str2wordseq(), newnode(), ngram_info_new(), ngram_make_lookup_tree(), ngram_read_bin_v5(), nw_malloc(), opt_charconv(), opt_kanji(), opt_parse(), outprob_cache_extend(), outprob_cd_nbest_init(), param_str2code(), phoneme_rev_align(), plugin_exec_process_result(), plugin_init(), plugin_load_file(), rd_dens(), rd_mpdf(), rd_state(), rd_streamweight(), rd_tmix(), rd_trans(), rd_var(), rddfa_line(), rdhmmlist(), read_param(), read_token(), RealTimeInit(), RealTimePipeLine(), regist_cdset(), result_align_new(), result_sentence_malloc(), select_param_kind(), set_unigram(), state_rev_align(), terminfo_append(), test_expand_triphone(), tmix_create_codebook_index(), useropt_new(), viterbi_segment(), voca_load_htkdict_line(), voca_load_wordlist_line(), wchmm_duplicate_leafnode(), wchmm_fbs(), wchmm_init(), wchmm_new(), WeightCepstrum(), winfo_init(), WMP_deltabuf_new(), WMP_work_new(), word_info_new(), word_rev_align(), wordgraph_adjust_boundary_sub(), wordgraph_depth_cut(), wordgraph_new(), wordgraph_sort_and_annotate_id(), wt_dens(), wt_mpdf(), wt_state(), wt_streamweight(), wt_tmix(), wt_trans(), and wt_var().

void* mymalloc_big ( size_t  elsize,
size_t  nelem 
)

Allocate a memory for huge block, check for limit.

Parameters:
size [in] required size in bytes.
Returns:
pointer to the the newly allocated area.

Definition at line 59 of file mymalloc.c.

Referenced by add_bigram(), add_unigram(), ngram_read_bin_v5(), set_ngram(), and set_unigram().

void* myrealloc ( void *  ptr,
size_t  size 
)

Re-allocate memory area, keeping the existing data, as the same as realloc.

Parameters:
ptr [in] memory pointer to be re-allocated
size [in] required new size in bytes
Returns:
pointer to the the newly allocated area with existing data.

Definition at line 87 of file mymalloc.c.

Referenced by adin_cut_callback_store_buffer(), calc_tied_mix_extend(), cn_add_wg(), config_file_parse(), cp_add(), dfa_cp_append(), dfa_pause_word_append(), dfa_state_expand(), ds48to16(), expand_env(), expand_tlist(), new_str2phseq(), new_str2wordseq(), nw_expand(), outprob_cache_extend(), RealTimePipeLine(), regist_cdset(), shrink_successor(), terminfo_append(), voca_load_htkdict_line(), voca_load_wordlist_line(), wchmm_extend(), wchmm_extend_startnode(), winfo_expand(), wordgraph_add_leftword(), and wordgraph_add_rightword().

void* mycalloc ( size_t  nelem,
size_t  elsize 
)

Allocate memory area and set it to zero, as the same as calloc.

Parameters:
nelem [in] size of element in bytes
elsize [in] number of elements to allocate
Returns:
pointer to the newly allocated area.

Definition at line 106 of file mymalloc.c.

Referenced by CMN(), and MVN().

void swap_sample_bytes ( SP16 buf,
int  len 
)

Byte swapping of 16bit audio samples.

Parameters:
buf [i/o] data buffer
len [in] length of above

Definition at line 59 of file endian.c.

Referenced by adin_alsa_read(), adin_file_read(), adin_mic_read(), adin_oss_read(), adin_stdin_read(), adin_tcpip_read(), NA_read(), and wrsamp().

void swap_bytes ( char *  buf,
size_t  unitbyte,
size_t  unitnum 
)

Generic byte-swapping functions for any size of unit.

Parameters:
buf [i/o] data buffer
unitbyte [in] size of unit in bytes
unitnum [in] number of unit in the buffer

Definition at line 35 of file endian.c.

Referenced by myread(), mywrite(), rdnfunc(), read_param(), and wrtfunc().

void jlog_set_output ( FILE *  fp  ) 

Set file pointer to output the log.

Set to NULL to totally disable the log outputs.

Parameters:
fp [in] file pointer or NULL to disable

Definition at line 52 of file jlog.c.

Referenced by main().

FILE* jlog_get_fp (  ) 

Return the current file pointer to output log.

Returns:
the file pointer.

Definition at line 65 of file jlog.c.

Referenced by check_hmm_limit(), make_dfa_voca_ref(), print_engine_info(), and wordgraph_check_coherence().

void jlog ( char *  fmt,
  ... 
)

Output a normal message to log.

Parameters:
fmt [in] format string, like printf.
... [in] variable length argument like printf.

Definition at line 80 of file jlog.c.

Referenced by accept_from(), add_bigram(), add_unigram(), adin_alsa_begin(), adin_alsa_read(), adin_alsa_standby(), adin_begin(), adin_cut(), adin_cut_callback_store_buffer(), adin_end(), adin_esd_standby(), adin_file_begin(), adin_file_close(), adin_file_open(), adin_file_read(), adin_file_standby(), adin_initialize(), adin_mic_begin(), adin_mic_end(), adin_mic_read(), adin_mic_standby(), adin_netaudio_read(), adin_oss_read(), adin_oss_standby(), adin_select(), adin_setup_all(), adin_setup_param(), adin_sndfile_begin(), adin_sndfile_end(), adin_sndfile_standby(), adin_stdin_begin(), adin_stdin_read(), adin_store_buffer(), adin_tcpip_begin(), adin_tcpip_end(), adin_tcpip_read(), adin_tcpip_send_pause(), adin_tcpip_send_resume(), adin_tcpip_send_terminate(), adin_tcpip_standby(), adin_thread_cancel(), adin_thread_create(), adin_thread_input_main(), adin_thread_process(), adjust_sc_index(), allocateAudioBufferList(), aptree_read(), aptree_remove_entry(), aptree_write(), bt_current_max_word(), build_state2gs(), build_wchmm(), build_wchmm2(), c_out(), callback_add_core(), callback_delete(), callback_exec(), callback_exec_adin(), callback_list_error(), charconv_iconv_setup(), charconv_libjcode_setup(), charconv_win32(), charconv_win32_setup(), check_format(), check_header(), check_hmm_limit(), check_hmm_options(), check_section(), checkpath(), clear_stocker(), CMN_load_from_file(), CMN_realtime_update(), CMN_save_to_file(), codebook_add(), config_file_parse(), ConvInputProc(), cp_add(), cp_remove(), cpair_append(), create_mfcc_calc_instances(), decode_end(), decode_proceed(), def_mpdf_macro(), dens_add(), detect_end_of_segment(), dfa_cp_append(), dfa_pause_word_append(), dfa_symbol_lookup(), do_align(), ds48to16_new(), error_missing_left_triphone(), error_missing_right_triphone(), expand_env(), expand_tlist(), extract_cpair(), fclose_readfile(), finalize_1st_pass(), finalize_segment(), find_1pass_result_word(), fix_uniprob_srilm(), fopen_readfile(), fopen_writefile(), get_back_trellis_init(), get_back_trellis_proceed(), get_dens_data(), get_mpdf_data(), get_state_data(), get_streamweight_data(), get_total_info(), get_trans_data(), get_var_data(), gmm_init(), gmm_proceed(), gms_init(), graph_make_order(), guess_abs_e_location(), guess_basenum(), guess_if_cd_hmm(), hmm_add_physical_to_logical(), hmm_add_pseudo_phones(), hmm_add_pseudo_phones_sub(), hmm_check(), htk_config_file_parse(), htk_hmm_has_several_arc_on_edge(), htk_hmm_set_pause_model(), htk_hmmdata_add(), init_dfa(), init_hmminfo(), init_ngram_arpa(), init_ngram_arpa_additional(), init_ngram_bin(), init_nodescore(), init_voca(), init_wordlist(), initialize_dict(), initialize_GMM(), initialize_GSHMM(), initialize_HMM(), j_add_option(), j_close_stream(), j_create_instance_from_jconf(), j_final_fusion(), j_get_amconf_by_id(), j_get_amconf_by_name(), j_get_lmconf_by_id(), j_get_lmconf_by_name(), j_get_searchconf_by_id(), j_get_searchconf_by_name(), j_jconf_am_regist(), j_jconf_finalize(), j_jconf_lm_regist(), j_jconf_search_regist(), j_launch_recognition_instance(), j_load_all(), j_load_am(), j_load_lm(), j_mfcccalc_new(), j_open_stream(), j_process_activate(), j_process_activate_by_id(), j_process_add_lm(), j_process_am_remove(), j_process_deactivate(), j_process_deactivate_by_id(), j_process_lm_remove(), j_process_remove(), j_recognize_stream(), j_recognize_stream_core(), lcdset_register_with_category(), list_error(), load_hmmlist_bin(), make_base_phone(), make_connection(), make_connection_unix(), make_costbl_hamming(), make_costbl_makemfcc(), make_dfa_voca_ref(), make_fft_table(), make_log_tbl(), make_ngram_ref(), make_sintbl_wcep(), make_successor_list(), make_successor_list_unigram_factoring(), make_voca_ref(), mark_word_edge(), max_successor_prob_iw(), merge_contexts(), mfc_module_init(), mfc_module_read(), mfc_module_set_header(), mfcc_go(), mpdf_add(), mpdf_read(), multigram_activate(), multigram_add(), multigram_add_prefix_filelist(), multigram_add_prefix_list(), multigram_add_words_to_grammar(), multigram_append_to_global(), multigram_build(), multigram_deactivate(), multigram_delete(), multigram_exec_activate(), multigram_exec_delete(), multigram_get_grammar_by_id(), multigram_get_grammar_by_name(), multigram_get_id_by_name(), multigram_read_file_and_add(), multigram_rebuild_wchmm(), multigram_update(), mycalloc(), myfread(), mymalloc(), mymalloc_big(), myread(), myrealloc(), NA_standby(), new_make_word_hmm_with_lm(), new_SS_calculate(), new_SS_load_from_file(), new_str2phseq(), new_str2wordseq(), next_arg(), ngram_compact_context(), ngram_nextwords(), ngram_prob(), ngram_read_arpa(), ngram_read_bin(), ngram_read_bin_compat(), ngram_read_bin_v5(), opt_parse(), outprob_init(), output_card_info(), param_alloc(), param_check_and_adjust(), param_qualstr2code(), param_strip_zero(), plugin_exec_engine_startup(), plugin_get_id(), plugin_load_dir(), plugin_load_dirs(), plugin_load_file(), print_engine_info(), print_format(), print_jconf_overview(), print_wchmm_info(), printStreamInfo(), put_all_in_stack(), put_atom(), put_hypo_wname(), put_hypo_woutput(), rd(), rd_dens(), rd_header(), rd_mpdf(), rd_para(), rd_streamweight(), rd_tmix(), rd_trans(), rd_var(), rddfa_line(), rderr(), rdhmmdef(), rdhmmlist(), rdn_strfunc(), rdnfunc(), read_binhmm(), read_global_opt(), read_param(), ready_as_server(), RealTimeCMNUpdate(), RealTimeInit(), RealTimeParam(), RealTimePipeLine(), RealTimePipeLinePrepare(), regist_cdset(), reset_count_zc_e(), save_hmmlist_bin(), scan_word(), select_param_vmark(), set_beam_width(), set_global_opt(), set_ngram(), set_unigram(), set_unknown_id(), setup_wav(), state_add(), strip_zero(), sw_add(), sw_read(), swap_leftword(), swap_rightword(), tmix_create_codebook_index(), trans_add(), useropt_exec(), var_add(), var_read(), viterbi_segment(), voca_load_htkdict_line(), voca_load_wordlist_line(), voca_lookup_wid(), voca_mono2tri(), VTLN_recreate_fbank_cf(), Wav2MFCC(), wav2mfcc(), wchmm_add_word(), wchmm_fbs(), winfo_expand(), wordgraph_add_leftword(), wordgraph_add_rightword(), wordgraph_adjust_boundary(), wordgraph_adjust_boundary_sub(), wordgraph_check_coherence(), wordgraph_check_merge(), wordgraph_compaction_exacttime(), wordgraph_compaction_neighbor(), wordgraph_compaction_thesame(), wordgraph_depth_cut(), wordgraph_new(), wordgraph_purge_leaf_nodes(), write_binhmm(), write_header(), wrtfunc(), wrwav_close(), wt(), wt_data(), wt_dens(), wt_header(), wt_mpdf(), wt_pdf_sub(), wt_state(), wt_streamweight(), wt_tmix(), wt_trans(), wt_var(), and xrun_recovery().

int jlog_flush (  ) 

Flush text message.

The output device can be changed by set_print_func().

Returns:
the same as fflush, i.e. 0 on success, other if failed.

Definition at line 103 of file jlog.c.

Referenced by j_recognize_stream_core(), and rderr().

char* mystrtok_quotation ( char *  str,
char *  delim,
int  left_paren,
int  right_paren,
int  mode 
)

Generic function to extract tokens from strings, with quotation handling.

The usage is as the same as strtok.

Parameters:
str [i/o] source string, or NULL when this is a continuous call from previous call. Will be truncated in this function.
delim [in] string to specify the delimiters.
left_paren [in] left brace
right_paren [in] right brace
mode [in] if 1, just move to the beginning of next token
Returns:
pointer to the next extracted token.

Definition at line 51 of file mystrtok.c.

Referenced by mystrtok(), mystrtok_movetonext(), mystrtok_quote(), voca_load_htkdict_line(), and voca_load_wordlist_line().

char* mystrtok_quote ( char *  str,
char *  delim 
)

Extract tokens considering quotation by double quotation mark.

Parameters:
str [i/o] source string, will be truncated.
delim [in] string of all token delimiters
Returns:
pointer to the next extracted token, or NULL when no token found.

Definition at line 107 of file mystrtok.c.

Referenced by read_token(), voca_load_htkdict_line(), and voca_load_wordlist_line().

char* mystrtok ( char *  str,
char *  delim 
)

Extract tokens, not considering quotation, just as the same as strtok.

Parameters:
str [i/o] source string, will be truncated.
delim [in] string of all token delimiters
Returns:
pointer to the next extracted token, or NULL when no token found.

Definition at line 121 of file mystrtok.c.

Referenced by voca_load_htkdict_line(), and voca_load_wordlist_line().

char* mystrtok_movetonext ( char *  str,
char *  delim 
)

Just move to the beginning of the next token, without modifying the str.

Parameters:
str [i/o] source string, will be truncated.
delim [in] string of all token delimiters
Returns:
pointer to the next extracted token, or NULL when no token found.

Definition at line 135 of file mystrtok.c.

Referenced by voca_load_htkdict_line(), and voca_load_wordlist_line().

void confout ( FILE *  strm  ) 

Output all information of this libsent library.

Parameters:
strm [in] file pointer to output

Definition at line 152 of file confout.c.

Referenced by j_put_library_defs().

void confout_version ( FILE *  strm  ) 

Output version of this libsent library.

Parameters:
strm [in] file pointer to output

Definition at line 37 of file confout.c.

Referenced by confout().

void confout_audio ( FILE *  strm  ) 

Output audio configuration of this libsent library.

Parameters:
strm [in] file pointer to output

Definition at line 48 of file confout.c.

Referenced by confout().

void confout_lm ( FILE *  strm  ) 

Output language model configuration of this libsent library.

Parameters:
strm [in] file pointer to output

Definition at line 80 of file confout.c.

Referenced by confout().

void confout_am ( FILE *  strm  ) 

Output acoustic model configuration of this libsent library.

Parameters:
strm [in] file pointer to output

Definition at line 102 of file confout.c.

Referenced by confout().

void confout_lib ( FILE *  strm  ) 

Output about linked libraries of this libsent library.

Parameters:
strm [in] file pointer to output

Definition at line 124 of file confout.c.

Referenced by confout().

void confout_process ( FILE *  strm  ) 

Output about process handling of this libsent library.

Parameters:
strm [in] file pointer to output

Definition at line 136 of file confout.c.

Referenced by confout().

void qsort_reentrant ( void *  base,
int  count,
int  size,
int(*)(const void *, const void *, void *)  compare,
void *  pointer 
)

Quick sort that will pass data poitner to comparison function for re-entrant usage.

Parameters:
base [i/o] pointer to the data array
count [in] number of elements in the array
size [in] size of an element in bytes
compare [in] comparison function
pointer [in] data which will be passed to comparison function

Definition at line 77 of file qsort.c.

Referenced by wchmm_sort_idx_by_category(), and wchmm_sort_idx_by_wseq().


Generated on Thu Jul 23 12:14:19 2009 for Julius by  doxygen 1.5.1