File: MwUtils.h

package info (click to toggle)
mowitz 0.2.0-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,168 kB
  • ctags: 4,214
  • sloc: ansic: 30,869; sh: 9,051; makefile: 169
file content (47 lines) | stat: -rw-r--r-- 1,264 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef MW_UTILS_H
#define MW_UTILS_H

#ifndef MW_MAX
#define MW_MAX(a,b) ((a)>(b)?(a):(b))
#endif

#ifdef DEBUG
#define MW_TRACE(s) do {\
        FILE *f=fopen("TRACEME","a");\
        fprintf(f,"[%s,%d]: " ,__FILE__,__LINE__);\
        fprintf s;\
        fprintf(f,"\n");\
        fclose(f);\
        } while(0);
#else
#define MW_TRACE(s)
#endif

#undef _
#define _(p) MwTranslate(p)

enum MwStatusStates { MW_ABORT = 0, MW_DONE, MW_WAITING };

extern void MwMallocStats(void);
extern void MwMallocInit(void (*)(void), int);
extern void MwMallocExit(void);
extern void *MwMalloc(size_t);
extern void *MwCalloc(size_t, size_t);
extern void MwFree(void *);
extern void *MwRealloc(void *, size_t);
extern char *MwStrdup(const char *);
extern void MwChomp(char *);
extern void MwLoadDictionary(char *);
extern char *MwTranslate(char *);
extern void MwQuotecpy(char *, char *, char *);
extern pid_t MwSpawn(const char *);
extern void MwHelp(char *);
extern int MwFromCchar(char *);
extern void MwToCchar(char *, int);
extern int MwStrcmp(const char *, const char *);
extern int MwStrcasecmp(const char *, const char *);
extern int MwStrncasecmp(const char *, const char *, size_t);
extern int MwSnprintf(char *, size_t, const char *, ...);


#endif	/* MW_UTILS_H */