4
/* tmbstr.h - Tidy string utility functions
6
(c) 1998-2004 (W3C) MIT, ERCIM, Keio University
7
See tidy.h for the copyright notice.
12
$Date: 2004/12/06 15:05:29 $
24
/* like strdup but using MemAlloc */
25
tmbstr tmbstrdup( ctmbstr str );
27
/* like strndup but using MemAlloc */
28
tmbstr tmbstrndup( ctmbstr str, uint len);
30
/* exactly same as strncpy */
31
uint tmbstrncpy( tmbstr s1, ctmbstr s2, uint size );
33
uint tmbstrcpy( tmbstr s1, ctmbstr s2 );
35
uint tmbstrcat( tmbstr s1, ctmbstr s2 );
37
/* exactly same as strcmp */
38
int tmbstrcmp( ctmbstr s1, ctmbstr s2 );
40
/* returns byte count, not char count */
41
uint tmbstrlen( ctmbstr str );
44
MS C 4.2 doesn't include strcasecmp.
45
Note that tolower and toupper won't
48
Neither do Lexer.ToLower() or Lexer.ToUpper()!
50
We get away with this because, except for XML tags,
51
we are always comparing to ascii element and
52
attribute names defined by HTML specs.
54
int tmbstrcasecmp( ctmbstr s1, ctmbstr s2 );
56
int tmbstrncmp( ctmbstr s1, ctmbstr s2, uint n );
58
int tmbstrncasecmp( ctmbstr s1, ctmbstr s2, uint n );
60
/* return offset of cc from beginning of s1,
63
int tmbstrnchr( ctmbstr s1, uint len1, tmbchar cc );
65
ctmbstr tmbsubstrn( ctmbstr s1, uint len1, ctmbstr s2 );
66
ctmbstr tmbsubstrncase( ctmbstr s1, uint len1, ctmbstr s2 );
67
ctmbstr tmbsubstr( ctmbstr s1, ctmbstr s2 );
69
/* transform string to lower case */
70
tmbstr tmbstrtolower( tmbstr s );
72
/* Transform ASCII chars in string to upper case */
73
tmbstr tmbstrtoupper(tmbstr s);
75
Bool tmbsamefile( ctmbstr filename1, ctmbstr filename2 );
77
int tmbvsnprintf(tmbstr buffer, size_t count, ctmbstr format, va_list args)
79
__attribute__((format(printf, 3, 0)))
82
int tmbsnprintf(tmbstr buffer, size_t count, ctmbstr format, ...)
84
__attribute__((format(printf, 3, 4)))
92
#endif /* __TMBSTR_H__ */