123 |
*/ |
*/ |
124 |
|
|
125 |
|
|
|
/* ------------------------------------------------------------- Definitions */ |
|
|
|
|
|
|
|
|
/** Defines supported url protocol structure */ |
|
|
typedef struct myurlprotocol { |
|
|
int id; |
|
|
char *pattern; |
|
|
char *protocol; |
|
|
int port; |
|
|
} UrlProtocol_T; |
|
|
|
|
|
|
|
|
/** Defines supported url protocol names and defaults */ |
|
|
UrlProtocol_T protocol[]= { |
|
|
{PROTOCOL_HTTP, "http://", "http", PORT_HTTP }, |
|
|
{PROTOCOL_HTTPS, "https://", "https", PORT_HTTPS }, |
|
|
{PROTOCOL_NULL, NULL, NULL, 0 } |
|
|
}; |
|
|
|
|
|
|
|
126 |
/* ------------------------------------------------------------------ Public */ |
/* ------------------------------------------------------------------ Public */ |
127 |
|
|
128 |
|
|
194 |
ASSERT(s); |
ASSERT(s); |
195 |
|
|
196 |
while(*t==' ' || *t=='\t' || *t=='\r' || *t=='\n') t++; |
while(*t==' ' || *t=='\t' || *t=='\r' || *t=='\n') t++; |
197 |
|
if(t!=s) { |
198 |
return strcpy(s, t); |
memmove(s, t, t-s); |
199 |
|
s[t-s]= 0; |
200 |
|
} |
201 |
|
|
202 |
|
return s; |
203 |
|
|
204 |
} |
} |
205 |
|
|
216 |
ASSERT(s); |
ASSERT(s); |
217 |
|
|
218 |
while(*s) s++; |
while(*s) s++; |
219 |
while(*--s==' ' || *s=='\t' || *s=='\r' || *s=='\n') *s= '\0'; |
while(*--s==' ' || *s=='\t' || *s=='\r' || *s=='\n') *s= 0; |
220 |
|
|
221 |
return t; |
return t; |
222 |
|
|