- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathurl.h
More file actions
Latest commit
17 lines (13 loc) · 556 Bytes
/
Copy pathurl.h
File metadata and controls
17 lines (13 loc) · 556 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndefURL_H
#defineURL_H
//see rfc 3986
//percent decode all characters
//Note: because %00 could be in the string, null termination cannot be used
//length of decoded string is saved in len
//returns -1 on error, 0 if %00 does not occur and str can be treated as
//null terminated, 1 if %00 occurs, and string cannot be treated as zstr
intpercent_decode(char*str, int*len);
//checks that path does not contain references to previous directory ex: "../"
//does not contain "//" and does not start with "/"
intsafe_path(constchar*path);
#endif