Annotation of libwww/Library/src/HTString.html, revision 2.18
2.11 frystyk 1: <HTML>
2: <HEAD>
3: <TITLE>String handling for libwww</TITLE>
4: </HEAD>
2.6 timbl 5: <BODY>
2.9 frystyk 6:
7: <H1>String Management</H1>
2.11 frystyk 8:
9: <PRE>
10: /*
2.15 frystyk 11: ** (c) COPYRIGHT MIT 1995.
2.11 frystyk 12: ** Please first read the full copyright statement in the file COPYRIGH.
13: */
14: </PRE>
2.9 frystyk 15:
16: These functions provide functionality for case-independent string
17: comparison and allocations with copies etc. <P>
18:
19: This module is implemented by <A HREF="HTString.c">HTString.c</A>, and
20: it is a part of the <A NAME="z10"
2.18 ! frystyk 21: HREF="http://www.w3.org/hypertext/WWW/Library/">
! 22: W3C Reference Library</A>. <P>
2.9 frystyk 23:
2.8 frystyk 24: <PRE>
25: #ifndef HTSTRING_H
2.1 timbl 26: #define HTSTRING_H
27:
28: extern CONST char * HTLibraryVersion; /* String for help screen etc */
2.9 frystyk 29: </PRE>
30:
2.17 frystyk 31: <H2><A NAME="dyn">Dynamic String Manipulation</A></H2>
2.9 frystyk 32:
33: These two functions are dynamic versions of <CODE>strcpy</CODE> and
34: <CODE>strcat</CODE>. They use <CODE>malloc</CODE> for allocating space
35: for the string. If <CODE>StrAllocCopy</CODE> is called with a non-NULL
36: dest, then this is freed before the new value is assigned so that only
37: the <EM>last</EM> string created has to be freed by the user. If
38: <CODE>StrAllocCat</CODE> is called with a NULL pointer as destination
39: then it is equivalent to <CODE>StrAllocCopy</CODE>.
2.1 timbl 40:
2.9 frystyk 41: <PRE>
42: #define StrAllocCopy(dest, src) HTSACopy (&(dest), src)
43: #define StrAllocCat(dest, src) HTSACat (&(dest), src)
44: extern char * HTSACopy PARAMS ((char **dest, CONST char *src));
45: extern char * HTSACat PARAMS ((char **dest, CONST char *src));
2.6 timbl 46: </PRE>
2.1 timbl 47:
2.17 frystyk 48: <H2><A NAME="utils">Case-insensitive String Comparison</A></H2>
2.9 frystyk 49:
50: The usual routines (comp instead of cmp) had some problem.
2.7 luotonen 51:
52: <PRE>
2.9 frystyk 53: extern int strcasecomp PARAMS((CONST char *a, CONST char *b));
54: extern int strncasecomp PARAMS((CONST char *a, CONST char *b, int n));
2.7 luotonen 55: </PRE>
56:
2.9 frystyk 57: <H2>Case-insensitive strstr</H2>
2.7 luotonen 58:
2.9 frystyk 59: This works like <CODE>strstr()</CODE> but is not case-sensitive.
2.1 timbl 60:
2.9 frystyk 61: <PRE>
2.10 frystyk 62: extern char * strcasestr PARAMS((char * s1, char * s2));
2.17 frystyk 63: </PRE>
64:
65: <H2>Strip white space off a string</H2>
66:
67: Return value points to first non-white character, or to '/0' if
68: none. All trailing white space is OVERWRITTEN with zero.
69:
70: <PRE>
71: extern char * HTStrip PARAMS((char * s));
2.6 timbl 72: </PRE>
2.9 frystyk 73:
2.6 timbl 74: <H2>Next word or quoted string</H2>
2.14 frystyk 75:
76: This function returns a RFC822 word separated by space, comma, or
77: semi-colons.
78:
2.9 frystyk 79: <PRE>
80: extern char * HTNextField PARAMS ((char** pstr));
2.14 frystyk 81: </PRE>
82:
83: <H2>RFC1123 Date/Time Stamp String</H2>
84:
85: Returns a pointer to a static area!
86:
87: <PRE>
88: extern CONST char *HTDateTimeStr PARAMS((time_t *calendar, BOOL local));
89: </PRE>
90:
91:
92: <H2>Timezone Offset</H2>
93:
94: Calculates the offset from GMT in seconds. This is called from <A
95: HREF="HTAccess.html#Library">HTLibInit()</A>.
96:
97: <PRE>
98: extern long HTGetTimeZoneOffset NOPARAMS;
99: </PRE>
100:
101: <H2>Parse a Date/Time String</H2>
102:
103: Converts a string representation in GMT to a local representation of
104: localtime <CODE>time_t</CODE>.
105:
106: <PRE>
107: extern time_t HTParseTime PARAMS((CONST char * str));
108: </PRE>
109:
110:
111: <H2>Unique Message-ID String</H2>
112:
113: <PRE>
114: extern CONST char *HTMessageIdStr NOPARAMS;
2.9 frystyk 115: #endif
116: </PRE>
2.14 frystyk 117:
118: End of declaration module
2.1 timbl 119:
2.6 timbl 120: </BODY>
2.9 frystyk 121: </HTML>
Webmaster