diff options
author | tb <> | 2023-03-06 14:32:06 +0000 |
---|---|---|
committer | tb <> | 2023-03-06 14:32:06 +0000 |
commit | 6c965e26b1a93da63948edae6b68564be1ded507 (patch) | |
tree | bbe07d6e06b695cebe22802551f2db0a61354d7c /src/usr.bin/openssl/version.c | |
parent | 48e828ea26ee91710242131cd75cd9d1d20b773c (diff) | |
download | openbsd-6c965e26b1a93da63948edae6b68564be1ded507.tar.gz openbsd-6c965e26b1a93da63948edae6b68564be1ded507.tar.bz2 openbsd-6c965e26b1a93da63948edae6b68564be1ded507.zip |
Rename struct ${app}_config to plain cfg
All the structs are static and we need to reach into them many times.
Having a shorter name is more concise and results in less visual clutter.
It also avoids many overlong lines and we will be able to get rid of some
unfortunate line wrapping down the road.
Discussed with jsing
Diffstat (limited to 'src/usr.bin/openssl/version.c')
-rw-r--r-- | src/usr.bin/openssl/version.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/usr.bin/openssl/version.c b/src/usr.bin/openssl/version.c index 038774ad0c..6ff1860ead 100644 --- a/src/usr.bin/openssl/version.c +++ b/src/usr.bin/openssl/version.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: version.c,v 1.10 2022/11/11 17:07:39 joshua Exp $ */ | 1 | /* $OpenBSD: version.c,v 1.11 2023/03/06 14:32:06 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -142,17 +142,17 @@ static struct { | |||
142 | int options; | 142 | int options; |
143 | int platform; | 143 | int platform; |
144 | int version; | 144 | int version; |
145 | } version_config; | 145 | } cfg; |
146 | 146 | ||
147 | static int | 147 | static int |
148 | version_all_opts(void) | 148 | version_all_opts(void) |
149 | { | 149 | { |
150 | version_config.cflags = 1; | 150 | cfg.cflags = 1; |
151 | version_config.date = 1; | 151 | cfg.date = 1; |
152 | version_config.dir= 1; | 152 | cfg.dir= 1; |
153 | version_config.options = 1; | 153 | cfg.options = 1; |
154 | version_config.platform = 1; | 154 | cfg.platform = 1; |
155 | version_config.version = 1; | 155 | cfg.version = 1; |
156 | 156 | ||
157 | return (0); | 157 | return (0); |
158 | } | 158 | } |
@@ -168,37 +168,37 @@ static const struct option version_options[] = { | |||
168 | .name = "b", | 168 | .name = "b", |
169 | .desc = "Date the current version of OpenSSL was built", | 169 | .desc = "Date the current version of OpenSSL was built", |
170 | .type = OPTION_FLAG, | 170 | .type = OPTION_FLAG, |
171 | .opt.flag = &version_config.date, | 171 | .opt.flag = &cfg.date, |
172 | }, | 172 | }, |
173 | { | 173 | { |
174 | .name = "d", | 174 | .name = "d", |
175 | .desc = "OPENSSLDIR value", | 175 | .desc = "OPENSSLDIR value", |
176 | .type = OPTION_FLAG, | 176 | .type = OPTION_FLAG, |
177 | .opt.flag = &version_config.dir, | 177 | .opt.flag = &cfg.dir, |
178 | }, | 178 | }, |
179 | { | 179 | { |
180 | .name = "f", | 180 | .name = "f", |
181 | .desc = "Compilation flags", | 181 | .desc = "Compilation flags", |
182 | .type = OPTION_FLAG, | 182 | .type = OPTION_FLAG, |
183 | .opt.flag = &version_config.cflags, | 183 | .opt.flag = &cfg.cflags, |
184 | }, | 184 | }, |
185 | { | 185 | { |
186 | .name = "o", | 186 | .name = "o", |
187 | .desc = "Option information", | 187 | .desc = "Option information", |
188 | .type = OPTION_FLAG, | 188 | .type = OPTION_FLAG, |
189 | .opt.flag = &version_config.options, | 189 | .opt.flag = &cfg.options, |
190 | }, | 190 | }, |
191 | { | 191 | { |
192 | .name = "p", | 192 | .name = "p", |
193 | .desc = "Platform settings", | 193 | .desc = "Platform settings", |
194 | .type = OPTION_FLAG, | 194 | .type = OPTION_FLAG, |
195 | .opt.flag = &version_config.platform, | 195 | .opt.flag = &cfg.platform, |
196 | }, | 196 | }, |
197 | { | 197 | { |
198 | .name = "v", | 198 | .name = "v", |
199 | .desc = "Current OpenSSL version", | 199 | .desc = "Current OpenSSL version", |
200 | .type = OPTION_FLAG, | 200 | .type = OPTION_FLAG, |
201 | .opt.flag = &version_config.version, | 201 | .opt.flag = &cfg.version, |
202 | }, | 202 | }, |
203 | {NULL}, | 203 | {NULL}, |
204 | }; | 204 | }; |
@@ -218,7 +218,7 @@ version_main(int argc, char **argv) | |||
218 | exit(1); | 218 | exit(1); |
219 | } | 219 | } |
220 | 220 | ||
221 | memset(&version_config, 0, sizeof(version_config)); | 221 | memset(&cfg, 0, sizeof(cfg)); |
222 | 222 | ||
223 | if (options_parse(argc, argv, version_options, NULL, NULL) != 0) { | 223 | if (options_parse(argc, argv, version_options, NULL, NULL) != 0) { |
224 | version_usage(); | 224 | version_usage(); |
@@ -226,9 +226,9 @@ version_main(int argc, char **argv) | |||
226 | } | 226 | } |
227 | 227 | ||
228 | if (argc == 1) | 228 | if (argc == 1) |
229 | version_config.version = 1; | 229 | cfg.version = 1; |
230 | 230 | ||
231 | if (version_config.version) { | 231 | if (cfg.version) { |
232 | if (SSLeay() == SSLEAY_VERSION_NUMBER) { | 232 | if (SSLeay() == SSLEAY_VERSION_NUMBER) { |
233 | printf("%s\n", SSLeay_version(SSLEAY_VERSION)); | 233 | printf("%s\n", SSLeay_version(SSLEAY_VERSION)); |
234 | } else { | 234 | } else { |
@@ -237,11 +237,11 @@ version_main(int argc, char **argv) | |||
237 | SSLeay_version(SSLEAY_VERSION)); | 237 | SSLeay_version(SSLEAY_VERSION)); |
238 | } | 238 | } |
239 | } | 239 | } |
240 | if (version_config.date) | 240 | if (cfg.date) |
241 | printf("%s\n", SSLeay_version(SSLEAY_BUILT_ON)); | 241 | printf("%s\n", SSLeay_version(SSLEAY_BUILT_ON)); |
242 | if (version_config.platform) | 242 | if (cfg.platform) |
243 | printf("%s\n", SSLeay_version(SSLEAY_PLATFORM)); | 243 | printf("%s\n", SSLeay_version(SSLEAY_PLATFORM)); |
244 | if (version_config.options) { | 244 | if (cfg.options) { |
245 | printf("options: "); | 245 | printf("options: "); |
246 | printf("%s ", BN_options()); | 246 | printf("%s ", BN_options()); |
247 | #ifndef OPENSSL_NO_RC4 | 247 | #ifndef OPENSSL_NO_RC4 |
@@ -258,9 +258,9 @@ version_main(int argc, char **argv) | |||
258 | #endif | 258 | #endif |
259 | printf("\n"); | 259 | printf("\n"); |
260 | } | 260 | } |
261 | if (version_config.cflags) | 261 | if (cfg.cflags) |
262 | printf("%s\n", SSLeay_version(SSLEAY_CFLAGS)); | 262 | printf("%s\n", SSLeay_version(SSLEAY_CFLAGS)); |
263 | if (version_config.dir) | 263 | if (cfg.dir) |
264 | printf("%s\n", SSLeay_version(SSLEAY_DIR)); | 264 | printf("%s\n", SSLeay_version(SSLEAY_DIR)); |
265 | 265 | ||
266 | return (0); | 266 | return (0); |