Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
7873 | rgimad | 1 | |
2 | #define NULL ((void*)0) |
||
3 | #endif |
||
4 | |||
5 | |||
6 | { |
||
7 | unsigned i; |
||
8 | for ( i = 0; i < size; i++ ) |
||
9 | *((char *)mem+i) = (char) c; |
||
10 | return NULL; |
||
11 | } |
||
12 | |||
13 | |||
14 | |||
15 | { |
||
16 | unsigned i; |
||
17 | for ( i = 0; i < size; i++) |
||
18 | *(char *)(dst+i) = *(char *)(src+i); |
||
19 | return NULL; |
||
20 | } |
||
21 | |||
22 | |||
23 | |||
24 | { |
||
25 | int i; |
||
26 | for (i=0;i |
||
27 | { |
||
28 | if (*(unsigned char*)buf1<*(unsigned char*)buf2) |
||
29 | return -1; |
||
30 | if (*(unsigned char*)buf1>*(unsigned char*)buf2) |
||
31 | return 1; |
||
32 | } |
||
33 | return 0; |
||
34 | } |
||
35 | |||
36 | |||
37 | { |
||
38 | int i, j; |
||
39 | i = j = 0; |
||
40 | while (strDest[i] != '\0') i++; |
||
41 | while ((strDest[i++] = strSource[j++]) != '\0'); |
||
42 | return strDest; |
||
43 | } |
||
44 | |||
45 | |||
46 | |||
47 | { |
||
48 | |||
49 | |||
50 | { |
||
51 | if (*string1<*string2) |
||
52 | return -1; |
||
53 | if (*string1>*string2) |
||
54 | return 1; |
||
55 | if (*string1=='\0') |
||
56 | return 0; |
||
57 | string1++; |
||
58 | string2++; |
||
59 | } |
||
60 | }*/ |
||
61 | |||
62 | |||
63 | { |
||
64 | while(*s1 && (*s1==*s2)) |
||
65 | s1++,s2++; |
||
66 | return *(const unsigned char*)s1-*(const unsigned char*)s2; |
||
67 | } |
||
68 | |||
69 | |||
70 | { |
||
71 | unsigned i; |
||
72 | i = 0; |
||
73 | while ((strDest[i] = strSource[i]) != '\0') i++; |
||
74 | return strDest; |
||
75 | } |
||
76 | |||
77 | |||
78 | |||
79 | { |
||
80 | unsigned i; |
||
81 | if (! n ) |
||
82 | return strDest; |
||
83 | i = 0; |
||
84 | while ((strDest[i] = strSource[i]) != '\0') |
||
85 | if ( (n-1) == i ) |
||
86 | break; |
||
87 | else |
||
88 | i++; |
||
89 | return strDest; |
||
90 | } |
||
91 | |||
92 | |||
93 | |||
94 | { |
||
95 | int i; |
||
96 | i=0; |
||
97 | while (*string++) i++; |
||
98 | return i; |
||
99 | } |
||
100 | |||
101 | |||
102 | |||
103 | |||
104 | { |
||
105 | while (*string) |
||
106 | { |
||
107 | if (*string==c) |
||
108 | return (char*)string; |
||
109 | string++; |
||
110 | } |
||
111 | return (char*)0; |
||
112 | } |
||
113 | |||
114 | |||
115 | |||
116 | { |
||
117 | char* last_found; |
||
118 | while (*string) |
||
119 | { |
||
120 | if (*string==c) |
||
121 | { |
||
122 | last_found = (char*)string; |
||
123 | } |
||
124 | string++; |
||
125 | } |
||
126 | return last_found; |
||
127 | } |
||
128 | |||
129 | |||
130 | |||
131 | |||
132 | { |
||
133 | int a, b, c, d; |
||
134 | a = (i - i%1000)/1000; |
||
135 | b = (i - i%100)/100 - a*10; |
||
136 | c = (i - i%10)/10 - a*100 - b*10; |
||
137 | d = i%10; |
||
138 | s[0] = a + '0'; |
||
139 | s[1] = b + '0'; |
||
140 | s[2] = c + '0'; |
||
141 | s[3] = d + '0'; |
||
142 | s[4] = 0; |
||
143 | } |
||
144 | |||
145 | |||
146 | |||
147 | void reverse(char s[]) |
||
148 | { |
||
149 | int i, j; |
||
150 | char c; |
||
151 | |||
152 | |||
153 | c = s[i]; |
||
154 | s[i] = s[j]; |
||
155 | s[j] = c; |
||
156 | } |
||
157 | } |
||
158 | |||
159 | |||
160 | |||
161 | void itoa(int n, char s[]) |
||
162 | { |
||
163 | int i, sign; |
||
164 | |||
165 | |||
166 | n = -n; |
||
167 | i = 0; |
||
168 | do { |
||
169 | s[i++] = n % 10 + '0'; |
||
170 | } while ((n /= 10) > 0); |
||
171 | if (sign < 0) |
||
172 | s[i++] = '-'; |
||
173 | s[i] = '\0'; |
||
174 | reverse(s); |
||
175 | } |
||
176 | |||
177 | |||
178 | |||
179 | |||
180 | { |
||
181 | int i, n; |
||
182 | |||
183 | |||
184 | for ( i = 0; s[i]!= '\0'; ++i) |
||
185 | if ((s[i]<'0') || (s[i]>'9')) |
||
186 | return 0; |
||
187 | else |
||
188 | n = 10 * n + s[i] - '0'; |
||
189 | |||
190 | |||
191 | }'0')>>>*string2) |
||
192 | >*(unsigned> |
||
193 | |||
194 |