Rev 8123 | Rev 8185 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8123 | Rev 8149 | ||
---|---|---|---|
Line 46... | Line 46... | ||
46 | int has_digits=0; |
46 | int has_digits=0; |
47 | int unknown_type=unk_delete; |
47 | int unknown_type=unk_delete; |
48 | int nocase=0,leaveline=0,fromfile=0; |
48 | int nocase=0,leaveline=0,fromfile=0; |
49 | char *unknown, unkbuf[1024]; |
49 | char *unknown, unkbuf[1024]; |
50 | 50 | ||
51 | /*void *xmalloc(size_t n) |
- | |
52 | { |
- | |
53 | void *p; |
- | |
54 | p=malloc(n); |
- | |
55 | if(p==NULL) exit(1); |
- | |
56 | return p; |
- | |
57 | } |
- | |
58 | */ |
- | |
59 | /* Exit without translating anything */ |
51 | /* Exit without translating anything */ |
60 | void escape(void) |
52 | void escape(void) |
61 | { |
53 | { |
62 | printf("%s",inpbuf); exit(0); |
54 | printf("%s",inpbuf); exit(0); |
63 | } |
55 | } |
64 | - | ||
65 | /* Points to the end of the word */ |
- | |
66 | /* |
- | |
67 | char *find_word_end(char *p) |
- | |
68 | { |
- | |
69 | int i; |
- | |
70 | for(i=0;!isspace(*p) && *p!=0 && i<MAX_LINELEN; p++,i++); |
- | |
71 | return p; |
- | |
72 | } |
- | |
73 | */ |
- | |
74 | /* Strips leading spaces */ |
- | |
75 | /* |
- | |
76 | char *find_word_start(char *p) |
- | |
77 | { |
- | |
78 | int i; |
- | |
79 | for(i=0; isspace(*p) && i<MAX_LINELEN; p++,i++); |
- | |
80 | return p; |
- | |
81 | } |
- | |
82 | */ |
- | |
83 | 56 | ||
84 | /* strip trailing spaces; return string end. */ |
57 | /* strip trailing spaces; return string end. */ |
85 | char *strip_trailing_spaces2(char *p) |
58 | char *strip_trailing_spaces2(char *p) |
86 | { |
59 | { |
87 | char *pp; |
60 | char *pp; |
Line 98... | Line 71... | ||
98 | if(k==0 && (isalnum(*(s2+entry[i1].olen)) || (*(s2+entry[i1].olen)&128)!=0)) return -1; |
71 | if(k==0 && (isalnum(*(s2+entry[i1].olen)) || (*(s2+entry[i1].olen)&128)!=0)) return -1; |
99 | else return k; |
72 | else return k; |
100 | } |
73 | } |
101 | 74 | ||
102 | /* searches a list. Returns index if found, -1 if nomatch. |
75 | /* searches a list. Returns index if found, -1 if nomatch. |
103 | * Uses binary search, list must be sorted. |
76 | * Uses binary search, list must be sorted. |
- | 77 | */ |
|
104 | int search_list2(struct entry *list, int items, size_t item_size, const char *str) |
78 | int search_list2(struct entry *list, int items, size_t item_size, const char *str) |
105 | { |
79 | { |
106 | int i1,i2,j,k,t,t1; |
80 | int i1,i2,j,k,t,t1; |
107 | unsigned char c; |
81 | unsigned char c; |
108 | 82 |