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