1 // Larbin 2 // Sebastien Ailleret 3 // 18-11-99 -> 21-05-01 4 5 #ifndef TEXT_H 6 #define TEXT_H 7 8 #include "utils/mystring.h" 9 10 /* lowercase a char */ 11 char lowerCase (char a); 12 13 /* tests if b starts with a */ 14 bool startWith (char *a, char *b); 15 16 /* test if b is forbidden by pattern a */ 17 bool robotsMatch (char *a, char *b); 18 19 /* tests if b starts with a ignoring case */ 20 bool startWithIgnoreCase (char *a, char *b); 21 22 /* test if b end with a */ 23 bool endWith (char *a, char *b); 24 25 /* test if b end with a ignoring case 26 * a can use min char, '.' (a[i] = a[i] | 32) 27 */ 28 bool endWithIgnoreCase (char *amin, char *b, int lb); 29 30 /* tests if b contains a */ 31 bool caseContain (char *a, char *b); 32 33 /* create a copy of a string */ 34 char *newString (char *arg); 35 36 /* Read a whole file 37 */ 38 char *readfile (int fds); 39 40 /* find the next token in the robots.txt, or in config file 41 * must delete comments 42 * no allocation (cf strtok); content is changed 43 * param c is a bad hack for using the same function for robots and configfile 44 */ 45 char *nextToken(char **posParse, char c=' '); 46 47 /* does this char * match privilegedExt */ 48 bool matchPrivExt(char *file); 49 50 /* does this char * match contentType */ 51 bool matchContentType(char *ct); 52 53 #endif // TEXT_H 54