1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
.TH qlibs: case 3
.SH NAME
case \- case independent string manipulation/evaluation
.SH SYNTAX
.B #include \(dqcase.h\(dq
void \fBcase_lowers\fP(\fIs\fR);
.br
void \fBcase_lowerb\fP(\fIs\fR,\fIlen\fR);
.br
void \fBcase_uppers\fP(\fIs\fR);
.br
void \fBcase_upperb\fP(\fIs\fR,\fIlen\fR);
.br
int \fBcase_diffs\fP(\fIs\fR,\fIt\fR);
.br
int \fBcase_equals\fP(\fIs\fR,\fIt\fR);
.br
int \fBcase_diffrs\fP(\fIs\fR,\fIt\fR);
.br
int \fBcase_equalrs\fP(\fIs\fR,\fIt\fR);
.br
int \fBcase_starts\fP(\fIs\fR,\fIt\fR);
.br
int \fBcase_diffb\fP(\fIs\fR,\fIlen\fR,\fIt\fR);
.br
int \fBcase_startb\fP(\fIs\fR,\fIlen\fR,\fIt\fR);
char *\fIs\fR;
.br
char *\fIt\fR;
.br
unsigned int \fIlen\fR;
.SH DESCRIPTION
.B case_lowers
converts each uppercase byte in the string
.I s
to lowercase.
.I s
must be 0-terminated.
.B case_lowerb
converts each uppercase byte in the buffer
.IR s ,
of length
.IR len ,
to lowercase.
.B case_uppers
converts each lowercase byte in the string
.I s
to uppercase.
.I s
must be 0-terminated.
.B case_upperb
converts each lowercase byte in the buffer
.IR s ,
of length
.IR len ,
to uppercase.
.B case_diffs
lexicographically compares lowercase versions of the strings
.I s
and
.IR t .
It returns something positive, negative, or zero
when the first is larger than, smaller than, or equal to the second.
.I s
and
.I t
must be 0-terminated.
.B case_equals
means
.BR !case_diffs .
.B case_diffrs
and
.B case_equalrs
compare strings from right to left instead from left to right.
.B case_starts
returns 1 if a lowercase version of
.I s
starts with a lowercase version of
.IR t .
.I s
and
.I t
must be 0-terminated.
.B case_diffb
lexicographically compares lowercase versions of the buffers
.I s
and
.IR t ,
each of length
.IR len .
It returns something positive, negative, or zero
when the first is larger than, smaller than, or equal to the second.
.B case_startb
returns 1 if a lowercase version of the buffer
.IR s ,
of length
.IR len ,
starts with a lowercase version of the string
.IR t .
.I t
must be 0-terminated.
The
.B case
routines
are ASCII-specific.
They are suitable for programs that handle
case-independent networking protocols.
All comparisons are performed on unsigned bytes.
.SH "SEE ALSO"
byte(3),
stralloc(3)
|