diff options
| author | Ray Strode <rstrode@redhat.com> | 2008-06-02 11:49:00 -0400 |
|---|---|---|
| committer | Ray Strode <rstrode@redhat.com> | 2008-06-02 11:49:00 -0400 |
| commit | f5a15611fb5fe1d36f8922e1c2a6f751ab0b8df7 (patch) | |
| tree | f44de427f359bdc19b76bf440cde0c4181d27d9e /src/splash-plugins/text | |
| parent | ccd95672582f2cfc98d0d6985603bda84f48f170 (diff) | |
| download | plymouth-f5a15611fb5fe1d36f8922e1c2a6f751ab0b8df7.tar.gz plymouth-f5a15611fb5fe1d36f8922e1c2a6f751ab0b8df7.tar.xz plymouth-f5a15611fb5fe1d36f8922e1c2a6f751ab0b8df7.zip | |
Port password handling over to using new answer object
Diffstat (limited to 'src/splash-plugins/text')
| -rw-r--r-- | src/splash-plugins/text/Makefile.am | 2 | ||||
| -rw-r--r-- | src/splash-plugins/text/plugin.c | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/splash-plugins/text/Makefile.am b/src/splash-plugins/text/Makefile.am index 27b2cf7..2d9ba73 100644 --- a/src/splash-plugins/text/Makefile.am +++ b/src/splash-plugins/text/Makefile.am @@ -11,6 +11,8 @@ text_la_CFLAGS = $(PLYMOUTH_CFLAGS) text_la_LDFLAGS = -module -avoid-version -export-dynamic text_la_LIBADD = $(PLYMOUTH_LIBS) ../../libply/libply.la text_la_SOURCES = $(srcdir)/../../ply-boot-splash-plugin.h \ + $(srcdir)/../../ply-answer.h \ + $(srcdir)/../../ply-answer.c \ $(srcdir)/../../ply-window.h \ $(srcdir)/../../ply-window.c \ $(srcdir)/plugin.c diff --git a/src/splash-plugins/text/plugin.c b/src/splash-plugins/text/plugin.c index a342fa7..3ad9234 100644 --- a/src/splash-plugins/text/plugin.c +++ b/src/splash-plugins/text/plugin.c @@ -40,6 +40,7 @@ #include <values.h> #include <wchar.h> +#include "ply-answer.h" #include "ply-boot-splash-plugin.h" #include "ply-buffer.h" #include "ply-event-loop.h" @@ -60,8 +61,8 @@ struct _ply_boot_splash_plugin ply_event_loop_t *loop; int console_fd; - ply_boot_splash_password_answer_handler_t password_answer_handler; - void *password_answer_data; + + ply_answer_t *pending_password_answer; uint32_t keyboard_input_is_hidden : 1; }; @@ -132,12 +133,11 @@ void on_enter (ply_boot_splash_plugin_t *plugin, const char *line) { - if (plugin->password_answer_handler != NULL) + if (plugin->pending_password_answer != NULL) { - plugin->password_answer_handler (plugin->password_answer_data, - line); + ply_answer_with_string (plugin->pending_password_answer, line); plugin->keyboard_input_is_hidden = false; - plugin->password_answer_handler = NULL; + plugin->pending_password_answer = NULL; write (STDOUT_FILENO, CLEAR_LINE_SEQUENCE, strlen (CLEAR_LINE_SEQUENCE)); } } @@ -207,11 +207,9 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin, void ask_for_password (ply_boot_splash_plugin_t *plugin, - ply_boot_splash_password_answer_handler_t answer_handler, - void *answer_data) + ply_answer_t *answer) { - plugin->password_answer_handler = answer_handler; - plugin->password_answer_data = answer_data; + plugin->pending_password_answer = answer; write (STDOUT_FILENO, "\nPassword: ", strlen ("\nPassword: ")); plugin->keyboard_input_is_hidden = true; |
