Annotation of libwww/Library/src/HTString.html, revision 2.10
2.6 timbl 1: <HEADER>
2: <TITLE>String handling for libwww</TITLE></HEADER>
3: <BODY>
2.9 frystyk 4:
5: <H1>String Management</H1>
6:
7: These functions provide functionality for case-independent string
8: comparison and allocations with copies etc. <P>
9:
10: This module is implemented by <A HREF="HTString.c">HTString.c</A>, and
11: it is a part of the <A NAME="z10"
12: HREF="http://info.cern.ch/hypertext/WWW/Library/User/Guide/Guide.html">Library
13: of Common Code</A>. <P>
14:
2.8 frystyk 15: <PRE>
16: #ifndef HTSTRING_H
2.1 timbl 17: #define HTSTRING_H
18:
19: #include "HTUtils.h"
20:
21: extern CONST char * HTLibraryVersion; /* String for help screen etc */
2.9 frystyk 22: </PRE>
23:
24: <H2>Dynamic String Manipulation</H2>
25:
26: These two functions are dynamic versions of <CODE>strcpy</CODE> and
27: <CODE>strcat</CODE>. They use <CODE>malloc</CODE> for allocating space
28: for the string. If <CODE>StrAllocCopy</CODE> is called with a non-NULL
29: dest, then this is freed before the new value is assigned so that only
30: the <EM>last</EM> string created has to be freed by the user. If
31: <CODE>StrAllocCat</CODE> is called with a NULL pointer as destination
32: then it is equivalent to <CODE>StrAllocCopy</CODE>.
2.1 timbl 33:
2.9 frystyk 34: <PRE>
35: #define StrAllocCopy(dest, src) HTSACopy (&(dest), src)
36: #define StrAllocCat(dest, src) HTSACat (&(dest), src)
37: extern char * HTSACopy PARAMS ((char **dest, CONST char *src));
38: extern char * HTSACat PARAMS ((char **dest, CONST char *src));
2.6 timbl 39: </PRE>
2.1 timbl 40:
2.9 frystyk 41: <H2>Case-insensitive String Comparison</H2>
42:
43: The usual routines (comp instead of cmp) had some problem.
2.7 luotonen 44:
45: <PRE>
2.9 frystyk 46: extern int strcasecomp PARAMS((CONST char *a, CONST char *b));
47: extern int strncasecomp PARAMS((CONST char *a, CONST char *b, int n));
2.7 luotonen 48: </PRE>
49:
2.9 frystyk 50: <H2>Case-insensitive strstr</H2>
2.7 luotonen 51:
2.9 frystyk 52: This works like <CODE>strstr()</CODE> but is not case-sensitive.
2.1 timbl 53:
2.9 frystyk 54: <PRE>
2.10 ! frystyk 55: extern char * strcasestr PARAMS((char * s1, char * s2));
2.6 timbl 56: </PRE>
2.9 frystyk 57:
2.6 timbl 58: <H2>Next word or quoted string</H2>
2.9 frystyk 59: <PRE>
60: extern char * HTNextField PARAMS ((char** pstr));
61: #endif
62: </PRE>
2.1 timbl 63:
2.6 timbl 64: </BODY>
2.9 frystyk 65: </HTML>
Webmaster