annotate gui/util/string.c @ 36895:5616bd62fa26

Fix bug with hpotmeter/vpotmeter in the Win32 GUI. Allow a hpotmeter/vpotmeter without button. (The rendering should be fixed, actually, because it only renders the button but not the phases image.)
author ib
date Tue, 11 Mar 2014 12:48:59 +0000
parents eed2fb870f43
children 3f3a415d605b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
1 /*
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
2 * This file is part of MPlayer.
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
3 *
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
7 * (at your option) any later version.
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
8 *
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
12 * GNU General Public License for more details.
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
13 *
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License along
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
17 */
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
18
35479
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
19 /**
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
20 * @file
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
21 * @brief String utilities
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
22 */
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
23
33740
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
24 #include <stdlib.h>
33737
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
25 #include <string.h>
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
26
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
27 #include "string.h"
36032
c667e34fb941 Cosmetic: Rearrange #includes.
ib
parents: 35541
diff changeset
28 #include "gui/interface.h"
35525
e27855a45128 Rebuild GUI directory structure.
ib
parents: 35493
diff changeset
29 #include "gui/app/gui.h"
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
30
36459
e6953c9c223a Add mpctx_get_stream().
ib
parents: 36429
diff changeset
31 #include "access_mpcontext.h"
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
32 #include "config.h"
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
33 #include "help_mp.h"
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
34 #include "libavutil/avstring.h"
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
35 #include "stream/stream.h"
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
36
33982
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
37 /**
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
38 * @brief Convert a string to lower case.
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
39 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
40 * @param string to be converted
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
41 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
42 * @return converted string
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
43 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
44 * @note Only characters from A to Z will be converted and this is an in-place conversion.
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
45 */
33052
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
46 char *strlower(char *in)
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
47 {
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
48 char *p = in;
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
49
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
50 while (*p) {
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
51 if (*p >= 'A' && *p <= 'Z')
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
52 *p += 'a' - 'A';
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
53
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
54 p++;
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
55 }
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
56
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
57 return in;
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
58 }
956c67bb5198 Move strlower() into auxiliary string function file.
ib
parents: 33051
diff changeset
59
33982
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
60 /**
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
61 * @brief Swap characters in a string.
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
62 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
63 * @param in string to be processed
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
64 * @param from character to be swapped
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
65 * @param to character to swap in
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
66 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
67 * @return processed string
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
68 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
69 * @note All occurrences will be swapped and this is an in-place processing.
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
70 */
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
71 char *strswap(char *in, char from, char to)
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
72 {
33049
fc7a3f9f74f8 Simplify strswap().
ib
parents: 33048
diff changeset
73 char *p = in;
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
74
33049
fc7a3f9f74f8 Simplify strswap().
ib
parents: 33048
diff changeset
75 while (*p) {
fc7a3f9f74f8 Simplify strswap().
ib
parents: 33048
diff changeset
76 if (*p == from)
fc7a3f9f74f8 Simplify strswap().
ib
parents: 33048
diff changeset
77 *p = to;
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
78
33049
fc7a3f9f74f8 Simplify strswap().
ib
parents: 33048
diff changeset
79 p++;
fc7a3f9f74f8 Simplify strswap().
ib
parents: 33048
diff changeset
80 }
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
81
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
82 return in;
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
83 }
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
84
33982
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
85 /**
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
86 * @brief Remove all space characters from a string,
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
87 * but leave text enclosed in quotation marks untouched.
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
88 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
89 * @param in string to be processed
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
90 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
91 * @return processed string
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
92 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
93 * @note This is an in-place processing.
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
94 */
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
95 char *trim(char *in)
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
96 {
33051
cec61c9f27f4 Simplify trim().
ib
parents: 33049
diff changeset
97 char *src, *dest;
35493
411875efca3f Introduce boolean symbolic constants.
ib
parents: 35482
diff changeset
98 int freeze = False;
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
99
33051
cec61c9f27f4 Simplify trim().
ib
parents: 33049
diff changeset
100 src = dest = in;
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
101
33051
cec61c9f27f4 Simplify trim().
ib
parents: 33049
diff changeset
102 while (*src) {
cec61c9f27f4 Simplify trim().
ib
parents: 33049
diff changeset
103 if (*src == '"')
cec61c9f27f4 Simplify trim().
ib
parents: 33049
diff changeset
104 freeze = !freeze;
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
105
33051
cec61c9f27f4 Simplify trim().
ib
parents: 33049
diff changeset
106 if (freeze || (*src != ' '))
cec61c9f27f4 Simplify trim().
ib
parents: 33049
diff changeset
107 *dest++ = *src;
cec61c9f27f4 Simplify trim().
ib
parents: 33049
diff changeset
108
cec61c9f27f4 Simplify trim().
ib
parents: 33049
diff changeset
109 src++;
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
110 }
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
111
33051
cec61c9f27f4 Simplify trim().
ib
parents: 33049
diff changeset
112 *dest = 0;
cec61c9f27f4 Simplify trim().
ib
parents: 33049
diff changeset
113
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
114 return in;
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents:
diff changeset
115 }
33073
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
116
33982
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
117 /**
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
118 * @brief Remove a comment from a string,
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
119 * but leave text enclosed in quotation marks untouched.
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
120 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
121 * A comment starts either with a semicolon anywhere in the string
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
122 * or with a number sign character at the very beginning.
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
123 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
124 * @param in string to be processed
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
125 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
126 * @return string without comment
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
127 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
128 * @note This is an in-place processing, i.e. @a in will be shortened.
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
129 */
33073
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
130 char *decomment(char *in)
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
131 {
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
132 char *p;
35493
411875efca3f Introduce boolean symbolic constants.
ib
parents: 35482
diff changeset
133 int nap = False;
33073
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
134
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
135 p = in;
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
136
33080
60b2e408bd78 Allow number sign as comment character.
ib
parents: 33073
diff changeset
137 if (*p == '#')
60b2e408bd78 Allow number sign as comment character.
ib
parents: 33073
diff changeset
138 *p = 0;
60b2e408bd78 Allow number sign as comment character.
ib
parents: 33073
diff changeset
139
33073
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
140 while (*p) {
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
141 if (*p == '"')
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
142 nap = !nap;
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
143
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
144 if ((*p == ';') && !nap) {
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
145 *p = 0;
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
146 break;
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
147 }
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
148
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
149 p++;
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
150 }
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
151
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
152 return in;
334e19411421 Improve handling of the comment character.
ib
parents: 33052
diff changeset
153 }
33737
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
154
35479
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
155 /**
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
156 * @brief A strchr() that can handle NULL pointers.
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
157 *
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
158 * @param str string to examine
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
159 * @param c character to find
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
160 *
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
161 * @return return value of strchr() or NULL, if @a str is NULL
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
162 */
33737
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
163 char *gstrchr(const char *str, int c)
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
164 {
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
165 if (!str)
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
166 return NULL;
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
167
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
168 return strchr(str, c);
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
169 }
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
170
35459
1edb306bc754 Add doxygen comment.
ib
parents: 34685
diff changeset
171 /**
1edb306bc754 Add doxygen comment.
ib
parents: 34685
diff changeset
172 * @brief A strcmp() that can handle NULL pointers.
1edb306bc754 Add doxygen comment.
ib
parents: 34685
diff changeset
173 *
1edb306bc754 Add doxygen comment.
ib
parents: 34685
diff changeset
174 * @param a string to be compared
1edb306bc754 Add doxygen comment.
ib
parents: 34685
diff changeset
175 * @param b string which is compared
1edb306bc754 Add doxygen comment.
ib
parents: 34685
diff changeset
176 *
35479
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
177 * @return return value of strcmp() or -1, if @a a or @a b are NULL
35459
1edb306bc754 Add doxygen comment.
ib
parents: 34685
diff changeset
178 */
33737
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
179 int gstrcmp(const char *a, const char *b)
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
180 {
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
181 if (!a && !b)
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
182 return 0;
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
183 if (!a || !b)
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
184 return -1;
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
185
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
186 return strcmp(a, b);
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
187 }
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
188
34628
ee78c9c66508 Add doxgen comment to gstrncmp().
ib
parents: 34560
diff changeset
189 /**
ee78c9c66508 Add doxgen comment to gstrncmp().
ib
parents: 34560
diff changeset
190 * @brief A strncmp() that can handle NULL pointers.
ee78c9c66508 Add doxgen comment to gstrncmp().
ib
parents: 34560
diff changeset
191 *
ee78c9c66508 Add doxgen comment to gstrncmp().
ib
parents: 34560
diff changeset
192 * @param a string to be compared
ee78c9c66508 Add doxgen comment to gstrncmp().
ib
parents: 34560
diff changeset
193 * @param b string which is compared
ee78c9c66508 Add doxgen comment to gstrncmp().
ib
parents: 34560
diff changeset
194 * @param n number of characters compared at the most
ee78c9c66508 Add doxgen comment to gstrncmp().
ib
parents: 34560
diff changeset
195 *
35479
ab09ed2d181b Add doxygen comments to string.c.
ib
parents: 35475
diff changeset
196 * @return return value of strncmp() or -1, if @a a or @a b are NULL
34628
ee78c9c66508 Add doxgen comment to gstrncmp().
ib
parents: 34560
diff changeset
197 */
ee78c9c66508 Add doxgen comment to gstrncmp().
ib
parents: 34560
diff changeset
198 int gstrncmp(const char *a, const char *b, size_t n)
33737
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
199 {
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
200 if (!a && !b)
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
201 return 0;
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
202 if (!a || !b)
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
203 return -1;
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
204
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
205 return strncmp(a, b, n);
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
206 }
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
207
33982
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
208 /**
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
209 * @brief Duplicate a string.
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
210 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
211 * If @a str is NULL, it returns NULL.
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
212 * The string is duplicated by calling strdup().
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
213 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
214 * @param str string to be duplicated
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
215 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
216 * @return duplicated string (newly allocated)
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
217 */
33737
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
218 char *gstrdup(const char *str)
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
219 {
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
220 if (!str)
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
221 return NULL;
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
222
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
223 return strdup(str);
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33080
diff changeset
224 }
33740
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
225
33982
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
226 /**
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
227 * @brief Assign a duplicated string.
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
228 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
229 * The string is duplicated by calling #gstrdup().
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
230 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
231 * @param old pointer to a variable suitable to store the new pointer
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
232 * @param str string to be duplicated
35475
49f29de2ff10 Cosmetic: Place doxygen note at the end of the comment.
ib
parents: 35459
diff changeset
233 *
49f29de2ff10 Cosmetic: Place doxygen note at the end of the comment.
ib
parents: 35459
diff changeset
234 * @note @a *old is freed prior to the assignment.
33982
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
235 */
33740
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
236 void setdup(char **old, const char *str)
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
237 {
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
238 free(*old);
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
239 *old = gstrdup(str);
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
240 }
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
241
33982
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
242 /**
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
243 * @brief Assign a newly allocated string
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
244 * containing the path created from a directory and a filename.
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
245 *
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
246 * @param old pointer to a variable suitable to store the new pointer
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
247 * @param dir directory
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
248 * @param name filename
35475
49f29de2ff10 Cosmetic: Place doxygen note at the end of the comment.
ib
parents: 35459
diff changeset
249 *
49f29de2ff10 Cosmetic: Place doxygen note at the end of the comment.
ib
parents: 35459
diff changeset
250 * @note @a *old is freed prior to the assignment.
33982
d7527ee45784 Add doxygen comments to string.c.
ib
parents: 33786
diff changeset
251 */
33740
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
252 void setddup(char **old, const char *dir, const char *name)
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
253 {
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
254 free(*old);
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
255 *old = malloc(strlen(dir) + strlen(name) + 2);
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
256 if (*old)
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
257 sprintf(*old, "%s/%s", dir, name);
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
258 }
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
259
34176
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
260 /**
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
261 * @brief Convert #guiInfo member Filename.
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
262 *
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
263 * @param how 0 (cut file path and extension),
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
264 * 1 (additionally, convert lower case) or
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
265 * 2 (additionally, convert upper case)
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
266 * @param fname pointer to a buffer to receive the converted Filename
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
267 * @param maxlen size of @a fname buffer
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
268 *
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
269 * @return pointer to @a fname buffer
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
270 */
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
271 char *TranslateFilename(int how, char *fname, size_t maxlen)
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
272 {
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
273 char *p;
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
274 size_t len;
36459
e6953c9c223a Add mpctx_get_stream().
ib
parents: 36429
diff changeset
275 stream_t *stream;
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
276
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
277 switch (guiInfo.StreamType) {
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
278 case STREAMTYPE_FILE:
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35525
diff changeset
279
34176
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
280 if (guiInfo.Filename && *guiInfo.Filename) {
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
281 p = strrchr(guiInfo.Filename,
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
282 #if HAVE_DOS_PATHS
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
283 '\\');
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
284 #else
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
285 '/');
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
286 #endif
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
287
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
288 if (p)
34176
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
289 av_strlcpy(fname, p + 1, maxlen);
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
290 else
34176
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
291 av_strlcpy(fname, guiInfo.Filename, maxlen);
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
292
34176
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
293 len = strlen(fname);
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
294
34176
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
295 if (len > 3 && fname[len - 3] == '.')
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
296 fname[len - 3] = 0;
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
297 else if (len > 4 && fname[len - 4] == '.')
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
298 fname[len - 4] = 0;
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
299 else if (len > 5 && fname[len - 5] == '.')
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
300 fname[len - 5] = 0;
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
301 } else
36694
eed2fb870f43 Rename symbolic constants of GUI help message texts.
ib
parents: 36460
diff changeset
302 av_strlcpy(fname, MSGTR_GUI_MSG_NoFileLoaded, maxlen);
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35525
diff changeset
303
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
304 break;
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
305
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
306 case STREAMTYPE_STREAM:
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35525
diff changeset
307
34176
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
308 av_strlcpy(fname, guiInfo.Filename, maxlen);
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
309 break;
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
310
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34177
diff changeset
311 case STREAMTYPE_CDDA:
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35525
diff changeset
312
36694
eed2fb870f43 Rename symbolic constants of GUI help message texts.
ib
parents: 36460
diff changeset
313 snprintf(fname, maxlen, MSGTR_GUI_TitleN, guiInfo.Track);
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34177
diff changeset
314 break;
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34177
diff changeset
315
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
316 case STREAMTYPE_VCD:
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35525
diff changeset
317
36694
eed2fb870f43 Rename symbolic constants of GUI help message texts.
ib
parents: 36460
diff changeset
318 snprintf(fname, maxlen, MSGTR_GUI_TitleN, guiInfo.Track - 1);
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
319 break;
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
320
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
321 case STREAMTYPE_DVD:
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35525
diff changeset
322
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
323 if (guiInfo.Chapter)
36694
eed2fb870f43 Rename symbolic constants of GUI help message texts.
ib
parents: 36460
diff changeset
324 snprintf(fname, maxlen, MSGTR_GUI_ChapterN, guiInfo.Chapter);
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
325 else
36694
eed2fb870f43 Rename symbolic constants of GUI help message texts.
ib
parents: 36460
diff changeset
326 av_strlcpy(fname, MSGTR_GUI_NoChapter, maxlen);
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35525
diff changeset
327
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
328 break;
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
329
36429
28ea255e40ce Add support for TV/DVB to the GUI.
ib
parents: 36032
diff changeset
330 case STREAMTYPE_TV:
28ea255e40ce Add support for TV/DVB to the GUI.
ib
parents: 36032
diff changeset
331 case STREAMTYPE_DVB:
28ea255e40ce Add support for TV/DVB to the GUI.
ib
parents: 36032
diff changeset
332
36694
eed2fb870f43 Rename symbolic constants of GUI help message texts.
ib
parents: 36460
diff changeset
333 p = MSGTR_GUI_NoChannelName;
36459
e6953c9c223a Add mpctx_get_stream().
ib
parents: 36429
diff changeset
334 stream = mpctx_get_stream(guiInfo.mpcontext);
36429
28ea255e40ce Add support for TV/DVB to the GUI.
ib
parents: 36032
diff changeset
335
36459
e6953c9c223a Add mpctx_get_stream().
ib
parents: 36429
diff changeset
336 if (stream)
e6953c9c223a Add mpctx_get_stream().
ib
parents: 36429
diff changeset
337 stream_control(stream, STREAM_CTRL_GET_CURRENT_CHANNEL, &p);
36429
28ea255e40ce Add support for TV/DVB to the GUI.
ib
parents: 36032
diff changeset
338
28ea255e40ce Add support for TV/DVB to the GUI.
ib
parents: 36032
diff changeset
339 av_strlcpy(fname, p, maxlen);
28ea255e40ce Add support for TV/DVB to the GUI.
ib
parents: 36032
diff changeset
340 break;
28ea255e40ce Add support for TV/DVB to the GUI.
ib
parents: 36032
diff changeset
341
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
342 default:
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35525
diff changeset
343
36694
eed2fb870f43 Rename symbolic constants of GUI help message texts.
ib
parents: 36460
diff changeset
344 av_strlcpy(fname, MSGTR_GUI_MSG_NoMediaOpened, maxlen);
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
345 break;
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
346 }
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
347
34176
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
348 if (how) {
34177
fadc00cc31d3 Optimize TranslateFilename().
ib
parents: 34176
diff changeset
349 p = fname;
fadc00cc31d3 Optimize TranslateFilename().
ib
parents: 34176
diff changeset
350
fadc00cc31d3 Optimize TranslateFilename().
ib
parents: 34176
diff changeset
351 while (*p) {
fadc00cc31d3 Optimize TranslateFilename().
ib
parents: 34176
diff changeset
352 char t = 0;
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
353
34177
fadc00cc31d3 Optimize TranslateFilename().
ib
parents: 34176
diff changeset
354 if (how == 1 && *p >= 'A' && *p <= 'Z')
fadc00cc31d3 Optimize TranslateFilename().
ib
parents: 34176
diff changeset
355 t = 32;
fadc00cc31d3 Optimize TranslateFilename().
ib
parents: 34176
diff changeset
356 if (how == 2 && *p >= 'a' && *p <= 'z')
fadc00cc31d3 Optimize TranslateFilename().
ib
parents: 34176
diff changeset
357 t = -32;
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
358
34177
fadc00cc31d3 Optimize TranslateFilename().
ib
parents: 34176
diff changeset
359 *p = *p + t;
fadc00cc31d3 Optimize TranslateFilename().
ib
parents: 34176
diff changeset
360 p++;
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
361 }
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
362 }
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
363
34176
d52b0ad317d5 Cosmetic: Rename TranslateFilename()'s parameter names.
ib
parents: 34175
diff changeset
364 return fname;
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 33982
diff changeset
365 }
34560
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
366
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
367 /**
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
368 * @brief Read characters from @a file.
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
369 *
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
370 * @param str pointer to a buffer to receive the read characters
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
371 * @param size number of characters read at the most (including a terminating null-character)
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
372 * @param file file to read from
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
373 *
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
374 * @return str (success) or NULL (error)
35475
49f29de2ff10 Cosmetic: Place doxygen note at the end of the comment.
ib
parents: 35459
diff changeset
375 *
49f29de2ff10 Cosmetic: Place doxygen note at the end of the comment.
ib
parents: 35459
diff changeset
376 * @note Reading stops with an end-of-line character or at end of file.
34560
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
377 */
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
378 char *fgetstr(char *str, int size, FILE *file)
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
379 {
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
380 char *s;
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
381
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
382 s = fgets(str, size, file);
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
383
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
384 if (s)
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
385 s[strcspn(s, "\n\r")] = 0;
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
386
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
387 return s;
abcf26dcec6b Add fgetstr() to read from files without end-of-line characters.
ib
parents: 34454
diff changeset
388 }