00001
00027
00028
00029
00030
00031
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 char *getl(char *, int, FILE *);
00062 char *getl_fp(char *, int, FILE *);
00063 char *getl_fd(char *, int, int);
00064 char *getl_sd(char *, int, int);
00065 char *get_line_from_stdin(char *buf, int buflen, char *prompt);
00066
00067
00068 FILE *fopen_readfile(char *);
00069 int fclose_readfile(FILE *);
00070 FILE *fopen_writefile(char *);
00071 int fclose_writefile(FILE *);
00072 size_t myfread(void *ptr, size_t size, size_t n, FILE *fp);
00073 size_t myfwrite(void *ptr, size_t size, size_t n, FILE *fp);
00074 int myfgetc(FILE *fp);
00075 int myfeof(FILE *fp);
00076 int myfrewind(FILE *fp);
00077
00078
00079 void *mybmalloc2(unsigned int size, BMALLOC_BASE **list);
00080 char *mybstrdup2(char *, BMALLOC_BASE **list);
00081 void mybfree2(BMALLOC_BASE **list);
00082
00083
00084 void *mymalloc(int);
00085 void *myrealloc(void *, int);
00086 void *mycalloc(int, int);
00087
00088
00089 void swap_sample_bytes(SP16 *buf, int len);
00090 void swap_bytes(char *buf, size_t unitbyte, int unitnum);
00091
00092
00093 void jlog_set_output(FILE *fp);
00094 FILE *jlog_get_fp();
00095 void jlog(char *format, ...);
00096 int jlog_flush();
00097
00098
00099 char *mystrtok_quotation(char *str, char *delim, int left_paren, int right_paren, int mode);
00100 char *mystrtok_quote(char *str, char *delim);
00101 char *mystrtok(char *str, char *delim);
00102 char *mystrtok_movetonext(char *str, char *delim);
00103
00104
00105 void confout(FILE *strm);
00106 void confout_version(FILE *strm);
00107 void confout_audio(FILE *strm);
00108 void confout_lm(FILE *strm);
00109 void confout_am(FILE *strm);
00110 void confout_lib(FILE *strm);
00111 void confout_process(FILE *strm);
00112
00113 #endif