HTML Tidy
5.6.0
The HTACG Tidy HTML Project
tmbstr.h
Go to the documentation of this file.
1
#ifndef __TMBSTR_H__
2
#define __TMBSTR_H__
3
4
/* tmbstr.h - Tidy string utility functions
5
6
(c) 1998-2006 (W3C) MIT, ERCIM, Keio University
7
See tidy.h for the copyright notice.
8
9
*/
10
11
#include "
tidyplatform.h
"
12
13
#ifdef __cplusplus
14
extern
"C"
15
{
16
#endif
17
18
/* like strdup but using an allocator */
19
tmbstr
TY_
(tmbstrdup)( TidyAllocator *allocator,
ctmbstr
str );
20
21
/* like strndup but using an allocator */
22
tmbstr
TY_
(tmbstrndup)( TidyAllocator *allocator,
ctmbstr
str,
uint
len);
23
24
/* exactly same as strncpy */
25
uint
TY_
(tmbstrncpy)(
tmbstr
s1,
ctmbstr
s2,
uint
size );
26
27
uint
TY_
(tmbstrcpy)(
tmbstr
s1,
ctmbstr
s2 );
28
29
uint
TY_
(tmbstrcat)(
tmbstr
s1,
ctmbstr
s2 );
30
31
/* exactly same as strcmp */
32
int
TY_
(tmbstrcmp)(
ctmbstr
s1,
ctmbstr
s2 );
33
34
/* returns byte count, not char count */
35
uint
TY_
(tmbstrlen)(
ctmbstr
str );
36
37
/*
38
MS C 4.2 doesn't include strcasecmp.
39
Note that tolower and toupper won't
40
work on chars > 127.
41
42
Neither do Lexer.ToLower() or Lexer.ToUpper()!
43
44
We get away with this because, except for XML tags,
45
we are always comparing to ascii element and
46
attribute names defined by HTML specs.
47
*/
48
int
TY_
(tmbstrcasecmp)(
ctmbstr
s1,
ctmbstr
s2 );
49
50
int
TY_
(tmbstrncmp)(
ctmbstr
s1,
ctmbstr
s2,
uint
n );
51
52
int
TY_
(tmbstrncasecmp)(
ctmbstr
s1,
ctmbstr
s2,
uint
n );
53
54
/* return offset of cc from beginning of s1,
55
** -1 if not found.
56
*/
57
/* int TY_(tmbstrnchr)( ctmbstr s1, uint len1, tmbchar cc ); */
58
59
ctmbstr
TY_
(tmbsubstrn)(
ctmbstr
s1,
uint
len1,
ctmbstr
s2 );
60
/* ctmbstr TY_(tmbsubstrncase)( ctmbstr s1, uint len1, ctmbstr s2 ); */
61
ctmbstr
TY_
(tmbsubstr)(
ctmbstr
s1,
ctmbstr
s2 );
62
63
/* transform string to lower case */
64
tmbstr
TY_
(tmbstrtolower)(
tmbstr
s );
65
66
/* Transform ASCII chars in string to upper case */
67
tmbstr
TY_
(tmbstrtoupper)(
tmbstr
s );
68
69
/* Bool TY_(tmbsamefile)( ctmbstr filename1, ctmbstr filename2 ); */
70
71
int
TY_
(tmbvsnprintf)(
tmbstr
buffer,
size_t
count,
ctmbstr
format, va_list args)
72
#ifdef __GNUC__
73
__attribute__((format(printf, 3, 0)))
74
#endif
75
;
76
int
TY_
(tmbsnprintf)(
tmbstr
buffer,
size_t
count,
ctmbstr
format, ...)
77
#ifdef __GNUC__
78
__attribute__((format(printf, 3, 4)))
79
#endif
80
;
81
82
#ifdef __cplusplus
83
}
/* extern "C" */
84
#endif
85
86
#endif
/* __TMBSTR_H__ */
ctmbstr
const tmbchar * ctmbstr
Definition:
tidyplatform.h:594
tidyplatform.h
Platform specific definitions, specifics, and headers.
tmbstr
tmbchar * tmbstr
Definition:
tidyplatform.h:593
uint
unsigned int uint
Definition:
tidyplatform.h:554
TY_
#define TY_(str)
Definition:
forward.h:23
tidy-html5
src
tmbstr.h
Generated on Sat Nov 25 2017 15:29:20 for HTML Tidy by
1.8.12