Julius 4.2
関数
libsent/src/util/gzfile.c

zlib あるいは gzip を用いた圧縮ファイルの読み込み [詳細]

#include <sent/stddefs.h>
#include <errno.h>
#include <zlib.h>

ソースコードを見る。

関数

FILE * fopen_readfile (char *filename)
 Open a file with zlib.
int fclose_readfile (FILE *fp)
 Close a file previously opened by fopen_readfile().
size_t myfread (void *ptr, size_t size, size_t n, FILE *fp)
 Read data from input stream opened by fopen_readfile().
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.
FILE * fopen_writefile (char *filename)
 Open or create a file for writing (no compression supported),.
int fclose_writefile (FILE *fp)
 Close file previously opened by open_writefile().
size_t myfwrite (void *ptr, size_t size, size_t n, FILE *fp)
 Write data.

説明

zlib あるいは gzip を用いた圧縮ファイルの読み込み

圧縮ファイルの読み込みに対応したファイルのオープン・クローズ・ 読み込み関数群です.

コンパイル時に zlib 無い場合,gzip を用いて圧縮ファイルの展開を 行います.この場合,複数のファイルを同時に開くことは出来ませんので 注意してください.

作者:
Akinobu LEE
日付:
Thu Feb 17 15:46:00 2005
Revision:
1.3

gzfile.c で定義されています。


関数

FILE* fopen_readfile ( char *  filename)

Open a file with zlib.

引数:
filename[in] file name to open
戻り値:
gzFile pointer if succeed, NULL on failure.

gzfile.c55 行で定義されています。

参照元 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(), と rdparam().

int fclose_readfile ( FILE *  fp)

Close a file previously opened by fopen_readfile().

引数:
fp[in] gzFile pointer
戻り値:
0 on success, -1 on error.

gzfile.c73 行で定義されています。

参照元 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(), と rdparam().

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

Read data from input stream opened by fopen_readfile().

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

gzfile.c93 行で定義されています。

参照元 init_hmminfo(), myread(), と rdnfunc().

int myfgetc ( FILE *  fp)

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

引数:
fp[in] gzFile pointer
戻り値:
the read character, or -1 on EOF or error.

gzfile.c112 行で定義されています。

参照元 rdn_strfunc().

int myfeof ( FILE *  fp)

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

引数:
fp[in] gzFile pointer.
戻り値:
1 if already on EOF, 0 if otherwise.

gzfile.c127 行で定義されています。

int myfrewind ( FILE *  fp)

Seek to the first of the file.

引数:
fp[in] gzFile pointer.
戻り値:
0 on success, -1 on error.

gzfile.c143 行で定義されています。

参照元 init_hmminfo().

FILE* fopen_writefile ( char *  filename)

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

引数:
filename[in] filename
戻り値:
the file pointer or NULL on failure.

gzfile.c336 行で定義されています。

参照元 wrwav_open().

int fclose_writefile ( FILE *  fp)

Close file previously opened by open_writefile().

引数:
fp[in] file pointer
戻り値:
0 on success, -1 on failure.

gzfile.c355 行で定義されています。

参照元 wrwav_close().

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

Write data.

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

gzfile.c374 行で定義されています。

参照元 mywrite(), save_hmmlist_bin(), と wrtfunc().