Julius 4.2
libsent/include/sent/util.h
説明を見る。
00001 
00027 /*
00028  * Copyright (c) 1991-2011 Kawahara Lab., Kyoto University
00029  * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
00030  * Copyright (c) 2005-2011 Julius project team, Nagoya Institute of Technology
00031  * All rights reserved
00032  */
00033 
00034 #ifndef __SENT_UTIL_H__
00035 #define __SENT_UTIL_H__
00036 
00037 /*
00038  *  
00039  */
00050 #define MYBMALLOC_BLOCK_SIZE 10000
00051 
00053 typedef struct _bmalloc_base {
00054   void *base;                   
00055   char *now;                
00056   char *end;                
00057   struct _bmalloc_base *next;   
00058 } BMALLOC_BASE;
00059 
00060 
00061 #ifdef __cplusplus
00062 extern "C" {
00063 #endif
00064 
00065 /* readfile.c */
00066 char *getl(char *, int, FILE *);
00067 char *getl_fp(char *, int, FILE *);
00068 char *get_line_from_stdin(char *buf, int buflen, char *prompt);
00069 
00070 /* gzfile.c */
00071 FILE *fopen_readfile(char *);
00072 int fclose_readfile(FILE *);
00073 FILE *fopen_writefile(char *);
00074 int fclose_writefile(FILE *);
00075 size_t myfread(void *ptr, size_t size, size_t n, FILE *fp);
00076 size_t myfwrite(void *ptr, size_t size, size_t n, FILE *fp);
00077 int myfgetc(FILE *fp);
00078 int myfeof(FILE *fp);
00079 int myfrewind(FILE *fp);
00080 
00081 /* mybmalloc.c */
00082 void *mybmalloc2(unsigned int size, BMALLOC_BASE **list);
00083 char *mybstrdup2(char *, BMALLOC_BASE **list);
00084 void mybfree2(BMALLOC_BASE **list);
00085 
00086 /* mymalloc.c */
00087 void *mymalloc(size_t size);
00088 void *mymalloc_big(size_t elsize, size_t nelem);
00089 void *myrealloc(void *, size_t);
00090 void *mycalloc(size_t, size_t);
00091 
00092 /* endian.c */
00093 void swap_sample_bytes(SP16 *buf, int len);
00094 void swap_bytes(char *buf, size_t unitbyte, size_t unitnum);
00095 
00096 /* j_printf.c */
00097 void jlog_set_output(FILE *fp);
00098 FILE *jlog_get_fp();
00099 void jlog(char *format, ...);
00100 int jlog_flush();
00101 
00102 /* mystrtok.c */
00103 char  *mystrtok_quotation(char *str, char *delim, int left_paren, int right_paren, int mode); /* mode:0=normal, 1=just move to next token */
00104 char *mystrtok_quote(char *str, char *delim);
00105 char *mystrtok(char *str, char *delim);
00106 char *mystrtok_movetonext(char *str, char *delim);
00107 
00108 /* confout.c */
00109 void confout(FILE *strm);
00110 void confout_version(FILE *strm);
00111 void confout_audio(FILE *strm);
00112 void confout_lm(FILE *strm);
00113 void confout_am(FILE *strm);
00114 void confout_lib(FILE *strm);
00115 void confout_process(FILE *strm);
00116 
00117 /* qsort.c */
00118 void qsort_reentrant(void *base, int count, int size, int (*compare)(const void *, const void *, void *), void *pointer);
00119 
00120 #ifdef __cplusplus
00121 }
00122 #endif
00123 
00124 #endif /* __SENT_UTIL_H__ */