Subversion Repositories Kolibri OS

Rev

Rev 4001 | 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
	{
6825 siemargl 58
	if (*string1<*string2)
59
		return -1;
60
	if (*string1>*string2)
61
		return 1;
62
1665 Nasarus 63
 
6825 siemargl 64
		return 0;
65
1665 Nasarus 66
 
6825 siemargl 67
	string2++;
68
	}
69
70
 
1665 Nasarus 71
72
 
6825 siemargl 73
{
74
int pc = 0;
75
while (1)
76
	{
77
	if (toupper(*string1)
78
		return -1;
79
	if (toupper(*string1)>toupper(*string2))
80
		return 1;
81
82
 
83
		return 0;
84
85
 
86
	string2++;
87
	pc++;
88
	}
89
}
1665 Nasarus 90
91
 
92
{
93
unsigned i;
94
95
 
96
while ((strDest[i] = strSource[i]) != '\0')
97
	i++;
98
99
 
100
101
 
102
 
103
{
104
unsigned i;
105
106
 
107
	return strDest;
108
109
 
110
while ((strDest[i] = strSource[i]) != '\0')
111
	if ( (n-1) == i )
112
		break;
113
	else
114
		i++;
115
116
 
117
}
118
119
 
120
 
121
{
122
int i;
123
124
 
125
while (*string++) i++;
126
return i;
127
}
128
129
 
130
 
131
 
132
{
133
	while (*string)
134
	{
135
		if (*string==c)
136
			return (char*)string;
137
		string++;
138
	}
139
	return (char*)0;
140
}
141
142
 
2502 Albom 143
 
3988 leency 144
{
145
	char* last_found;
4001 leency 146
	while (*string)
3988 leency 147
	{
148
		if (*string==c)
149
		{
150
			last_found = (char*)string;
4001 leency 151
		}
3988 leency 152
		string++;
153
	}
154
	return last_found;
4001 leency 155
}
3988 leency 156
2502 Albom 157
 
3988 leency 158
 
159
 
2502 Albom 160
{
161
int a, b, c, d;
162
a = (i - i%1000)/1000;
163
b = (i - i%100)/100 - a*10;
164
c = (i - i%10)/10 - a*100 - b*10;
165
d = i%10;
166
s[0] = a + '0';
167
s[1] = b + '0';
168
s[2] = c + '0';
169
s[3] = d + '0';
170
s[4] = 0;
171
}
172
173
 
2735 Albom 174
 
175
 void reverse(char s[])
176
 {
177
     int i, j;
178
     char c;
179
180
 
181
         c = s[i];
182
         s[i] = s[j];
183
         s[j] = c;
184
     }
185
 }
186
187
 
188
 
189
 void itoa(int n, char s[])
190
 {
191
     int i, sign;
192
193
 
3245 Albom 194
         n = -n;
195
     i = 0;
2735 Albom 196
     do {
3245 Albom 197
         s[i++] = n % 10 + '0';
198
     } while ((n /= 10) > 0);
199
     if (sign < 0)
2735 Albom 200
         s[i++] = '-';
201
     s[i] = '\0';
202
     reverse(s);
203
 }
204
205
 
3245 Albom 206
 
207
 
208
{
209
int i, n;
210
211
 
212
for ( i = 0; s[i]!= '\0'; ++i)
213
	if ((s[i]<'0') || (s[i]>'9'))
214
		return 0;
215
	else
216
		n = 10 * n + s[i] - '0';
217
218
 
219
}
220
>