From f843014abcc7498613638ca7bdc47b3123ea2544 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Fri, 18 Apr 2014 05:37:44 +0000 Subject: More KNF. --- src/lib/libcrypto/ui/ui.h | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'src/lib/libcrypto/ui/ui.h') 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 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -128,19 +128,19 @@ void UI_free(UI *ui); On success, the all return an index of the added information. That index is usefull when retrieving results with UI_get0_result(). */ int UI_add_input_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize); + char *result_buf, int minsize, int maxsize); int UI_dup_input_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize); + char *result_buf, int minsize, int maxsize); int UI_add_verify_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize, const char *test_buf); + char *result_buf, int minsize, int maxsize, const char *test_buf); int UI_dup_verify_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize, const char *test_buf); + char *result_buf, int minsize, int maxsize, const char *test_buf); int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc, - const char *ok_chars, const char *cancel_chars, - int flags, char *result_buf); + const char *ok_chars, const char *cancel_chars, + int flags, char *result_buf); int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, - const char *ok_chars, const char *cancel_chars, - int flags, char *result_buf); + const char *ok_chars, const char *cancel_chars, + int flags, char *result_buf); int UI_add_info_string(UI *ui, const char *text); int UI_dup_info_string(UI *ui, const char *text); int UI_add_error_string(UI *ui, const char *text); @@ -185,8 +185,8 @@ int UI_dup_error_string(UI *ui, const char *text); "Enter pass phrase for foo.key:" */ -char *UI_construct_prompt(UI *ui_method, - const char *object_desc, const char *object_name); +char *UI_construct_prompt(UI *ui_method, const char *object_desc, + const char *object_name); /* 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)); #define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg) #define UI_get_app_data(s) UI_get_ex_data(s,0) int UI_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int UI_set_ex_data(UI *r,int idx,void *arg); + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int UI_set_ex_data(UI *r, int idx, void *arg); void *UI_get_ex_data(UI *r, int idx); /* Use specific methods instead of the built-in one */ @@ -292,15 +292,14 @@ DECLARE_STACK_OF(UI_STRING) /* The different types of strings that are currently supported. This is only needed by method authors. */ -enum UI_string_types - { - UIT_NONE=0, +enum UI_string_types { + UIT_NONE = 0, UIT_PROMPT, /* Prompt for a string */ UIT_VERIFY, /* Prompt for a string and verify */ UIT_BOOLEAN, /* Prompt for a yes/no response */ UIT_INFO, /* Send info to the user */ UIT_ERROR /* Send an error message to the user */ - }; +}; /* Create and manipulate methods */ 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 int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui)); int UI_method_set_prompt_constructor(UI_METHOD *method, char *(*prompt_constructor)(UI* ui, const char* object_desc, const char* object_name)); int (*UI_method_get_opener(UI_METHOD *method))(UI*); -int (*UI_method_get_writer(UI_METHOD *method))(UI*,UI_STRING*); +int (*UI_method_get_writer(UI_METHOD *method))(UI*, UI_STRING*); int (*UI_method_get_flusher(UI_METHOD *method))(UI*); -int (*UI_method_get_reader(UI_METHOD *method))(UI*,UI_STRING*); +int (*UI_method_get_reader(UI_METHOD *method))(UI*, UI_STRING*); int (*UI_method_get_closer(UI_METHOD *method))(UI*); char * (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const char*, const char*); @@ -342,8 +341,8 @@ int UI_set_result(UI *ui, UI_STRING *uis, const char *result); /* A couple of popular utility functions */ -int UI_UTIL_read_pw_string(char *buf,int length,const char *prompt,int verify); -int UI_UTIL_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); +int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt, int verify); +int UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt, int verify); /* BEGIN ERROR CODES */ -- cgit v1.2.3-55-g6feb