Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5574 → Rev 5575

/programs/cmm/lib/strings.h
39,7 → 39,7
}
*/
 
int strspn(dword text1,text2)
inline int strspn(dword text1,text2)
{
dword beg;
char s1,s2;
64,7 → 64,7
return ret;
}
 
dword strpbrk(dword text1,text2)
inline dword strpbrk(dword text1,text2)
{
char s,ss;
dword beg;
112,8 → 112,15
EAX-=2+ECX;
}
 
inline strnlen(dword str, dword maxlen)
{
dword cp;
for (cp = str; (maxlen != 0) && (DSBYTE[cp] != '\0'); cp++, maxlen--);
return cp - str;
}
 
signed int strcmp(dword text1, text2)
 
inline signed int strcmp(dword text1, text2)
{
char s1,s2;
dword p1,p2;
136,7 → 143,31
return 0;
}
 
/*
signed int strncmp(dword s1, s2, signed n)
unsigned char _s1,_s2;
{
if (n == 0)
return 0;
do {
_s1 = DSBYTE[s1];
_s2 = DSBYTE[s2];
if (_s1 != _s2)
{
$dec s2
return _s1 - _s2;
}
$inc s2
if (_s1 == 0)
break;
$inc s1
$dec n
} while (n);
return 0;
}
*/
 
 
inline fastcall void strcpy( EDI, ESI)
{
$cld
147,7 → 178,7
$jnz L2
}
 
void strncpy(dword text1, text2, signed len)
inline dword strncpy(dword text1, text2, signed len)
signed o1,o2;
{
o1 = len/4;
164,6 → 195,8
$inc text2
$dec o2
}
ESBYTE[text1] = 0;
return text1;
}
 
inline fastcall int strlcpy(dword ESI, EDI, EBX)
198,7 → 231,7
*/
 
byte __isWhite(int s){ if (s==13)||(s==32)||(s==10)||(s==9) return true; return false; }
void strltrim(dword text){
inline void strltrim(dword text){
int s;
dword back_text;
back_text = text;
218,7 → 251,7
};
}
 
void strrtrim(dword text)
inline void strrtrim(dword text)
{
int s;
dword p;
240,7 → 273,7
if(__isWhite(s)) ESBYTE[p] = 0;
}
 
void strtrim(dword text){
inline void strtrim(dword text){
int s;
dword p,back_text;
back_text = text;
578,7 → 611,7
}
*/
dword itoa(signed long number)
inline dword itoa(signed long number)
{
unsigned char buf[11];
dword ret;
653,7 → 686,7
return EBX;
}
 
dword strdup(dword text)
inline dword strdup(dword text)
{
dword l = strlen(text);
dword ret = malloc(l+1);
661,6 → 694,20
return ret;
}
 
inline dword strndup(dword str, signed maxlen)
{
dword copy,len;
 
len = strnlen(str, maxlen);
copy = malloc(len + 1);
if (copy != NULL)
{
memcpy(copy, str, len);
DSBYTE[len+copy] = '\0';
}
return copy;
}
 
void debugi(dword d_int)
{
char tmpch[12];