1 // ssdeep 2 // Copyright (C) 2012 Kyrus 3 // 4 // $Id$ 5 // 6 // This program is free software; you can redistribute it and/or modify 7 // it under the terms of the GNU General Public License as published by 8 // the Free Software Foundation; either version 2 of the License, or 9 // (at your option) any later version. 10 // 11 // This program is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 // 16 // You should have received a copy of the GNU General Public License 17 // along with this program; if not, write to the Free Software 18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 20 #ifndef __MAIN_H 21 #define __MAIN_H 22 23 #ifdef HAVE_CONFIG_H 24 # include "config.h" 25 #endif 26 27 #include <stdio.h> 28 #include <stdlib.h> 29 #include <string.h> 30 #include <errno.h> 31 #include <limits.h> 32 #include <sys/stat.h> 33 #include <unistd.h> 34 #include <ctype.h> 35 #include <inttypes.h> 36 37 #ifdef HAVE_DIRENT_H 38 # include <dirent.h> 39 #endif 40 41 #ifdef TIME_WITH_SYS_TIME 42 # include <sys/time.h> 43 # include <time.h> 44 #else 45 # ifdef HAVE_SYS_TIME_H 46 # include <sys/time.h> 47 # else 48 # include <time.h> 49 # endif 50 #endif 51 52 #ifdef HAVE_SYS_TYPES_H 53 # include <sys/types.h> 54 #endif 55 56 #ifdef HAVE_SYS_PARAM_H 57 # include <sys/param.h> 58 #endif 59 60 #ifdef HAVE_SYS_STAT_H 61 # include <sys/stat.h> 62 #endif 63 64 #ifdef HAVE_SYS_IOCTL_H 65 # include <sys/ioctl.h> 66 #endif 67 68 #ifdef HAVE_SYS_MOUNT_H 69 # include <sys/mount.h> 70 #endif 71 72 #ifdef HAVE_SYS_DISK_H 73 # include <sys/disk.h> 74 #endif 75 76 #ifdef HAVE_LIBGEN_H 77 # include <libgen.h> 78 #endif 79 80 81 // This allows us to open standard input in binary mode by default 82 // See http://gnuwin32.sourceforge.net/compile.html for more. 83 // Technically it isn't needed in ssdeep as we don't process standard 84 // input. But it was part of Jesse's template, so in it goes! 85 #ifdef HAVE_FCNTL_H 86 # include <fcntl.h> 87 #endif 88 89 90 #define FALSE 0 91 #define TRUE 1 92 93 #ifndef MIN 94 #define MIN(a,b) ((a)<(b)?(a):(b)) 95 #endif 96 97 #ifndef MAX 98 #define MAX(a,b) ((a)>(b)?(a):(b)) 99 #endif 100 101 102 103 #endif // #ifndef __MAIN_H 104