diff options
Diffstat (limited to 'WWW/Library/Implementation/HTParse.c')
-rw-r--r-- | WWW/Library/Implementation/HTParse.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/WWW/Library/Implementation/HTParse.c b/WWW/Library/Implementation/HTParse.c index c7255995..b5112341 100644 --- a/WWW/Library/Implementation/HTParse.c +++ b/WWW/Library/Implementation/HTParse.c @@ -19,7 +19,7 @@ struct struct_parts { }; -/* Strip white space off a string. HTStrip() +/* Strip white space off a string. HTStrip() ** ------------------------------- ** ** On exit, @@ -27,7 +27,7 @@ struct struct_parts { ** All trailing white space is OVERWRITTEN with zero. */ PUBLIC char * HTStrip ARGS1( - char *, s) + char *, s) { #define SPACE(c) ((c == ' ') || (c == '\t') || (c == '\n')) char * p = s; @@ -55,7 +55,7 @@ PUBLIC char * HTStrip ARGS1( ** Any which are nonzero point to zero terminated strings. */ PRIVATE void scan ARGS2( - char *, name, + char *, name, struct struct_parts *, parts) { char * after_access; @@ -178,7 +178,7 @@ PRIVATE void scan ARGS2( ** wanted A mask for the bits which are wanted. ** ** On exit, -** returns A pointer to a calloc'd string which MUST BE FREED +** returns A pointer to a calloc'd string which MUST BE FREED */ PUBLIC char * HTParse ARGS3( CONST char *, aName, @@ -208,7 +208,7 @@ PUBLIC char * HTParse ARGS3( ** Allocate the output string. */ len = strlen(aName) + strlen(relatedName) + 10; - result = (char *)calloc(1, len); /* Lots of space: more than enough */ + result = typecallocn(char, len); /* Lots of space: more than enough */ if (result == NULL) { outofmem(__FILE__, "HTParse"); } @@ -484,7 +484,7 @@ PUBLIC char * HTParse ARGS3( ** or ../../albert.html */ PUBLIC void HTSimplify ARGS1( - char *, filename) + char *, filename) { char *p; char *q, *q1; @@ -682,7 +682,7 @@ PUBLIC char * HTRelative ARGS2( for (; *q && (*q != '#'); q++) if (*q == '/') levels++; - result = (char *)calloc(1, (3*levels + strlen(last_slash) + 1)); + result = typecallocn(char, 3*levels + strlen(last_slash) + 1); if (result == NULL) outofmem(__FILE__, "HTRelative"); result[0] = '\0'; @@ -691,7 +691,7 @@ PUBLIC char * HTRelative ARGS2( strcat(result, last_slash+1); } CTRACE((tfp, - "HTparse: `%s' expressed relative to\n `%s' is\n `%s'.\n", + "HTparse: `%s' expressed relative to\n `%s' is\n `%s'.\n", aName, relatedName, result)); return result; } @@ -709,7 +709,7 @@ PUBLIC char * HTRelative ARGS2( PRIVATE CONST unsigned char isAcceptable[96] = /* Bit 0 xalpha -- see HTFile.h -** Bit 1 xpalpha -- as xalpha but with plus. +** Bit 1 xpalpha -- as xalpha but with plus. ** Bit 3 ... path -- as xpalphas but with / */ /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ @@ -734,7 +734,7 @@ PUBLIC char * HTEscape ARGS2( for (p = str; *p; p++) if (!ACCEPTABLE(UCH(TOASCII(*p)))) unacceptable++; - result = (char *)calloc(1, (p-str + unacceptable + unacceptable + 1)); + result = typecallocn(char, p-str + unacceptable + unacceptable + 1); if (result == NULL) outofmem(__FILE__, "HTEscape"); for (q = result, p = str; *p; p++) { @@ -772,7 +772,7 @@ PUBLIC char * HTEscapeSP ARGS2( for (p = str; *p; p++) if (!(*p == ' ' || ACCEPTABLE(UCH(TOASCII(*p))))) unacceptable++; - result = (char *)calloc(1, (p-str + unacceptable + unacceptable + 1)); + result = typecallocn(char, p-str + unacceptable + unacceptable + 1); if (result == NULL) outofmem(__FILE__, "HTEscape"); for (q = result, p = str; *p; p++) { @@ -808,7 +808,7 @@ PRIVATE char from_hex ARGS1( } PUBLIC char * HTUnEscape ARGS1( - char *, str) + char *, str) { char * p = str; char * q = str; @@ -856,7 +856,7 @@ PUBLIC char * HTUnEscape ARGS1( ** The first string is converted in place, as it will never grow. */ PUBLIC char * HTUnEscapeSome ARGS2( - char *, str, + char *, str, CONST char *, do_trans) { char * p = str; @@ -889,7 +889,7 @@ PUBLIC char * HTUnEscapeSome ARGS2( PRIVATE CONST unsigned char crfc[96] = /* Bit 0 xalpha -- need "quoting" -** Bit 1 xpalpha -- need \escape if quoted +** Bit 1 xpalpha -- need \escape if quoted */ /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ { 1,0,3,0,0,0,0,0,1,1,0,0,1,0,1,0, /* 2x !"#$%&'()*+,-./ */ @@ -930,7 +930,7 @@ PUBLIC void HTMake822Word ARGS1( } if (!added) return; - result = (char *)calloc(1, (p-(*str) + added + 1)); + result = typecallocn(char, p-(*str) + added + 1); if (result == NULL) outofmem(__FILE__, "HTMake822Word"); result[0] = '"'; |