Annotation of libwww/Library/src/HTString.html, revision 2.13
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: /*
11: ** (c) COPYRIGHT CERN 1994.
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"
21: HREF="http://info.cern.ch/hypertext/WWW/Library/User/Guide/Guide.html">Library
22: of Common Code</A>. <P>
23:
2.8 frystyk 24: <PRE>
25: #ifndef HTSTRING_H
2.1 timbl 26: #define HTSTRING_H
27:
28:
29: extern CONST char * HTLibraryVersion; /* String for help screen etc */
2.9 frystyk 30: </PRE>
31:
32: <H2>Dynamic String Manipulation</H2>
33:
34: These two functions are dynamic versions of <CODE>strcpy</CODE> and
35: <CODE>strcat</CODE>. They use <CODE>malloc</CODE> for allocating space
36: for the string. If <CODE>StrAllocCopy</CODE> is called with a non-NULL
37: dest, then this is freed before the new value is assigned so that only
38: the <EM>last</EM> string created has to be freed by the user. If
39: <CODE>StrAllocCat</CODE> is called with a NULL pointer as destination
40: then it is equivalent to <CODE>StrAllocCopy</CODE>.
2.1 timbl 41:
2.9 frystyk 42: <PRE>
43: #define StrAllocCopy(dest, src) HTSACopy (&(dest), src)
44: #define StrAllocCat(dest, src) HTSACat (&(dest), src)
45: extern char * HTSACopy PARAMS ((char **dest, CONST char *src));
46: extern char * HTSACat PARAMS ((char **dest, CONST char *src));
2.6 timbl 47: </PRE>
2.1 timbl 48:
2.9 frystyk 49: <H2>Case-insensitive String Comparison</H2>
50:
51: The usual routines (comp instead of cmp) had some problem.
2.7 luotonen 52:
53: <PRE>
2.9 frystyk 54: extern int strcasecomp PARAMS((CONST char *a, CONST char *b));
55: extern int strncasecomp PARAMS((CONST char *a, CONST char *b, int n));
2.7 luotonen 56: </PRE>
57:
2.9 frystyk 58: <H2>Case-insensitive strstr</H2>
2.7 luotonen 59:
2.9 frystyk 60: This works like <CODE>strstr()</CODE> but is not case-sensitive.
2.1 timbl 61:
2.9 frystyk 62: <PRE>
2.10 frystyk 63: extern char * strcasestr PARAMS((char * s1, char * s2));
2.6 timbl 64: </PRE>
2.9 frystyk 65:
2.6 timbl 66: <H2>Next word or quoted string</H2>
2.9 frystyk 67: <PRE>
68: extern char * HTNextField PARAMS ((char** pstr));
69: #endif
70: </PRE>
2.1 timbl 71:
2.6 timbl 72: </BODY>
2.9 frystyk 73: </HTML>
Webmaster