2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __NGStreams_NGUrlChars_H__
23 #define __NGStreams_NGUrlChars_H__
25 static inline BOOL isUrlAlpha(unsigned char _c) {
27 (((_c >= 'a') && (_c <= 'z')) ||
28 ((_c >= 'A') && (_c <= 'Z')))
31 static inline BOOL isUrlDigit(unsigned char _c) {
32 return ((_c >= '0') && (_c <= '9')) ? YES : NO;
34 static inline BOOL isUrlSafeChar(unsigned char _c) {
36 case '$': case '-': case '_': case '@':
37 case '.': case '&': case '+':
44 static inline BOOL isUrlExtraChar(unsigned char _c) {
46 case '!': case '*': case '"': case '\'':
52 static inline BOOL isUrlEscapeChar(unsigned char _c) {
53 return (_c == '%') ? YES : NO;
55 static inline BOOL isUrlReservedChar(unsigned char _c) {
57 case '=': case ';': case '/':
58 case '#': case '?': case ':':
65 static inline BOOL isUrlXalpha(unsigned char _c) {
66 if (isUrlAlpha(_c)) return YES;
67 if (isUrlDigit(_c)) return YES;
68 if (isUrlSafeChar(_c)) return YES;
69 if (isUrlExtraChar(_c)) return YES;
70 if (isUrlEscapeChar(_c)) return YES;
74 static inline BOOL isUrlHexChar(unsigned char _c) {
77 if ((_c >= 'a') && (_c <= 'f'))
79 if ((_c >= 'A') && (_c <= 'F'))
84 static inline BOOL isUrlAlphaNum(unsigned char _c) {
85 return (isUrlAlpha(_c) || isUrlDigit(_c)) ? YES : NO;
88 #endif /* __NGStreams_NGUrlChars_H__ */