Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

util.h

Go to the documentation of this file.
00001 
00026 /*
00027  * Copyright (c) 1991-2006 Kawahara Lab., Kyoto University
00028  * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
00029  * Copyright (c) 2005-2006 Julius project team, Nagoya Institute of Technology, Nagoya Institute of Technology
00030  * All rights reserved
00031  */
00032 
00033 #ifndef __SENT_UTIL_H__
00034 #define __SENT_UTIL_H__
00035 
00036 /*
00037  *  
00038  */
00049 #define MYBMALLOC_BLOCK_SIZE 10000
00050 
00052 typedef struct _bmalloc_base {
00053   void *base;                   
00054   char *now;                
00055   char *end;                
00056   struct _bmalloc_base *next;   
00057 } BMALLOC_BASE;
00058 
00059 /* readfile.c */
00060 char *getl(char *, int, FILE *);
00061 char *getl_fp(char *, int, FILE *);
00062 char *getl_fd(char *, int, int);
00063 char *getl_sd(char *, int, int);
00064 char *first_token(char *);
00065 char *next_token(void);
00066 char *next_token_if_any(void);
00067 char *rest_token(void);
00068 
00069 /* gzfile.c */
00070 FILE *fopen_readfile(char *);
00071 int fclose_readfile(FILE *);
00072 FILE *fopen_writefile(char *);
00073 int fclose_writefile(FILE *);
00074 size_t myfread(void *ptr, size_t size, size_t n, FILE *fp);
00075 size_t myfwrite(void *ptr, size_t size, size_t n, FILE *fp);
00076 int myfgetc(FILE *fp);
00077 int myfeof(FILE *fp);
00078 
00079 /* mybmalloc.c */
00080 void mybmalloc_set_param();
00081 void *mybmalloc(int);
00082 void mybmalloc_free(void);
00083 char *mybstrdup(char *);
00084 void *mybmalloc2(int size, BMALLOC_BASE **list);
00085 void mybfree2(BMALLOC_BASE **list);
00086 
00087 /* mymalloc.c */
00088 void *mymalloc(int);
00089 void *myrealloc(void *, int);
00090 void *mycalloc(int, int);
00091 
00092 /* endian.c */
00093 void swap_sample_bytes(SP16 *buf, int len);
00094 void swap_bytes(char *buf, size_t unitbyte, int unitnum);
00095 
00096 /* j_printf.c */
00097 #include <stdarg.h>
00098 #ifdef CHARACTER_CONVERSION
00099 boolean j_printf_set_charconv(char *fromcode, char *tocode);
00100 char *charconv(char *instr, char *outstr, int maxoutlen);
00101 #ifdef HAVE_ICONV
00102 boolean charconv_iconv_setup(char *fromcode, char *tocode, boolean *enabled);
00103 char *charconv_iconv(char *instr, char *outstr, int maxoutlen);
00104 #endif
00105 #ifdef USE_WIN32_MULTIBYTE
00106 boolean charconv_win32_setup(char *fromcode, char *tocode, boolean *enabled);
00107 char *charconv_win32(char *instr, char *outstr, int maxoutlen);
00108 #endif
00109 #ifdef USE_LIBJCODE
00110 boolean charconv_libjcode_setup(char *fromcode, char *tocode, boolean *enabled);
00111 char *charconv_libjcode(char *instr, char *outstr, int maxoutlen);
00112 #endif
00113 #endif /* CHARACTER_CONVERSION */
00114 void set_print_func(void (*print)(char *), void (*printerr)(char *), void (*flush)(void));
00115 int j_printf(char *format, ...);
00116 int j_printerr(char *format, ...);
00117 int j_flushprint();
00118 int module_send(int sd, char *format, ...);
00119 void j_error(char *format, ...);
00120 void j_error_register_exitfunc(void (*error_func)());
00121 void j_exit();
00122 void j_exit_register_exitfunc(void (*exit_func)());
00123 
00124 /* mystrtok.c */
00125 char  *mystrtok_quotation(char *str, char *delim, int left_paren, int right_paren, int mode); /* mode:0=normal, 1=just move to next token */
00126 char *mystrtok_quote(char *str, char *delim);
00127 char *mystrtok(char *str, char *delim);
00128 char *mystrtok_movetonext(char *str, char *delim);
00129 
00130 #endif /* __SENT_UTIL_H__ */

Generated on Tue Mar 28 16:17:43 2006 for Julius by  doxygen 1.4.2