36 |
#include "locatestring.h" |
#include "locatestring.h" |
37 |
|
|
38 |
/* |
/* |
39 |
|
|
40 |
|
String locator: usage and memory status |
41 |
|
|
42 |
|
'v': result pointer |
43 |
|
|
44 |
|
string = "ABC XYZ XYZ ABC" |
45 |
|
|
46 |
|
pointer = locatestring(string, "XYZ", MATCH_FIRST); |
47 |
|
v |
48 |
|
"ABC XYZ XYZ ABC" |
49 |
|
|
50 |
|
pointer = locatestring(string, "XYZ", MATCH_LAST); |
51 |
|
v |
52 |
|
"ABC XYZ XYZ ABC" |
53 |
|
|
54 |
|
pointer = locatestring(string, "XYZ", MATCH_AT_FIRST); |
55 |
|
|
56 |
|
"ABC XYZ XYZ ABC" (nothing pointed) |
57 |
|
|
58 |
|
pointer = locatestring(string, "ABC", MATCH_AT_FIRST); |
59 |
|
v |
60 |
|
"ABC XYZ XYZ ABC" (point the following character) |
61 |
|
|
62 |
|
pointer = locatestring(string, "ABC", MATCH_AT_LAST); |
63 |
|
v |
64 |
|
"ABC XYZ XYZ ABC" |
65 |
|
|
66 |
|
pointer = locatestring(string, "ABC XYZ XYZ ABC", MATCH_COMPLETE); |
67 |
|
v |
68 |
|
"ABC XYZ XYZ ABC" |
69 |
|
|
70 |
|
pointer = locatestring(string, "xyZ", MATCH_FIRST|IGNORE_CASE); |
71 |
|
v |
72 |
|
"ABC XYZ XYZ ABC" |
73 |
|
|
74 |
|
*/ |
75 |
|
|
76 |
|
/* |
77 |
* strincmp: strncmp with ignoring case. |
* strincmp: strncmp with ignoring case. |
78 |
* |
* |
79 |
* Interface is same with strncmp. |
* Interface is same with strncmp. |