Imported Upstream version 0.4.8
[platform/upstream/libsmi.git] / lib / util.h
1 /*
2  * util.h --
3  *
4  *      Misc utility functions.
5  *
6  * Copyright (c) 1999 Frank Strauss, Technical University of Braunschweig.
7  *
8  * See the file "COPYING" for information on usage and redistribution
9  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10  *
11  * @(#) $Id: util.h 8062 2008-04-16 14:25:53Z schoenw $
12  */
13
14 #ifndef _UTIL_H
15 #define _UTIL_H
16
17 #include <stdlib.h>
18 #include <time.h>
19
20 #include "smi.h"
21 #include "error.h"
22 #include "parser-smi.h"
23
24
25
26 #ifdef __CHECKER__
27 #undef HAVE_TIMEGM
28 #undef HAVE_STRTOULL
29 #undef HAVE_STRTOUQ
30 #undef HAVE_STRTOLL
31 #undef HAVE_STRTOQ
32 #endif
33
34 /*
35  * Make sure we have strtoull() and strtoll() on this system.
36  */
37
38 #ifndef HAVE_STRTOULL
39 #ifdef HAVE_STRTOUQ
40 #define strtoull strtouq
41 #else
42 #define strtoull strtoul        /* TODO */
43 #endif
44 #endif
45
46 #ifndef HAVE_STRTOLL
47 #ifdef HAVE_STRTOQ
48 #define strtoll strtoq
49 #else
50 #define strtoll strtol
51 #endif
52 #endif
53
54 extern int smiIsPath(const char *s);
55
56 #ifndef HAVE_TIMEGM
57 time_t timegm(struct tm *tm);
58 #endif
59
60 int smiTypeDerivedFrom(Type *typePtr, Type *parentTypePtr);
61
62 #endif /* _UTIL_H */
63