Annotation of libwww/Library/src/HTString.html, revision 2.12

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: 
2.12    ! roeber     28: #include "sysdep.h"
2.1       timbl      29: #include "HTUtils.h"
                     30: 
                     31: extern CONST char * HTLibraryVersion;  /* String for help screen etc */
2.9       frystyk    32: </PRE>
                     33: 
                     34: <H2>Dynamic String Manipulation</H2>
                     35: 
                     36: These two functions are dynamic versions of <CODE>strcpy</CODE> and
                     37: <CODE>strcat</CODE>. They use <CODE>malloc</CODE> for allocating space
                     38: for the string. If <CODE>StrAllocCopy</CODE> is called with a non-NULL
                     39: dest, then this is freed before the new value is assigned so that only
                     40: the <EM>last</EM> string created has to be freed by the user. If
                     41: <CODE>StrAllocCat</CODE> is called with a NULL pointer as destination
                     42: then it is equivalent to <CODE>StrAllocCopy</CODE>.
2.1       timbl      43: 
2.9       frystyk    44: <PRE>
                     45: #define StrAllocCopy(dest, src) HTSACopy (&amp;(dest), src)
                     46: #define StrAllocCat(dest, src)  HTSACat  (&amp;(dest), src)
                     47: extern char * HTSACopy PARAMS ((char **dest, CONST char *src));
                     48: extern char * HTSACat  PARAMS ((char **dest, CONST char *src));
2.6       timbl      49: </PRE>
2.1       timbl      50: 
2.9       frystyk    51: <H2>Case-insensitive String Comparison</H2>
                     52: 
                     53: The usual routines (comp instead of cmp) had some problem.
2.7       luotonen   54: 
                     55: <PRE>
2.9       frystyk    56: extern int strcasecomp  PARAMS((CONST char *a, CONST char *b));
                     57: extern int strncasecomp PARAMS((CONST char *a, CONST char *b, int n));
2.7       luotonen   58: </PRE>
                     59: 
2.9       frystyk    60: <H2>Case-insensitive strstr</H2>
2.7       luotonen   61: 
2.9       frystyk    62: This works like <CODE>strstr()</CODE> but is not case-sensitive.
2.1       timbl      63: 
2.9       frystyk    64: <PRE>
2.10      frystyk    65: extern char * strcasestr PARAMS((char *        s1, char * s2));
2.6       timbl      66: </PRE>
2.9       frystyk    67: 
2.6       timbl      68: <H2>Next word or quoted string</H2>
2.9       frystyk    69: <PRE>
                     70: extern char * HTNextField PARAMS ((char** pstr));
                     71: #endif
                     72: </PRE>
2.1       timbl      73: 
2.6       timbl      74: </BODY>
2.9       frystyk    75: </HTML>

Webmaster