OLD | NEW |
1 /* crypto/ui/ui_lib.c -*- mode:C; c-file-style: "eay" -*- */ | 1 /* crypto/ui/ui_lib.c -*- mode:C; c-file-style: "eay" -*- */ |
2 /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL | 2 /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL |
3 * project 2001. | 3 * project 2001. |
4 */ | 4 */ |
5 /* ==================================================================== | 5 /* ==================================================================== |
6 * Copyright (c) 2001 The OpenSSL Project. All rights reserved. | 6 * Copyright (c) 2001 The OpenSSL Project. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 { | 686 { |
687 if (method) | 687 if (method) |
688 { | 688 { |
689 method->ui_close_session = closer; | 689 method->ui_close_session = closer; |
690 return 0; | 690 return 0; |
691 } | 691 } |
692 else | 692 else |
693 return -1; | 693 return -1; |
694 } | 694 } |
695 | 695 |
| 696 int UI_method_set_prompt_constructor(UI_METHOD *method, char *(*prompt_construct
or)(UI* ui, const char* object_desc, const char* object_name)) |
| 697 { |
| 698 if (method) |
| 699 { |
| 700 method->ui_construct_prompt = prompt_constructor; |
| 701 return 0; |
| 702 } |
| 703 else |
| 704 return -1; |
| 705 } |
| 706 |
696 int (*UI_method_get_opener(UI_METHOD *method))(UI*) | 707 int (*UI_method_get_opener(UI_METHOD *method))(UI*) |
697 { | 708 { |
698 if (method) | 709 if (method) |
699 return method->ui_open_session; | 710 return method->ui_open_session; |
700 else | 711 else |
701 return NULL; | 712 return NULL; |
702 } | 713 } |
703 | 714 |
704 int (*UI_method_get_writer(UI_METHOD *method))(UI*,UI_STRING*) | 715 int (*UI_method_get_writer(UI_METHOD *method))(UI*,UI_STRING*) |
705 { | 716 { |
(...skipping 20 matching lines...) Expand all Loading... |
726 } | 737 } |
727 | 738 |
728 int (*UI_method_get_closer(UI_METHOD *method))(UI*) | 739 int (*UI_method_get_closer(UI_METHOD *method))(UI*) |
729 { | 740 { |
730 if (method) | 741 if (method) |
731 return method->ui_close_session; | 742 return method->ui_close_session; |
732 else | 743 else |
733 return NULL; | 744 return NULL; |
734 } | 745 } |
735 | 746 |
| 747 char* (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const char*, c
onst char*) |
| 748 { |
| 749 if (method) |
| 750 return method->ui_construct_prompt; |
| 751 else |
| 752 return NULL; |
| 753 } |
| 754 |
736 enum UI_string_types UI_get_string_type(UI_STRING *uis) | 755 enum UI_string_types UI_get_string_type(UI_STRING *uis) |
737 { | 756 { |
738 if (!uis) | 757 if (!uis) |
739 return UIT_NONE; | 758 return UIT_NONE; |
740 return uis->type; | 759 return uis->type; |
741 } | 760 } |
742 | 761 |
743 int UI_get_input_flags(UI_STRING *uis) | 762 int UI_get_input_flags(UI_STRING *uis) |
744 { | 763 { |
745 if (!uis) | 764 if (!uis) |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 uis->_.boolean_data.cancel_chars[0]; | 915 uis->_.boolean_data.cancel_chars[0]; |
897 break; | 916 break; |
898 } | 917 } |
899 } | 918 } |
900 default: | 919 default: |
901 break; | 920 break; |
902 } | 921 } |
903 } | 922 } |
904 return 0; | 923 return 0; |
905 } | 924 } |
OLD | NEW |