diff options
author | jsing <> | 2014-04-18 05:37:44 +0000 |
---|---|---|
committer | jsing <> | 2014-04-18 05:37:44 +0000 |
commit | f843014abcc7498613638ca7bdc47b3123ea2544 (patch) | |
tree | fc08a86c3d277a550737fd859bfcfb80547a2c6b /src/lib/libcrypto/ui/ui.h | |
parent | f737947057a1a777dafba073b92264e698047b6c (diff) | |
download | openbsd-f843014abcc7498613638ca7bdc47b3123ea2544.tar.gz openbsd-f843014abcc7498613638ca7bdc47b3123ea2544.tar.bz2 openbsd-f843014abcc7498613638ca7bdc47b3123ea2544.zip |
More KNF.
Diffstat (limited to 'src/lib/libcrypto/ui/ui.h')
-rw-r--r-- | src/lib/libcrypto/ui/ui.h | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/lib/libcrypto/ui/ui.h b/src/lib/libcrypto/ui/ui.h index ed35e50eb4..7970f893d6 100644 --- a/src/lib/libcrypto/ui/ui.h +++ b/src/lib/libcrypto/ui/ui.h | |||
@@ -10,7 +10,7 @@ | |||
10 | * are met: | 10 | * are met: |
11 | * | 11 | * |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * | 14 | * |
15 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright |
16 | * notice, this list of conditions and the following disclaimer in | 16 | * notice, this list of conditions and the following disclaimer in |
@@ -128,19 +128,19 @@ void UI_free(UI *ui); | |||
128 | On success, the all return an index of the added information. That index | 128 | On success, the all return an index of the added information. That index |
129 | is usefull when retrieving results with UI_get0_result(). */ | 129 | is usefull when retrieving results with UI_get0_result(). */ |
130 | int UI_add_input_string(UI *ui, const char *prompt, int flags, | 130 | int UI_add_input_string(UI *ui, const char *prompt, int flags, |
131 | char *result_buf, int minsize, int maxsize); | 131 | char *result_buf, int minsize, int maxsize); |
132 | int UI_dup_input_string(UI *ui, const char *prompt, int flags, | 132 | int UI_dup_input_string(UI *ui, const char *prompt, int flags, |
133 | char *result_buf, int minsize, int maxsize); | 133 | char *result_buf, int minsize, int maxsize); |
134 | int UI_add_verify_string(UI *ui, const char *prompt, int flags, | 134 | int UI_add_verify_string(UI *ui, const char *prompt, int flags, |
135 | char *result_buf, int minsize, int maxsize, const char *test_buf); | 135 | char *result_buf, int minsize, int maxsize, const char *test_buf); |
136 | int UI_dup_verify_string(UI *ui, const char *prompt, int flags, | 136 | int UI_dup_verify_string(UI *ui, const char *prompt, int flags, |
137 | char *result_buf, int minsize, int maxsize, const char *test_buf); | 137 | char *result_buf, int minsize, int maxsize, const char *test_buf); |
138 | int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc, | 138 | int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc, |
139 | const char *ok_chars, const char *cancel_chars, | 139 | const char *ok_chars, const char *cancel_chars, |
140 | int flags, char *result_buf); | 140 | int flags, char *result_buf); |
141 | int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, | 141 | int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, |
142 | const char *ok_chars, const char *cancel_chars, | 142 | const char *ok_chars, const char *cancel_chars, |
143 | int flags, char *result_buf); | 143 | int flags, char *result_buf); |
144 | int UI_add_info_string(UI *ui, const char *text); | 144 | int UI_add_info_string(UI *ui, const char *text); |
145 | int UI_dup_info_string(UI *ui, const char *text); | 145 | int UI_dup_info_string(UI *ui, const char *text); |
146 | int UI_add_error_string(UI *ui, const char *text); | 146 | int UI_add_error_string(UI *ui, const char *text); |
@@ -185,8 +185,8 @@ int UI_dup_error_string(UI *ui, const char *text); | |||
185 | 185 | ||
186 | "Enter pass phrase for foo.key:" | 186 | "Enter pass phrase for foo.key:" |
187 | */ | 187 | */ |
188 | char *UI_construct_prompt(UI *ui_method, | 188 | char *UI_construct_prompt(UI *ui_method, const char *object_desc, |
189 | const char *object_desc, const char *object_name); | 189 | const char *object_name); |
190 | 190 | ||
191 | 191 | ||
192 | /* The following function is used to store a pointer to user-specific data. | 192 | /* The following function is used to store a pointer to user-specific data. |
@@ -228,8 +228,8 @@ int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f)(void)); | |||
228 | #define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg) | 228 | #define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg) |
229 | #define UI_get_app_data(s) UI_get_ex_data(s,0) | 229 | #define UI_get_app_data(s) UI_get_ex_data(s,0) |
230 | int UI_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 230 | int UI_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
231 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | 231 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); |
232 | int UI_set_ex_data(UI *r,int idx,void *arg); | 232 | int UI_set_ex_data(UI *r, int idx, void *arg); |
233 | void *UI_get_ex_data(UI *r, int idx); | 233 | void *UI_get_ex_data(UI *r, int idx); |
234 | 234 | ||
235 | /* Use specific methods instead of the built-in one */ | 235 | /* Use specific methods instead of the built-in one */ |
@@ -292,15 +292,14 @@ DECLARE_STACK_OF(UI_STRING) | |||
292 | 292 | ||
293 | /* The different types of strings that are currently supported. | 293 | /* The different types of strings that are currently supported. |
294 | This is only needed by method authors. */ | 294 | This is only needed by method authors. */ |
295 | enum UI_string_types | 295 | enum UI_string_types { |
296 | { | 296 | UIT_NONE = 0, |
297 | UIT_NONE=0, | ||
298 | UIT_PROMPT, /* Prompt for a string */ | 297 | UIT_PROMPT, /* Prompt for a string */ |
299 | UIT_VERIFY, /* Prompt for a string and verify */ | 298 | UIT_VERIFY, /* Prompt for a string and verify */ |
300 | UIT_BOOLEAN, /* Prompt for a yes/no response */ | 299 | UIT_BOOLEAN, /* Prompt for a yes/no response */ |
301 | UIT_INFO, /* Send info to the user */ | 300 | UIT_INFO, /* Send info to the user */ |
302 | UIT_ERROR /* Send an error message to the user */ | 301 | UIT_ERROR /* Send an error message to the user */ |
303 | }; | 302 | }; |
304 | 303 | ||
305 | /* Create and manipulate methods */ | 304 | /* Create and manipulate methods */ |
306 | UI_METHOD *UI_create_method(char *name); | 305 | UI_METHOD *UI_create_method(char *name); |
@@ -312,9 +311,9 @@ int UI_method_set_reader(UI_METHOD *method, int (*reader)(UI *ui, UI_STRING *uis | |||
312 | int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui)); | 311 | int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui)); |
313 | int UI_method_set_prompt_constructor(UI_METHOD *method, char *(*prompt_constructor)(UI* ui, const char* object_desc, const char* object_name)); | 312 | int UI_method_set_prompt_constructor(UI_METHOD *method, char *(*prompt_constructor)(UI* ui, const char* object_desc, const char* object_name)); |
314 | int (*UI_method_get_opener(UI_METHOD *method))(UI*); | 313 | int (*UI_method_get_opener(UI_METHOD *method))(UI*); |
315 | int (*UI_method_get_writer(UI_METHOD *method))(UI*,UI_STRING*); | 314 | int (*UI_method_get_writer(UI_METHOD *method))(UI*, UI_STRING*); |
316 | int (*UI_method_get_flusher(UI_METHOD *method))(UI*); | 315 | int (*UI_method_get_flusher(UI_METHOD *method))(UI*); |
317 | int (*UI_method_get_reader(UI_METHOD *method))(UI*,UI_STRING*); | 316 | int (*UI_method_get_reader(UI_METHOD *method))(UI*, UI_STRING*); |
318 | int (*UI_method_get_closer(UI_METHOD *method))(UI*); | 317 | int (*UI_method_get_closer(UI_METHOD *method))(UI*); |
319 | char * (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const char*, const char*); | 318 | char * (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const char*, const char*); |
320 | 319 | ||
@@ -342,8 +341,8 @@ int UI_set_result(UI *ui, UI_STRING *uis, const char *result); | |||
342 | 341 | ||
343 | 342 | ||
344 | /* A couple of popular utility functions */ | 343 | /* A couple of popular utility functions */ |
345 | int UI_UTIL_read_pw_string(char *buf,int length,const char *prompt,int verify); | 344 | int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt, int verify); |
346 | int UI_UTIL_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); | 345 | int UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt, int verify); |
347 | 346 | ||
348 | 347 | ||
349 | /* BEGIN ERROR CODES */ | 348 | /* BEGIN ERROR CODES */ |