1 /* 2 * $Id: util.h 191 2007-03-30 23:26:38Z boote $ 3 */ 4 /************************************************************************ 5 * * 6 * Copyright (C) 2002 * 7 * Internet2 * 8 * All Rights Reserved * 9 * * 10 ************************************************************************/ 11 /* 12 * File: util.h 13 * 14 * Author: Jeff Boote 15 * Internet2 16 * 17 * Date: Tue Apr 23 10:11:16 2002 18 * 19 * Description: 20 * I2 Utility library. Currently contains: 21 * * error logging 22 * * command-line parsing 23 */ 24 #ifndef _I2_util_h_ 25 #define _I2_util_h_ 26 27 #include <inttypes.h> 28 29 typedef intptr_t I2Boolean; 30 31 #ifndef False 32 #define False (0) 33 #endif 34 #ifndef True 35 #define True !False 36 #endif 37 38 #ifndef MIN 39 #define MIN(a,b) ((a<b)?a:b) 40 #endif 41 #ifndef MAX 42 #define MAX(a,b) ((a>b)?a:b) 43 #endif 44 45 #ifdef __cplusplus 46 #define BEGIN_C_DECLS extern "C" { 47 #define END_C_DECLS } 48 #else 49 #define BEGIN_C_DECLS 50 #define END_C_DECLS 51 #endif 52 53 #define I2Number(arr) (sizeof(arr)/sizeof(arr[0])) 54 55 #include <I2util/Pthread.h> 56 #include <I2util/errlog.h> 57 #include <I2util/table.h> 58 #include <I2util/random.h> 59 #include <I2util/io.h> 60 #include <I2util/saddr.h> 61 #include <I2util/md5.h> 62 #include <I2util/readpassphrase.h> 63 #include <I2util/hex.h> 64 #include <I2util/conf.h> 65 #include <I2util/addr.h> 66 67 #endif /* _I2_util_h_ */ 68