summaryrefslogtreecommitdiffstats
path: root/src/splash-plugins/text
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2008-06-02 11:49:00 -0400
committerRay Strode <rstrode@redhat.com>2008-06-02 11:49:00 -0400
commitf5a15611fb5fe1d36f8922e1c2a6f751ab0b8df7 (patch)
treef44de427f359bdc19b76bf440cde0c4181d27d9e /src/splash-plugins/text
parentccd95672582f2cfc98d0d6985603bda84f48f170 (diff)
downloadplymouth-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.am2
-rw-r--r--src/splash-plugins/text/plugin.c18
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;