Subversion Repositories Kolibri OS

Rev

Rev 3245 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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