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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
/**
* @ingroup file68_lib
* @file sc68/string68.h
* @author Benjamin Gerard
* @date 2003-08-11
* @brief String manipulation header.
*
*/
/* $Id$ */
/* Copyright (C) 1998-2009 Benjamin Gerard */
/** @defgroup file68_string String manipulation
* @ingroup file68_lib
*
* Provides string manipulation functions.
*
* @{
*/
/** Compare two string (case insensitive).
*
* The strcmp68() function compares the two strings a and b,
* ignoring the case of the characters. It returns an integer less than,
* equal to, or greater than zero if a is found, respectively, to be less
* than, to match, or be greater than b.
*
* @param a First string to compare
* @param b String to compare with
*
* @return Integer result of the two string compare. The difference
* between last tested characters of a and b.
* @retval 0 a and b are equal
* @retval <0 a is less than b
* @retval >0 a is greater than b
*/
int ;
/** Compare two string (case insensitive, size limited).
*
* The strcmp68() function compares the two strings a and b,
* ignoring the case of the characters. It returns an integer less than,
* equal to, or greater than zero if a is found, respectively, to be less
* than, to match, or be greater than b.
*
* @param a First string to compare
* @param b String to compare with
* @param max Strings max length
*
* @return Integer result of the two string compare. The difference
* between last tested characters of a and b.
* @retval 0 a and b are equal
* @retval <0 a is less than b
* @retval >0 a is greater than b
*/
int ;
/** Concatenate two strings.
*
* The strcat68() function appends the b string to the a string
* overwriting the 0 character at the end of dest, and then adds a
* terminating 0 character. The strings may not overlap. Destination
* string has a maximum size of l characters. On overflow, the trailing 0
* is omitted.
*
* @param a Destination string.
* @param b String to append.
* @param l Destination maximum size (including trailing 0)
*
* @return Destination string
* @retval a
*/
char * ;
/** Duplicate a string.
*
* The strdup68() function returns a pointer to a new string which is a
* duplicate of the string s. Memory for the new string is obtained with
* SC68alloc(), and can be freed with SC68free().
*
* @param s String to duplicate.
*
* @return Duplicated string
* @return 0 error
*/
char * ;
/** Concat two strings in a duplicate buffer.
*
* The strcatdup68() function returns a pointer to a new string which is a
* duplicate of the string a+b. Memory for the new string is obtained with
* SC68alloc(), and can be freed with SC68free(). If either a or b is null
* the function does not failed but replace it by an empty string. If both
* a and b are null the function returns 0.
*
* @param a Left string.
* @param b Right string.
*
* @return Duplicated string a+b
* @return 0 error
*/
char * ;
/** Make a track and time information string.
*
* The SC68time_str() function formats a string with track time info.
* The general format is "TK MN:SS" where:
* - TK is track_num or "--" if track_num < 0 or track_num > 99
* - MN:SS is time minutes and seconds or "--:--" if seconds < 0
*
* @param buffer Destination buffer (0 use default static buffer).
* @param track_num Track number from 00 to 99, minus values disable.
* @param seconds Time to display in seconds [00..5999], other values
* disable.
*
* @return Pointer to result formatted string in a static buffer.
*
* @warning The function returns a static buffer. Do try to modify it.
* @warning Not thread safe.
*
* @see SC68utils_make_big_playing_time()
*/
char * ;
/** Convert time (in second) to string.
*
* The strlongtime68() function converts a time in
* seconds to days, hours, minutes and second string. Day and hour unit
* are removed if they are null (not signifiant). The output string looks
* like : [D days, ][H h, ] MN' SS"
*
* @param buffer Destination buffer (0 use default static buffer).
* @param time Time in second to convert to string.
*
* @return pointer to result time string (given buffer or static buffer).
*
* @warning Not thread safe when using static buffer.
*
* @see SC68utils_make_track_time_info()
*/
char * ;
static inline
const char *
/** Returns a never null string.
*
* param s String to test
*
* return a never null string
* retval s if s was not null
* retval "<nul>" if s was null
*/
const char * ;
static inline
const char *
/** Returns success string.
*
* param v Value to test
*
* return a success string
* retval "success" if v == 0
* retval "failure" if v != 0
*/
const char * ;
/**
* @}
*/
/* #ifndef _FILE68_STRING68_H_ */