-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfindall.c
44 lines (34 loc) · 924 Bytes
/
findall.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
void findall(void)
{
int Start;
int End;
int Col;
int Len;
char *Word;
char *Text;
Text = SpfService("query", "line_data");
Col = SpfService("query", "col_number");
Len = SpfService("query", "line_length");
if(Text && Col >= 1 && Col <= Len)
{
while(Col > 1 && StrGetSubstr(Text, Col, 1) != " ")
Col--;
if(StrGetSubstr(Text, Col, 1) == " ")
Col++;
Start = Col;
End = StrFindSubstr(Text, " ", Start);
if(End <= Start)
{
if(Start > 1)
Start--;
End = Len;
}
Len = End - Start + 1;
Word = StrGetSubstr(Text, Start, Len);
StrStripLeading(Word, " ");
StrStripTrailing(Word, " ");
if(Start == 7)
StrStripTrailing(Word, ".");
SpfService("cmd", StrCompose("FIND '", Word, "' ALL"));
}
}