ply_boot_client_response_handler_t handler;
ply_boot_client_response_handler_t failed_handler;
void *user_data;
- bool nowait;
} ply_boot_client_request_t;
static void ply_boot_client_cancel_request (ply_boot_client_t *client,
const char *request_argument,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
ply_boot_client_request_t *request;
request->handler = handler;
request->failed_handler = failed_handler;
request->user_data = user_data;
- request->nowait = nowait;
return request;
}
}
free (request_string);
- if (request->nowait)
- {
- if (request->handler != NULL)
- request->handler (request->user_data, client);
-
- request->handler = NULL;
- request->failed_handler = NULL;
- }
-
if (client->daemon_has_reply_watch == NULL)
{
assert (ply_list_get_length (client->requests_waiting_for_replies) == 0);
if (ply_list_get_length (client->requests_to_send) == 0)
{
- if (client->daemon_can_take_request_watch != NULL)
+ if (client->daemon_has_reply_watch != NULL)
{
assert (client->loop != NULL);
const char *request_argument,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
assert (client != NULL);
assert (client->loop != NULL);
request = ply_boot_client_request_new (client, request_command,
request_argument,
- handler, failed_handler, user_data,
- nowait);
+ handler, failed_handler, user_data);
ply_list_append_data (client->requests_to_send, request);
}
}
assert (client != NULL);
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_PING,
- NULL, handler, failed_handler, user_data, false);
+ NULL, handler, failed_handler, user_data);
}
void
const char *status,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
assert (client != NULL);
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_UPDATE,
- status, handler, failed_handler, user_data, nowait);
+ status, handler, failed_handler, user_data);
}
void
const char *root_dir,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
assert (client != NULL);
assert (root_dir != NULL);
ply_boot_client_queue_request(client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_NEWROOT,
- root_dir, handler, failed_handler, user_data, nowait);
+ root_dir, handler, failed_handler, user_data);
}
void
const char *message,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
assert (client != NULL);
assert (message != NULL);
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_SHOW_MESSAGE,
- message, handler, failed_handler, user_data, nowait);
+ message, handler, failed_handler, user_data);
}
void
const char *message,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
assert (client != NULL);
assert (message != NULL);
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_HIDE_MESSAGE,
- message, handler, failed_handler, user_data, nowait);
+ message, handler, failed_handler, user_data);
}
void
ply_boot_client_tell_daemon_system_is_initialized (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
assert (client != NULL);
ply_boot_client_queue_request (client,
PLY_BOOT_PROTOCOL_REQUEST_TYPE_SYSTEM_INITIALIZED,
- NULL, handler, failed_handler, user_data, nowait);
+ NULL, handler, failed_handler, user_data);
}
void
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_PASSWORD,
prompt, (ply_boot_client_response_handler_t)
- handler, failed_handler, user_data, false);
+ handler, failed_handler, user_data);
}
void
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_CACHED_PASSWORD,
NULL, (ply_boot_client_response_handler_t)
- handler, failed_handler, user_data, false);
+ handler, failed_handler, user_data);
}
void
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_QUESTION,
prompt, (ply_boot_client_response_handler_t)
- handler, failed_handler, user_data, false);
+ handler, failed_handler, user_data);
}
void
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_KEYSTROKE,
keys, (ply_boot_client_response_handler_t)
- handler, failed_handler, user_data, false);
+ handler, failed_handler, user_data);
}
void
const char *keys,
ply_boot_client_answer_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
assert (client != NULL);
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_KEYSTROKE_REMOVE,
keys, (ply_boot_client_response_handler_t)
- handler, failed_handler, user_data, nowait);
+ handler, failed_handler, user_data);
}
void
ply_boot_client_tell_daemon_to_show_splash (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
assert (client != NULL);
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_SHOW_SPLASH,
- NULL, handler, failed_handler, user_data, nowait);
+ NULL, handler, failed_handler, user_data);
}
void
ply_boot_client_tell_daemon_to_hide_splash (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
assert (client != NULL);
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_HIDE_SPLASH,
- NULL, handler, failed_handler, user_data, nowait);
+ NULL, handler, failed_handler, user_data);
}
void
ply_boot_client_tell_daemon_to_deactivate (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
assert (client != NULL);
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_DEACTIVATE,
- NULL, handler, failed_handler, user_data, nowait);
+ NULL, handler, failed_handler, user_data);
}
void
ply_boot_client_tell_daemon_to_reactivate (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
assert (client != NULL);
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_REACTIVATE,
- NULL, handler, failed_handler, user_data, nowait);
+ NULL, handler, failed_handler, user_data);
}
void
bool retain_splash,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
char arg[2] = "";
arg[0] = (char) (retain_splash != false);
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_QUIT,
- arg, handler, failed_handler, user_data, nowait);
+ arg, handler, failed_handler, user_data);
}
void
ply_boot_client_tell_daemon_to_progress_pause (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_PROGRESS_PAUSE,
- NULL, handler, failed_handler, user_data, nowait);
+ NULL, handler, failed_handler, user_data);
}
void
ply_boot_client_tell_daemon_to_progress_unpause (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_PROGRESS_UNPAUSE,
- NULL, handler, failed_handler, user_data, nowait);
+ NULL, handler, failed_handler, user_data);
}
void
ply_boot_client_ask_daemon_has_active_vt (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_HAS_ACTIVE_VT,
- NULL, handler, failed_handler, user_data, nowait);
+ NULL, handler, failed_handler, user_data);
}
void
ply_boot_client_tell_daemon_about_error (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait)
+ void *user_data)
{
ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_ERROR,
- NULL, handler, failed_handler, user_data, nowait);
+ NULL, handler, failed_handler, user_data);
}
void
const char *new_status,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_tell_daemon_to_change_root (ply_boot_client_t *client,
const char *chroot_dir,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_tell_daemon_to_display_message (ply_boot_client_t *client,
const char *message,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_tell_daemon_to_hide_message (ply_boot_client_t *client,
const char *message,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_ask_daemon_for_password (ply_boot_client_t *client,
const char *prompt,
ply_boot_client_answer_handler_t handler,
const char *keys,
ply_boot_client_answer_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_tell_daemon_system_is_initialized (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_tell_daemon_to_show_splash (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_tell_daemon_to_hide_splash (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_tell_daemon_to_deactivate (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_tell_daemon_to_reactivate (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_tell_daemon_to_quit (ply_boot_client_t *client,
bool retain_splash,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_tell_daemon_to_progress_pause (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_tell_daemon_to_progress_unpause (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_ask_daemon_has_active_vt (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
void ply_boot_client_disconnect (ply_boot_client_t *client);
void ply_boot_client_attach_to_event_loop (ply_boot_client_t *client,
ply_event_loop_t *loop);
void ply_boot_client_tell_daemon_about_error (ply_boot_client_t *client,
ply_boot_client_response_handler_t handler,
ply_boot_client_response_handler_t failed_handler,
- void *user_data,
- bool nowait);
+ void *user_data);
#endif
ply_event_loop_t *loop;
ply_boot_client_t *client;
ply_command_parser_t *command_parser;
- bool nowait;
char kernel_command_line[PLY_MAX_COMMAND_LINE_SIZE];
} state_t;
(WEXITSTATUS (exit_status) ? on_failure : on_success),
(ply_boot_client_response_handler_t)
on_failure,
- answer_state->state,
- false);
+ answer_state->state);
}
else
ply_event_loop_exit (answer_state->state->loop, WEXITSTATUS (exit_status));
on_success,
(ply_boot_client_response_handler_t)
on_failure,
- answer_state->state,
- false);
+ answer_state->state);
else
ply_event_loop_exit (answer_state->state->loop, 0);
}
on_failure,
(ply_boot_client_response_handler_t)
on_failure,
- answer_state->state,
- false);
+ answer_state->state);
else
ply_event_loop_exit (answer_state->state->loop, 1);
}
on_password_request_execute,
(ply_boot_client_response_handler_t)
on_password_answer_failure,
- password_answer_state,
- false);
+ password_answer_state);
}
else
{
on_question_request_execute,
(ply_boot_client_response_handler_t)
on_question_answer_failure,
- question_answer_state,
- false);
+ question_answer_state);
}
else
{
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state, state->nowait);
+ on_failure, state);
free (text);
}
}
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state, state->nowait);
+ on_failure, state);
free (text);
}
}
(ply_boot_client_answer_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state, state->nowait);
+ on_failure, state);
}
static void
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state, state->nowait);
+ on_failure, state);
}
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state, state->nowait);
+ on_failure, state);
}
static void
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state, state->nowait);
+ on_failure, state);
}
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state, state->nowait);
+ on_failure, state);
}
static void
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state, state->nowait);
+ on_failure, state);
}
static void
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state,
- state->nowait);
+ on_failure, state);
}
static bool
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state, state->nowait);
+ on_failure, state);
}
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state, state->nowait);
+ on_failure, state);
}
}
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state, state->nowait);
+ on_failure, state);
}
static void
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state, state->nowait);
+ on_failure, state);
}
static void
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, state, state->nowait);
+ on_failure, state);
}
}
"update", "Tell boot daemon an update about boot progress", PLY_COMMAND_OPTION_TYPE_STRING,
"details", "Tell boot daemon there were errors during boot", PLY_COMMAND_OPTION_TYPE_FLAG,
"wait", "Wait for boot daemon to quit", PLY_COMMAND_OPTION_TYPE_FLAG,
- "nowait", "Don't wait for boot daemon to reply", PLY_COMMAND_OPTION_TYPE_FLAG,
NULL);
ply_command_parser_add_command (state.command_parser,
"ignore-keystroke", &ignore_keystroke,
"update", &status,
"wait", &should_wait,
- "nowait", &state.nowait,
"details", &report_error,
NULL);
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, &state, state.nowait);
+ on_failure, &state);
else if (should_hide_splash)
ply_boot_client_tell_daemon_to_hide_splash (state.client,
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, &state, state.nowait);
+ on_failure, &state);
else if (should_quit)
ply_boot_client_tell_daemon_to_quit (state.client,
false,
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, &state, state.nowait);
+ on_failure, &state);
else if (should_ping)
ply_boot_client_ping_daemon (state.client,
(ply_boot_client_response_handler_t)
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, &state, state.nowait);
+ on_failure, &state);
else if (status != NULL)
ply_boot_client_update_daemon (state.client, status,
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, &state, state.nowait);
+ on_failure, &state);
else if (should_ask_for_password)
{
password_answer_state_t answer_state = { 0 };
(ply_boot_client_answer_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, &state, state.nowait);
+ on_failure, &state);
}
else if (should_sysinit)
ply_boot_client_tell_daemon_system_is_initialized (state.client,
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, &state, state.nowait);
+ on_failure, &state);
else if (chroot_dir)
ply_boot_client_tell_daemon_to_change_root (state.client, chroot_dir,
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, &state, state.nowait);
+ on_failure, &state);
else if (should_wait)
{} // Do nothing
(ply_boot_client_response_handler_t)
on_success,
(ply_boot_client_response_handler_t)
- on_failure, &state, state.nowait);
+ on_failure, &state);
exit_code = ply_event_loop_run (state.loop);