-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsign.cpp
More file actions
41 lines (40 loc) · 892 Bytes
/
Copy pathsign.cpp
File metadata and controls
41 lines (40 loc) · 892 Bytes
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
#include <string>
#include <string.h>
#include "sign.h"
#include "externs.h"
using namespace std;
void InitSignCharset(const char* signlist[], int signlistsize)
{
int i;
for(i = 0; i < signlistsize; i++)
{
for(int j = 0; signlist[i][j] != '\0'; j++)
signcharset.insert(signlist[i][j]);
}
}
bool InCharSet(char ch)
{
if(signcharset.find(ch) == signcharset.end())
return false;
return true;
}
bool InStrList(const char* strlist[], char* ptr, int strlistsize)
{
int i, j;
for(i = 0; i < strlistsize; i++)
{
if(strcmp(ptr, strlist[i]) == 0)
return true;
}
return false;
}
bool InStrList(const char* strlist[], char* ptr, int len, int strlistsize)
{
int i, j;
for(i = 0; i < strlistsize; i++)
{
if(strncmp(ptr, strlist[i], len) == 0)
return true;
}
return false;
}