Lines Matching refs:ui
117 void UI_free(UI *ui) in UI_free() argument
119 if (ui == NULL) in UI_free()
121 sk_UI_STRING_pop_free(ui->strings,free_string); in UI_free()
122 CRYPTO_free_ex_data(CRYPTO_EX_INDEX_UI, ui, &ui->ex_data); in UI_free()
123 OPENSSL_free(ui); in UI_free()
126 static int allocate_string_stack(UI *ui) in allocate_string_stack() argument
128 if (ui->strings == NULL) in allocate_string_stack()
130 ui->strings=sk_UI_STRING_new_null(); in allocate_string_stack()
131 if (ui->strings == NULL) in allocate_string_stack()
139 static UI_STRING *general_allocate_prompt(UI *ui, const char *prompt, in general_allocate_prompt() argument
165 static int general_allocate_string(UI *ui, const char *prompt, in general_allocate_string() argument
170 UI_STRING *s = general_allocate_prompt(ui, prompt, prompt_freeable, in general_allocate_string()
175 if (allocate_string_stack(ui) >= 0) in general_allocate_string()
180 ret=sk_UI_STRING_push(ui->strings, s); in general_allocate_string()
190 static int general_allocate_boolean(UI *ui, in general_allocate_boolean() argument
219 s = general_allocate_prompt(ui, prompt, prompt_freeable, in general_allocate_boolean()
224 if (allocate_string_stack(ui) >= 0) in general_allocate_boolean()
229 ret=sk_UI_STRING_push(ui->strings, s); in general_allocate_boolean()
243 int UI_add_input_string(UI *ui, const char *prompt, int flags, in UI_add_input_string() argument
246 return general_allocate_string(ui, prompt, 0, in UI_add_input_string()
251 int UI_dup_input_string(UI *ui, const char *prompt, int flags, in UI_dup_input_string() argument
266 return general_allocate_string(ui, prompt_copy, 1, in UI_dup_input_string()
270 int UI_add_verify_string(UI *ui, const char *prompt, int flags, in UI_add_verify_string() argument
273 return general_allocate_string(ui, prompt, 0, in UI_add_verify_string()
277 int UI_dup_verify_string(UI *ui, const char *prompt, int flags, in UI_dup_verify_string() argument
292 return general_allocate_string(ui, prompt_copy, 1, in UI_dup_verify_string()
296 int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc, in UI_add_input_boolean() argument
300 return general_allocate_boolean(ui, prompt, action_desc, in UI_add_input_boolean()
304 int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, in UI_dup_input_boolean() argument
353 return general_allocate_boolean(ui, prompt_copy, action_desc_copy, in UI_dup_input_boolean()
364 int UI_add_info_string(UI *ui, const char *text) in UI_add_info_string() argument
366 return general_allocate_string(ui, text, 0, UIT_INFO, 0, NULL, 0, 0, in UI_add_info_string()
370 int UI_dup_info_string(UI *ui, const char *text) in UI_dup_info_string() argument
384 return general_allocate_string(ui, text_copy, 1, UIT_INFO, 0, NULL, in UI_dup_info_string()
388 int UI_add_error_string(UI *ui, const char *text) in UI_add_error_string() argument
390 return general_allocate_string(ui, text, 0, UIT_ERROR, 0, NULL, 0, 0, in UI_add_error_string()
394 int UI_dup_error_string(UI *ui, const char *text) in UI_dup_error_string() argument
407 return general_allocate_string(ui, text_copy, 1, UIT_ERROR, 0, NULL, in UI_dup_error_string()
411 char *UI_construct_prompt(UI *ui, const char *object_desc, in UI_construct_prompt() argument
416 if (ui->meth->ui_construct_prompt) in UI_construct_prompt()
417 prompt = ui->meth->ui_construct_prompt(ui, in UI_construct_prompt()
446 void *UI_add_user_data(UI *ui, void *user_data) in UI_add_user_data() argument
448 void *old_data = ui->user_data; in UI_add_user_data()
449 ui->user_data = user_data; in UI_add_user_data()
453 void *UI_get0_user_data(UI *ui) in UI_get0_user_data() argument
455 return ui->user_data; in UI_get0_user_data()
458 const char *UI_get0_result(UI *ui, int i) in UI_get0_result() argument
465 if (i >= sk_UI_STRING_num(ui->strings)) in UI_get0_result()
470 return UI_get0_result_string(sk_UI_STRING_value(ui->strings, i)); in UI_get0_result()
473 static int print_error(const char *str, size_t len, UI *ui) in print_error() argument
481 if (ui->meth->ui_write_string in print_error()
482 && !ui->meth->ui_write_string(ui, &uis)) in print_error()
487 int UI_process(UI *ui) in UI_process() argument
491 if (ui->meth->ui_open_session && !ui->meth->ui_open_session(ui)) in UI_process()
494 if (ui->flags & UI_FLAG_PRINT_ERRORS) in UI_process()
497 (void *)ui); in UI_process()
499 for(i=0; i<sk_UI_STRING_num(ui->strings); i++) in UI_process()
501 if (ui->meth->ui_write_string in UI_process()
502 && !ui->meth->ui_write_string(ui, in UI_process()
503 sk_UI_STRING_value(ui->strings, i))) in UI_process()
510 if (ui->meth->ui_flush) in UI_process()
511 switch(ui->meth->ui_flush(ui)) in UI_process()
524 for(i=0; i<sk_UI_STRING_num(ui->strings); i++) in UI_process()
526 if (ui->meth->ui_read_string) in UI_process()
528 switch(ui->meth->ui_read_string(ui, in UI_process()
529 sk_UI_STRING_value(ui->strings, i))) in UI_process()
544 if (ui->meth->ui_close_session && !ui->meth->ui_close_session(ui)) in UI_process()
549 int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f)(void)) in UI_ctrl() argument
551 if (ui == NULL) in UI_ctrl()
560 int save_flag = !!(ui->flags & UI_FLAG_PRINT_ERRORS); in UI_ctrl()
562 ui->flags |= UI_FLAG_PRINT_ERRORS; in UI_ctrl()
564 ui->flags &= ~UI_FLAG_PRINT_ERRORS; in UI_ctrl()
568 return !!(ui->flags & UI_FLAG_REDOABLE); in UI_ctrl()
607 const UI_METHOD *UI_get_method(UI *ui) in UI_get_method() argument
609 return ui->meth; in UI_get_method()
612 const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth) in UI_set_method() argument
614 ui->meth=meth; in UI_set_method()
615 return ui->meth; in UI_set_method()
641 int UI_method_set_opener(UI_METHOD *method, int (*opener)(UI *ui)) in UI_method_set_opener() argument
652 int UI_method_set_writer(UI_METHOD *method, int (*writer)(UI *ui, UI_STRING *uis)) in UI_method_set_writer() argument
663 int UI_method_set_flusher(UI_METHOD *method, int (*flusher)(UI *ui)) in UI_method_set_flusher() argument
674 int UI_method_set_reader(UI_METHOD *method, int (*reader)(UI *ui, UI_STRING *uis)) in UI_method_set_reader() argument
685 int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui)) in UI_method_set_closer() argument
696 int UI_method_set_prompt_constructor(UI_METHOD *method, char *(*prompt_constructor)(UI* ui, const c… in UI_method_set_prompt_constructor() argument
845 int UI_set_result(UI *ui, UI_STRING *uis, const char *result) in UI_set_result() argument
849 ui->flags &= ~UI_FLAG_REDOABLE; in UI_set_result()
868 ui->flags |= UI_FLAG_REDOABLE; in UI_set_result()
876 ui->flags |= UI_FLAG_REDOABLE; in UI_set_result()