1 // Larbin 2 // Sebastien Ailleret 3 // 12-01-00 -> 10-12-01 4 5 #ifndef TYPES_H 6 #define TYPES_H 7 8 // Size of the HashSize (max number of urls that can be fetched) 9 #define hashSize 64000000 10 11 // Size of the duplicate hashTable 12 #define dupSize hashSize 13 #define dupFile "dupfile.bak" 14 15 // Size of the arrays of Sites in main memory 16 #define namedSiteListSize 20000 17 #define IPSiteListSize 10000 18 19 // Max number of urls in ram 20 #define ramUrls 100000 21 #define maxIPUrls 80000 // this should allow less dns call 22 23 // Max number of urls per site in Url 24 #define maxUrlsBySite 40 // must fit in uint8_t 25 26 // time out when reading a page (in sec) 27 #define timeoutPage 30 // default time out 28 #define timeoutIncr 2000 // number of bytes for 1 more sec 29 30 // How long do we keep dns answers and robots.txt 31 #define dnsValidTime 2*24*3600 32 33 // Maximum size of a page 34 #define maxPageSize 100000 35 #define nearlyFullPage 90000 36 37 // Maximum size of a robots.txt that is read 38 // the value used is min(maxPageSize, maxRobotsSize) 39 #define maxRobotsSize 10000 40 41 // How many forbidden items do we accept in a robots.txt 42 #define maxRobotsItem 100 43 44 // file name used for storing urls on disk 45 #define fifoFile "fifo" 46 #define fifoFileWait "fifowait" 47 48 // number of urls per file on disk 49 // should be equal to ramUrls for good interaction with restart 50 #define urlByFile ramUrls 51 52 // Size of the buffer used to read sockets 53 #define BUF_SIZE 16384 54 #define STRING_SIZE 1024 55 56 // Max size for a url 57 #define maxUrlSize 512 58 #define maxSiteSize 40 // max size for the name of a site 59 60 // max size for cookies 61 #define maxCookieSize 128 62 63 // Standard size of a fifo in a Site 64 #define StdVectSize maxRobotsItem 65 66 // maximum number of input connections 67 #define maxInput 5 68 69 // if we save files, how many files per directory and where 70 #define filesPerDir 2000 71 #define saveDir "save/" 72 #define indexFile "index.html" // for MIRROR_SAVE 73 #define nbDir 1000 // for MIRROR_SAVE 74 75 // options for SPECIFICSEARCH (except with DEFAULT_SPECIFIC) 76 #define specDir "specific/" 77 #define maxSpecSize 5000000 78 79 // Various reasons of error when getting a page 80 #define nbAnswers 16 81 enum FetchError 82 { 83 success, 84 noDNS, 85 noConnection, 86 forbiddenRobots, 87 timeout, 88 badType, 89 tooBig, 90 err30X, 91 err40X, 92 earlyStop, 93 duplicate, 94 fastRobots, 95 fastNoConn, 96 fastNoDns, 97 tooDeep, 98 urlDup 99 }; 100 101 // standard types 102 typedef unsigned int uint; 103 104 #endif // TYPES_H 105