3 * Copyright (c) 1998-2001, Darren Hiebert
5 * This source code is released for free distribution under the terms of the
6 * GNU General Public License.
8 * External interface to main.c
16 #include "general.h" /* must always come first */
25 #define xMalloc(n,Type) (Type *)eMalloc((size_t)(n) * sizeof (Type))
26 #define xCalloc(n,Type) (Type *)eCalloc((size_t)(n), sizeof (Type))
27 #define xRealloc(p,n,Type) (Type *)eRealloc((p), (n) * sizeof (Type))
32 typedef int errorSelection
;
33 enum eErrorTypes
{ FATAL
= 1, WARNING
= 2, PERROR
= 4 };
34 extern char *CurrentDirectory
;
39 #ifdef NEED_PROTO_MALLOC
40 extern void *malloc (size_t);
41 extern void *realloc (void *ptr
, size_t);
44 extern void error (const errorSelection selection
, const char *const format
, ...) __printf__ (2, 3);
45 extern FILE *tempFile (const char *const mode
, char **const pName
);
46 extern char* eStrdup (const char* str
);
47 extern void *eMalloc (const size_t size
);
48 extern void *eCalloc (const size_t count
, const size_t size
);
49 extern void *eRealloc (void *const ptr
, const size_t size
);
50 extern void eFree (void *const ptr
);
51 extern void toLowerString (char* str
);
52 extern void toUpperString (char* str
);
53 extern char* newLowerString (const char* str
);
54 extern char* newUpperString (const char* str
);
55 extern long unsigned int getFileSize (const char *const name
);
56 extern boolean
isExecutable (const char *const name
);
57 extern boolean
isSameFile (const char *const name1
, const char *const name2
);
58 extern boolean
doesFileExist (const char *const fileName
);
59 extern char* absoluteDirname (char *file
);
60 extern char* relativeFilename (const char *file
, const char *dir
);
61 extern void addTotals (const unsigned int files
, const long unsigned int lines
, const long unsigned int bytes
);
62 extern const char *baseFilename (const char *const filePath
);
63 extern boolean
isAbsolutePath (const char *const path
);
64 extern vString
*combinePathAndFile (const char *const path
, const char *const file
);
65 extern boolean
isDestinationStdout (void);
66 extern const char *getExecutableName (void);
67 extern void processExcludeOption (const char *const option
, const char *const parameter
);
68 extern int main (int argc
, char **argv
);
71 extern int stricmp (const char *s1
, const char *s2
);
74 extern int strnicmp (const char *s1
, const char *s2
, size_t n
);
77 extern char* strstr (const char *str
, const char *substr
);
82 /* vi:set tabstop=8 shiftwidth=4: */