stkagent: Use bool instead of gboolean / ofono_bool_t

This commit is contained in:
Denis Kenzior 2018-12-28 13:40:34 -06:00
parent f13047bf93
commit 4927905db4
3 changed files with 77 additions and 77 deletions

View File

@ -1454,8 +1454,7 @@ static void set_get_inkey_duration(struct stk_duration *duration,
} }
static void request_confirmation_cb(enum stk_agent_result result, static void request_confirmation_cb(enum stk_agent_result result,
gboolean confirm, bool confirm, void *user_data)
void *user_data)
{ {
struct ofono_stk *stk = user_data; struct ofono_stk *stk = user_data;
static struct ofono_error error = { .type = OFONO_ERROR_TYPE_FAILURE }; static struct ofono_error error = { .type = OFONO_ERROR_TYPE_FAILURE };
@ -1761,7 +1760,7 @@ static void call_setup_cancel(struct ofono_stk *stk)
__ofono_voicecall_dial_cancel(vc); __ofono_voicecall_dial_cancel(vc);
} }
static void confirm_call_cb(enum stk_agent_result result, gboolean confirm, static void confirm_call_cb(enum stk_agent_result result, bool confirm,
void *user_data) void *user_data)
{ {
struct ofono_stk *stk = user_data; struct ofono_stk *stk = user_data;
@ -1779,7 +1778,7 @@ static void confirm_call_cb(enum stk_agent_result result, gboolean confirm,
switch (result) { switch (result) {
case STK_AGENT_RESULT_TIMEOUT: case STK_AGENT_RESULT_TIMEOUT:
confirm = FALSE; confirm = false;
/* Fall through */ /* Fall through */
case STK_AGENT_RESULT_OK: case STK_AGENT_RESULT_OK:
@ -1865,7 +1864,7 @@ static void confirm_call_cb(enum stk_agent_result result, gboolean confirm,
} }
static void confirm_handled_call_cb(enum stk_agent_result result, static void confirm_handled_call_cb(enum stk_agent_result result,
gboolean confirm, void *user_data) bool confirm, void *user_data)
{ {
struct ofono_stk *stk = user_data; struct ofono_stk *stk = user_data;
const struct stk_command_setup_call *sc = const struct stk_command_setup_call *sc =
@ -2683,7 +2682,7 @@ static gboolean handle_command_play_tone(const struct stk_command *cmd,
} }
static void confirm_launch_browser_cb(enum stk_agent_result result, static void confirm_launch_browser_cb(enum stk_agent_result result,
gboolean confirm, bool confirm,
void *user_data) void *user_data)
{ {
struct ofono_stk *stk = user_data; struct ofono_stk *stk = user_data;
@ -2693,7 +2692,7 @@ static void confirm_launch_browser_cb(enum stk_agent_result result,
switch (result) { switch (result) {
case STK_AGENT_RESULT_TIMEOUT: case STK_AGENT_RESULT_TIMEOUT:
confirm = FALSE; confirm = false;
/* Fall through */ /* Fall through */
case STK_AGENT_RESULT_OK: case STK_AGENT_RESULT_OK:

View File

@ -29,6 +29,7 @@
#include <glib.h> #include <glib.h>
#include <gdbus.h> #include <gdbus.h>
#include <ell/ell.h>
#include "ofono.h" #include "ofono.h"
@ -51,7 +52,7 @@ struct stk_agent {
char *path; /* Agent Path */ char *path; /* Agent Path */
char *bus; /* Agent bus */ char *bus; /* Agent bus */
guint disconnect_watch; /* DBus disconnect watch */ guint disconnect_watch; /* DBus disconnect watch */
ofono_bool_t remove_on_terminate; bool remove_on_terminate;
ofono_destroy_func removed_cb; ofono_destroy_func removed_cb;
void *removed_data; void *removed_data;
DBusMessage *msg; DBusMessage *msg;
@ -60,7 +61,7 @@ struct stk_agent {
void *user_data; void *user_data;
int min_length; int min_length;
int max_length; int max_length;
ofono_bool_t hidden_entry; bool hidden_entry;
ofono_destroy_func user_destroy; ofono_destroy_func user_destroy;
const struct stk_menu *request_selection_menu; const struct stk_menu *request_selection_menu;
@ -117,7 +118,7 @@ static void stk_agent_request_end(struct stk_agent *agent)
agent->user_cb = NULL; agent->user_cb = NULL;
} }
ofono_bool_t stk_agent_matches(struct stk_agent *agent, bool stk_agent_matches(struct stk_agent *agent,
const char *path, const char *sender) const char *path, const char *sender)
{ {
return !strcmp(agent->path, path) && !strcmp(agent->bus, sender); return !strcmp(agent->path, path) && !strcmp(agent->bus, sender);
@ -227,7 +228,7 @@ static void stk_agent_disconnect_cb(DBusConnection *conn, void *user_data)
} }
struct stk_agent *stk_agent_new(const char *path, const char *sender, struct stk_agent *stk_agent_new(const char *path, const char *sender,
ofono_bool_t remove_on_terminate) bool remove_on_terminate)
{ {
struct stk_agent *agent = g_try_new0(struct stk_agent, 1); struct stk_agent *agent = g_try_new0(struct stk_agent, 1);
DBusConnection *conn = ofono_dbus_get_connection(); DBusConnection *conn = ofono_dbus_get_connection();
@ -287,9 +288,9 @@ void append_menu_items_variant(DBusMessageIter *iter,
done: \ done: \
if (result == STK_AGENT_RESULT_TERMINATE && \ if (result == STK_AGENT_RESULT_TERMINATE && \
agent->remove_on_terminate) \ agent->remove_on_terminate) \
remove_agent = TRUE; \ remove_agent = true; \
else \ else \
remove_agent = FALSE; \ remove_agent = false; \
\ \
error: \ error: \
stk_agent_request_end(agent); \ stk_agent_request_end(agent); \
@ -306,12 +307,12 @@ static void request_selection_cb(DBusPendingCall *call, void *data)
DBusMessage *reply = dbus_pending_call_steal_reply(call); DBusMessage *reply = dbus_pending_call_steal_reply(call);
unsigned char selection, i; unsigned char selection, i;
enum stk_agent_result result; enum stk_agent_result result;
gboolean remove_agent; bool remove_agent;
if (check_error(agent, reply, if (check_error(agent, reply,
ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE, ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE,
&result) == -EINVAL) { &result) == -EINVAL) {
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -324,7 +325,7 @@ static void request_selection_cb(DBusPendingCall *call, void *data)
DBUS_TYPE_BYTE, &selection, DBUS_TYPE_BYTE, &selection,
DBUS_TYPE_INVALID) == FALSE) { DBUS_TYPE_INVALID) == FALSE) {
ofono_error("Can't parse the reply to RequestSelection()"); ofono_error("Can't parse the reply to RequestSelection()");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -332,7 +333,7 @@ static void request_selection_cb(DBusPendingCall *call, void *data)
if (i != selection) { if (i != selection) {
ofono_error("Invalid item selected"); ofono_error("Invalid item selected");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -387,12 +388,12 @@ static void display_text_cb(DBusPendingCall *call, void *data)
stk_agent_display_text_cb cb = agent->user_cb; stk_agent_display_text_cb cb = agent->user_cb;
DBusMessage *reply = dbus_pending_call_steal_reply(call); DBusMessage *reply = dbus_pending_call_steal_reply(call);
enum stk_agent_result result; enum stk_agent_result result;
gboolean remove_agent; bool remove_agent;
if (check_error(agent, reply, if (check_error(agent, reply,
ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE | ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE |
ALLOWED_ERROR_BUSY, &result) == -EINVAL) { ALLOWED_ERROR_BUSY, &result) == -EINVAL) {
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -403,7 +404,7 @@ static void display_text_cb(DBusPendingCall *call, void *data)
if (dbus_message_get_args(reply, NULL, DBUS_TYPE_INVALID) == FALSE) { if (dbus_message_get_args(reply, NULL, DBUS_TYPE_INVALID) == FALSE) {
ofono_error("Can't parse the reply to DisplayText()"); ofono_error("Can't parse the reply to DisplayText()");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -414,7 +415,7 @@ static void display_text_cb(DBusPendingCall *call, void *data)
int stk_agent_display_text(struct stk_agent *agent, const char *text, int stk_agent_display_text(struct stk_agent *agent, const char *text,
const struct stk_icon_id *icon, const struct stk_icon_id *icon,
ofono_bool_t urgent, bool urgent,
stk_agent_display_text_cb cb, stk_agent_display_text_cb cb,
void *user_data, ofono_destroy_func destroy, void *user_data, ofono_destroy_func destroy,
int timeout) int timeout)
@ -455,18 +456,18 @@ static void get_confirmation_cb(DBusPendingCall *call, void *data)
stk_agent_confirmation_cb cb = agent->user_cb; stk_agent_confirmation_cb cb = agent->user_cb;
DBusMessage *reply = dbus_pending_call_steal_reply(call); DBusMessage *reply = dbus_pending_call_steal_reply(call);
enum stk_agent_result result; enum stk_agent_result result;
gboolean remove_agent; bool remove_agent;
dbus_bool_t confirm; dbus_bool_t confirm;
if (check_error(agent, reply, if (check_error(agent, reply,
ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE, ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE,
&result) == -EINVAL) { &result) == -EINVAL) {
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
if (result != STK_AGENT_RESULT_OK) { if (result != STK_AGENT_RESULT_OK) {
cb(result, FALSE, agent->user_data); cb(result, false, agent->user_data);
goto done; goto done;
} }
@ -474,7 +475,7 @@ static void get_confirmation_cb(DBusPendingCall *call, void *data)
DBUS_TYPE_BOOLEAN, &confirm, DBUS_TYPE_BOOLEAN, &confirm,
DBUS_TYPE_INVALID) == FALSE) { DBUS_TYPE_INVALID) == FALSE) {
ofono_error("Can't parse the reply to GetConfirmation()"); ofono_error("Can't parse the reply to GetConfirmation()");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -524,13 +525,13 @@ static void get_digit_cb(DBusPendingCall *call, void *data)
stk_agent_string_cb cb = agent->user_cb; stk_agent_string_cb cb = agent->user_cb;
DBusMessage *reply = dbus_pending_call_steal_reply(call); DBusMessage *reply = dbus_pending_call_steal_reply(call);
enum stk_agent_result result; enum stk_agent_result result;
gboolean remove_agent; bool remove_agent;
char *digit; char *digit;
if (check_error(agent, reply, if (check_error(agent, reply,
ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE, ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE,
&result) == -EINVAL) { &result) == -EINVAL) {
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -543,19 +544,19 @@ static void get_digit_cb(DBusPendingCall *call, void *data)
DBUS_TYPE_STRING, &digit, DBUS_TYPE_STRING, &digit,
DBUS_TYPE_INVALID) == FALSE) { DBUS_TYPE_INVALID) == FALSE) {
ofono_error("Can't parse the reply to GetDigit()"); ofono_error("Can't parse the reply to GetDigit()");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
if (strlen(digit) != 1 || !strspn(digit, "0123456789*#+")) { if (strlen(digit) != 1 || !strspn(digit, "0123456789*#+")) {
ofono_error("Invalid character"); ofono_error("Invalid character");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
if (agent->hidden_entry && digit[0] == '+') { if (agent->hidden_entry && digit[0] == '+') {
ofono_error("The character + is not allowed in this mode"); ofono_error("The character + is not allowed in this mode");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -590,7 +591,7 @@ int stk_agent_request_digit(struct stk_agent *agent, const char *text,
agent->user_cb = cb; agent->user_cb = cb;
agent->user_data = user_data; agent->user_data = user_data;
agent->user_destroy = destroy; agent->user_destroy = destroy;
agent->hidden_entry = FALSE; agent->hidden_entry = false;
dbus_pending_call_set_notify(agent->call, get_digit_cb, agent, NULL); dbus_pending_call_set_notify(agent->call, get_digit_cb, agent, NULL);
@ -623,7 +624,7 @@ int stk_agent_request_quick_digit(struct stk_agent *agent, const char *text,
agent->user_cb = cb; agent->user_cb = cb;
agent->user_data = user_data; agent->user_data = user_data;
agent->user_destroy = destroy; agent->user_destroy = destroy;
agent->hidden_entry = TRUE; agent->hidden_entry = true;
dbus_pending_call_set_notify(agent->call, get_digit_cb, agent, NULL); dbus_pending_call_set_notify(agent->call, get_digit_cb, agent, NULL);
@ -636,13 +637,13 @@ static void get_key_cb(DBusPendingCall *call, void *data)
stk_agent_string_cb cb = agent->user_cb; stk_agent_string_cb cb = agent->user_cb;
DBusMessage *reply = dbus_pending_call_steal_reply(call); DBusMessage *reply = dbus_pending_call_steal_reply(call);
enum stk_agent_result result; enum stk_agent_result result;
gboolean remove_agent; bool remove_agent;
char *key; char *key;
if (check_error(agent, reply, if (check_error(agent, reply,
ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE, ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE,
&result) == -EINVAL) { &result) == -EINVAL) {
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -656,7 +657,7 @@ static void get_key_cb(DBusPendingCall *call, void *data)
DBUS_TYPE_INVALID) == FALSE || DBUS_TYPE_INVALID) == FALSE ||
g_utf8_strlen(key, 10) != 1) { g_utf8_strlen(key, 10) != 1) {
ofono_error("Can't parse the reply to GetKey()"); ofono_error("Can't parse the reply to GetKey()");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -667,7 +668,7 @@ static void get_key_cb(DBusPendingCall *call, void *data)
int stk_agent_request_key(struct stk_agent *agent, const char *text, int stk_agent_request_key(struct stk_agent *agent, const char *text,
const struct stk_icon_id *icon, const struct stk_icon_id *icon,
ofono_bool_t unicode_charset, bool unicode_charset,
stk_agent_string_cb cb, void *user_data, stk_agent_string_cb cb, void *user_data,
ofono_destroy_func destroy, int timeout) ofono_destroy_func destroy, int timeout)
{ {
@ -704,14 +705,14 @@ static void get_digits_cb(DBusPendingCall *call, void *data)
stk_agent_string_cb cb = agent->user_cb; stk_agent_string_cb cb = agent->user_cb;
DBusMessage *reply = dbus_pending_call_steal_reply(call); DBusMessage *reply = dbus_pending_call_steal_reply(call);
enum stk_agent_result result; enum stk_agent_result result;
gboolean remove_agent; bool remove_agent;
char *string; char *string;
int len, span; int len, span;
if (check_error(agent, reply, if (check_error(agent, reply,
ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE, ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE,
&result) == -EINVAL) { &result) == -EINVAL) {
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -724,7 +725,7 @@ static void get_digits_cb(DBusPendingCall *call, void *data)
DBUS_TYPE_STRING, &string, DBUS_TYPE_STRING, &string,
DBUS_TYPE_INVALID) == FALSE) { DBUS_TYPE_INVALID) == FALSE) {
ofono_error("Can't parse the reply to GetDigits()"); ofono_error("Can't parse the reply to GetDigits()");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -732,7 +733,7 @@ static void get_digits_cb(DBusPendingCall *call, void *data)
if (len < agent->min_length || len > agent->max_length) { if (len < agent->min_length || len > agent->max_length) {
ofono_error("Length not acceptable"); ofono_error("Length not acceptable");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -743,7 +744,7 @@ static void get_digits_cb(DBusPendingCall *call, void *data)
if (span != len) { if (span != len) {
ofono_error("Invalid character found"); ofono_error("Invalid character found");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -755,7 +756,7 @@ static void get_digits_cb(DBusPendingCall *call, void *data)
int stk_agent_request_digits(struct stk_agent *agent, const char *text, int stk_agent_request_digits(struct stk_agent *agent, const char *text,
const struct stk_icon_id *icon, const struct stk_icon_id *icon,
const char *default_text, const char *default_text,
int min, int max, ofono_bool_t hidden, int min, int max, bool hidden,
stk_agent_string_cb cb, void *user_data, stk_agent_string_cb cb, void *user_data,
ofono_destroy_func destroy, int timeout) ofono_destroy_func destroy, int timeout)
{ {
@ -805,14 +806,14 @@ static void get_input_cb(DBusPendingCall *call, void *data)
stk_agent_string_cb cb = agent->user_cb; stk_agent_string_cb cb = agent->user_cb;
DBusMessage *reply = dbus_pending_call_steal_reply(call); DBusMessage *reply = dbus_pending_call_steal_reply(call);
enum stk_agent_result result; enum stk_agent_result result;
gboolean remove_agent; bool remove_agent;
char *string; char *string;
int len; int len;
if (check_error(agent, reply, if (check_error(agent, reply,
ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE, ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE,
&result) == -EINVAL) { &result) == -EINVAL) {
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -825,7 +826,7 @@ static void get_input_cb(DBusPendingCall *call, void *data)
DBUS_TYPE_STRING, &string, DBUS_TYPE_STRING, &string,
DBUS_TYPE_INVALID) == FALSE) { DBUS_TYPE_INVALID) == FALSE) {
ofono_error("Can't parse the reply to GetInput()"); ofono_error("Can't parse the reply to GetInput()");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -833,7 +834,7 @@ static void get_input_cb(DBusPendingCall *call, void *data)
if (len < agent->min_length || len > agent->max_length) { if (len < agent->min_length || len > agent->max_length) {
ofono_error("Length not acceptable"); ofono_error("Length not acceptable");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -845,8 +846,8 @@ static void get_input_cb(DBusPendingCall *call, void *data)
int stk_agent_request_input(struct stk_agent *agent, const char *text, int stk_agent_request_input(struct stk_agent *agent, const char *text,
const struct stk_icon_id *icon, const struct stk_icon_id *icon,
const char *default_text, const char *default_text,
ofono_bool_t unicode_charset, int min, int max, bool unicode_charset, int min, int max,
ofono_bool_t hidden, stk_agent_string_cb cb, bool hidden, stk_agent_string_cb cb,
void *user_data, ofono_destroy_func destroy, void *user_data, ofono_destroy_func destroy,
int timeout) int timeout)
{ {
@ -896,12 +897,12 @@ static void confirm_call_cb(DBusPendingCall *call, void *data)
stk_agent_confirmation_cb cb = agent->user_cb; stk_agent_confirmation_cb cb = agent->user_cb;
DBusMessage *reply = dbus_pending_call_steal_reply(call); DBusMessage *reply = dbus_pending_call_steal_reply(call);
enum stk_agent_result result; enum stk_agent_result result;
gboolean remove_agent; bool remove_agent;
dbus_bool_t confirm; dbus_bool_t confirm;
if (check_error(agent, reply, if (check_error(agent, reply,
ALLOWED_ERROR_TERMINATE, &result) == -EINVAL) { ALLOWED_ERROR_TERMINATE, &result) == -EINVAL) {
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -914,7 +915,7 @@ static void confirm_call_cb(DBusPendingCall *call, void *data)
DBUS_TYPE_BOOLEAN, &confirm, DBUS_TYPE_BOOLEAN, &confirm,
DBUS_TYPE_INVALID) == FALSE) { DBUS_TYPE_INVALID) == FALSE) {
ofono_error("Can't parse the reply to ConfirmCallSetup()"); ofono_error("Can't parse the reply to ConfirmCallSetup()");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -962,17 +963,17 @@ static void play_tone_cb(DBusPendingCall *call, void *data)
stk_agent_tone_cb cb = agent->user_cb; stk_agent_tone_cb cb = agent->user_cb;
DBusMessage *reply = dbus_pending_call_steal_reply(call); DBusMessage *reply = dbus_pending_call_steal_reply(call);
enum stk_agent_result result; enum stk_agent_result result;
gboolean remove_agent; bool remove_agent;
if (check_error(agent, reply, if (check_error(agent, reply,
ALLOWED_ERROR_TERMINATE, &result) == -EINVAL) { ALLOWED_ERROR_TERMINATE, &result) == -EINVAL) {
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
if (dbus_message_get_args(reply, NULL, DBUS_TYPE_INVALID) == FALSE) { if (dbus_message_get_args(reply, NULL, DBUS_TYPE_INVALID) == FALSE) {
ofono_error("Can't parse the reply to PlayTone()"); ofono_error("Can't parse the reply to PlayTone()");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -983,7 +984,7 @@ static void play_tone_cb(DBusPendingCall *call, void *data)
} }
int stk_agent_play_tone(struct stk_agent *agent, const char *text, int stk_agent_play_tone(struct stk_agent *agent, const char *text,
const struct stk_icon_id *icon, ofono_bool_t vibrate, const struct stk_icon_id *icon, bool vibrate,
const char *tone, stk_agent_tone_cb cb, void *user_data, const char *tone, stk_agent_tone_cb cb, void *user_data,
ofono_destroy_func destroy, int timeout) ofono_destroy_func destroy, int timeout)
{ {
@ -1017,7 +1018,7 @@ int stk_agent_play_tone(struct stk_agent *agent, const char *text,
} }
int stk_agent_loop_tone(struct stk_agent *agent, const char *text, int stk_agent_loop_tone(struct stk_agent *agent, const char *text,
const struct stk_icon_id *icon, ofono_bool_t vibrate, const struct stk_icon_id *icon, bool vibrate,
const char *tone, stk_agent_tone_cb cb, void *user_data, const char *tone, stk_agent_tone_cb cb, void *user_data,
ofono_destroy_func destroy, int timeout) ofono_destroy_func destroy, int timeout)
{ {
@ -1055,16 +1056,16 @@ static void action_info_cb(DBusPendingCall *call, void *data)
struct stk_agent *agent = data; struct stk_agent *agent = data;
DBusMessage *reply = dbus_pending_call_steal_reply(call); DBusMessage *reply = dbus_pending_call_steal_reply(call);
enum stk_agent_result result; enum stk_agent_result result;
gboolean remove_agent; bool remove_agent;
if (check_error(agent, reply, 0, &result) == -EINVAL) { if (check_error(agent, reply, 0, &result) == -EINVAL) {
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
if (dbus_message_get_args(reply, NULL, DBUS_TYPE_INVALID) == FALSE) { if (dbus_message_get_args(reply, NULL, DBUS_TYPE_INVALID) == FALSE) {
ofono_error("Can't parse the reply to DisplayActionInfo()"); ofono_error("Can't parse the reply to DisplayActionInfo()");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -1109,7 +1110,7 @@ static void confirm_launch_browser_cb(DBusPendingCall *call, void *data)
dbus_bool_t confirm; dbus_bool_t confirm;
if (check_error(agent, reply, 0, &result) == -EINVAL) { if (check_error(agent, reply, 0, &result) == -EINVAL) {
remove_agent = TRUE; remove_agent = true;
cb(STK_AGENT_RESULT_TERMINATE, FALSE, agent->user_data); cb(STK_AGENT_RESULT_TERMINATE, FALSE, agent->user_data);
goto error; goto error;
} }
@ -1123,7 +1124,7 @@ static void confirm_launch_browser_cb(DBusPendingCall *call, void *data)
DBUS_TYPE_BOOLEAN, &confirm, DBUS_TYPE_BOOLEAN, &confirm,
DBUS_TYPE_INVALID) == FALSE) { DBUS_TYPE_INVALID) == FALSE) {
ofono_error("Can't parse the reply to ConfirmLaunchBrowser()"); ofono_error("Can't parse the reply to ConfirmLaunchBrowser()");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -1180,13 +1181,13 @@ static void display_action_cb(DBusPendingCall *call, void *data)
if (check_error(agent, reply, if (check_error(agent, reply,
ALLOWED_ERROR_TERMINATE, &result) == -EINVAL) { ALLOWED_ERROR_TERMINATE, &result) == -EINVAL) {
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
if (dbus_message_get_args(reply, NULL, DBUS_TYPE_INVALID) == FALSE) { if (dbus_message_get_args(reply, NULL, DBUS_TYPE_INVALID) == FALSE) {
ofono_error("Can't parse the reply to DisplayAction()"); ofono_error("Can't parse the reply to DisplayAction()");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -1242,7 +1243,7 @@ static void confirm_open_channel_cb(DBusPendingCall *call, void *data)
if (check_error(agent, reply, if (check_error(agent, reply,
ALLOWED_ERROR_TERMINATE, &result) == -EINVAL) { ALLOWED_ERROR_TERMINATE, &result) == -EINVAL) {
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }
@ -1255,7 +1256,7 @@ static void confirm_open_channel_cb(DBusPendingCall *call, void *data)
DBUS_TYPE_BOOLEAN, &confirm, DBUS_TYPE_BOOLEAN, &confirm,
DBUS_TYPE_INVALID) == FALSE) { DBUS_TYPE_INVALID) == FALSE) {
ofono_error("Can't parse the reply to ConfirmOpenChannel()"); ofono_error("Can't parse the reply to ConfirmOpenChannel()");
remove_agent = TRUE; remove_agent = true;
goto error; goto error;
} }

View File

@ -40,8 +40,8 @@ struct stk_menu {
struct stk_icon_id icon; struct stk_icon_id icon;
struct stk_menu_item *items; struct stk_menu_item *items;
int default_item; int default_item;
gboolean soft_key; bool soft_key;
gboolean has_help; bool has_help;
}; };
typedef void (*stk_agent_display_text_cb)(enum stk_agent_result result, typedef void (*stk_agent_display_text_cb)(enum stk_agent_result result,
@ -51,7 +51,7 @@ typedef void (*stk_agent_selection_cb)(enum stk_agent_result result,
uint8_t id, void *user_data); uint8_t id, void *user_data);
typedef void (*stk_agent_confirmation_cb)(enum stk_agent_result result, typedef void (*stk_agent_confirmation_cb)(enum stk_agent_result result,
ofono_bool_t confirm, bool confirm,
void *user_data); void *user_data);
typedef void (*stk_agent_string_cb)(enum stk_agent_result result, typedef void (*stk_agent_string_cb)(enum stk_agent_result result,
@ -64,7 +64,7 @@ typedef void (*stk_agent_display_action_cb)(enum stk_agent_result result,
void *user_data); void *user_data);
struct stk_agent *stk_agent_new(const char *path, const char *sender, struct stk_agent *stk_agent_new(const char *path, const char *sender,
ofono_bool_t remove_on_terminate); bool remove_on_terminate);
void stk_agent_free(struct stk_agent *agent); void stk_agent_free(struct stk_agent *agent);
@ -72,7 +72,7 @@ void stk_agent_set_removed_notify(struct stk_agent *agent,
ofono_destroy_func removed_cb, ofono_destroy_func removed_cb,
void *user_data); void *user_data);
ofono_bool_t stk_agent_matches(struct stk_agent *agent, bool stk_agent_matches(struct stk_agent *agent,
const char *path, const char *sender); const char *path, const char *sender);
void stk_agent_request_cancel(struct stk_agent *agent); void stk_agent_request_cancel(struct stk_agent *agent);
@ -85,7 +85,7 @@ int stk_agent_request_selection(struct stk_agent *agent,
int stk_agent_display_text(struct stk_agent *agent, const char *text, int stk_agent_display_text(struct stk_agent *agent, const char *text,
const struct stk_icon_id *icon, const struct stk_icon_id *icon,
ofono_bool_t urgent, bool urgent,
stk_agent_display_text_cb cb, stk_agent_display_text_cb cb,
void *user_data, ofono_destroy_func destroy, void *user_data, ofono_destroy_func destroy,
int timeout); int timeout);
@ -110,22 +110,22 @@ int stk_agent_request_quick_digit(struct stk_agent *agent, const char *text,
int stk_agent_request_key(struct stk_agent *agent, const char *text, int stk_agent_request_key(struct stk_agent *agent, const char *text,
const struct stk_icon_id *icon, const struct stk_icon_id *icon,
ofono_bool_t unicode_charset, bool unicode_charset,
stk_agent_string_cb cb, void *user_data, stk_agent_string_cb cb, void *user_data,
ofono_destroy_func destroy, int timeout); ofono_destroy_func destroy, int timeout);
int stk_agent_request_digits(struct stk_agent *agent, const char *text, int stk_agent_request_digits(struct stk_agent *agent, const char *text,
const struct stk_icon_id *icon, const struct stk_icon_id *icon,
const char *default_text, int min, int max, const char *default_text, int min, int max,
ofono_bool_t hidden, stk_agent_string_cb cb, bool hidden, stk_agent_string_cb cb,
void *user_data, ofono_destroy_func destroy, void *user_data, ofono_destroy_func destroy,
int timeout); int timeout);
int stk_agent_request_input(struct stk_agent *agent, const char *text, int stk_agent_request_input(struct stk_agent *agent, const char *text,
const struct stk_icon_id *icon, const struct stk_icon_id *icon,
const char *default_text, const char *default_text,
ofono_bool_t unicode_charset, int min, int max, bool unicode_charset, int min, int max,
ofono_bool_t hidden, stk_agent_string_cb cb, bool hidden, stk_agent_string_cb cb,
void *user_data, ofono_destroy_func destroy, void *user_data, ofono_destroy_func destroy,
int timeout); int timeout);
@ -135,12 +135,12 @@ int stk_agent_confirm_call(struct stk_agent *agent, const char *text,
ofono_destroy_func destroy, int timeout); ofono_destroy_func destroy, int timeout);
int stk_agent_play_tone(struct stk_agent *agent, const char *text, int stk_agent_play_tone(struct stk_agent *agent, const char *text,
const struct stk_icon_id *icon, ofono_bool_t vibrate, const struct stk_icon_id *icon, bool vibrate,
const char *tone, stk_agent_tone_cb cb, void *user_data, const char *tone, stk_agent_tone_cb cb, void *user_data,
ofono_destroy_func destroy, int timeout); ofono_destroy_func destroy, int timeout);
int stk_agent_loop_tone(struct stk_agent *agent, const char *text, int stk_agent_loop_tone(struct stk_agent *agent, const char *text,
const struct stk_icon_id *icon, ofono_bool_t vibrate, const struct stk_icon_id *icon, bool vibrate,
const char *tone, stk_agent_tone_cb cb, void *user_data, const char *tone, stk_agent_tone_cb cb, void *user_data,
ofono_destroy_func destroy, int timeout); ofono_destroy_func destroy, int timeout);