|
@@ -41,44 +41,44 @@ char* eat_line(char* buffer, unsigned int len);
|
|
|
|
|
|
/* turn the most frequently called functions into inline functions */
|
|
/* turn the most frequently called functions into inline functions */
|
|
|
|
|
|
-inline static char* eat_space_end(char* p, char* pend)
|
|
|
|
|
|
+inline static char* eat_space_end(const char* p, const char* pend)
|
|
{
|
|
{
|
|
for(;(p<pend)&&(*p==' ' || *p=='\t') ;p++);
|
|
for(;(p<pend)&&(*p==' ' || *p=='\t') ;p++);
|
|
- return p;
|
|
|
|
|
|
+ return (char *)p;
|
|
}
|
|
}
|
|
#define SP(_c) ((_c)=='\t' || (_c)==' ')
|
|
#define SP(_c) ((_c)=='\t' || (_c)==' ')
|
|
-inline static char* eat_lws_end(char* p, char* pend)
|
|
|
|
|
|
+inline static char* eat_lws_end(const char* p, const char* pend)
|
|
{
|
|
{
|
|
while(p<pend) {
|
|
while(p<pend) {
|
|
if (SP(*p)) p++;
|
|
if (SP(*p)) p++;
|
|
/* BTW--I really dislike line folding; -jiri */
|
|
/* BTW--I really dislike line folding; -jiri */
|
|
else if (*p=='\n' && p+1<pend && SP(*(p+1))) p+=2;
|
|
else if (*p=='\n' && p+1<pend && SP(*(p+1))) p+=2;
|
|
- else if (*p=='\r' && p+2<pend && *(p+1)=='\n'
|
|
|
|
|
|
+ else if (*p=='\r' && p+2<pend && *(p+1)=='\n'
|
|
&& SP(*(p+2))) p+=3;
|
|
&& SP(*(p+2))) p+=3;
|
|
else break; /* no whitespace encountered */
|
|
else break; /* no whitespace encountered */
|
|
}
|
|
}
|
|
- return p;
|
|
|
|
|
|
+ return (char *)p;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-inline static char* eat_token_end(char* p, char* pend)
|
|
|
|
|
|
+inline static char* eat_token_end(const char* p, const char* pend)
|
|
{
|
|
{
|
|
for (;(p<pend)&&(*p!=' ')&&(*p!='\t')&&(*p!='\n')&&(*p!='\r'); p++);
|
|
for (;(p<pend)&&(*p!=' ')&&(*p!='\t')&&(*p!='\n')&&(*p!='\r'); p++);
|
|
- return p;
|
|
|
|
|
|
+ return (char *)p;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-inline static char* eat_token2_end(char* p, char* pend, char delim)
|
|
|
|
|
|
+inline static char* eat_token2_end(const char* p, const char* pend, char delim)
|
|
{
|
|
{
|
|
for (;(p<pend)&&(*p!=(delim))&&(*p!='\n')&&(*p!='\r'); p++);
|
|
for (;(p<pend)&&(*p!=(delim))&&(*p!='\n')&&(*p!='\r'); p++);
|
|
- return p;
|
|
|
|
|
|
+ return (char *)p;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-inline static int is_empty_end(char* p, char* pend )
|
|
|
|
|
|
+inline static int is_empty_end(const char* p, const char* pend )
|
|
{
|
|
{
|
|
p=eat_space_end(p, pend );
|
|
p=eat_space_end(p, pend );
|
|
return ((p<(pend )) && (*p=='\r' || *p=='\n'));
|
|
return ((p<(pend )) && (*p=='\r' || *p=='\n'));
|