Subversion Repositories Kolibri OS

Rev

Rev 5573 | Rev 5575 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5573 Rev 5574
Line 1... Line 1...
1
//------------------------------------------------------------------------------
1
//------------------------------------------------------------------------------
-
 
2
// strspn(dword text1,text2) --- example: strspn("12 year","1234567890") -> return 2
-
 
3
// strpbrk(dword text1,text2) --- example: strpbrk("this test", " ckfi") -> return "is test"
2
// strcmp( ESI, EDI)
4
// strcmp( ESI, EDI)
3
// strlen( EDI)
5
// strlen( EDI)
4
// strcpy( EDI, ESI) --- 0 if ==
6
// strcpy( EDI, ESI) --- 0 if ==
5
// strncpy(dword text1,text2,signed length)
7
// strncpy(dword text1,text2,signed length)
6
// strcat( EDI, ESI)
8
// strcat( EDI, ESI)
Line 35... Line 37...
35
        EDI++;
37
        EDI++;
36
    }
38
    }
37
}
39
}
38
*/
40
*/
Line -... Line 41...
-
 
41
 
-
 
42
int strspn(dword text1,text2)
-
 
43
{
-
 
44
	dword beg;
-
 
45
	char s1,s2;
-
 
46
	int ret;
-
 
47
	ret = 0;
-
 
48
	beg = text2;
-
 
49
	do {
-
 
50
		s1 = ESBYTE[text1];
-
 
51
		text2 = beg;
-
 
52
		do {
-
 
53
			s2 = ESBYTE[text2];
-
 
54
			if(s1==s2)
-
 
55
			{
-
 
56
				if(!s2)break;
-
 
57
				$inc ret
-
 
58
				break;
-
 
59
			}
-
 
60
			else $inc text2
-
 
61
		} while(s2);
-
 
62
		$inc text1
-
 
63
	} while(s1);
-
 
64
	return ret;
-
 
65
}
-
 
66
 
-
 
67
dword strpbrk(dword text1,text2)
-
 
68
{
-
 
69
	char s,ss;
-
 
70
	dword beg;
-
 
71
	beg = text2;
-
 
72
	do {
-
 
73
		s = ESBYTE[text1];
-
 
74
		text2 = beg;
-
 
75
		do {
-
 
76
			ss = ESBYTE[text2];
-
 
77
			if(ss==s) return text1;
-
 
78
			$inc text2
-
 
79
		} while(ss);
-
 
80
		$inc text1
-
 
81
	} while(s);
-
 
82
	return text1;
Line 39... Line 83...
39
 
83
}
40
 
84
 
41
inline fastcall signed int strncmp( ESI, EDI, ECX)
85
inline fastcall signed int strncmp( ESI, EDI, ECX)
42
{
86
{
Line 82... Line 126...
82
		if(s1==s2)
126
		if(s1==s2)
83
		{
127
		{
84
			if(s1==0) return 0;
128
			if(s1==0) return 0;
85
		}
129
		}
86
		else {
130
		else {
87
			
-
 
88
			return -1;
131
			return s1-s2;
89
		}
132
		}
90
		$inc text1 
133
		$inc text1 
91
		$inc text2
134
		$inc text2
92
	}
135
	}
93
	return 0;
136
	return 0;