Style: Various indentation and spacing issues

This commit is contained in:
Denis Kenzior 2010-01-27 12:45:20 -06:00
parent 083e448fa5
commit 8e07c9c5d8
1 changed files with 23 additions and 16 deletions

View File

@ -110,16 +110,16 @@ static void start_element_handler(GMarkupParseContext *context,
} }
static void end_element_handler(GMarkupParseContext *context, static void end_element_handler(GMarkupParseContext *context,
const gchar *element_name, gpointer user_data, const gchar *element_name, gpointer user_data,
GError **error) GError **error)
{ {
struct eppsd_response *rsp = user_data; struct eppsd_response *rsp = user_data;
rsp->current = NULL; rsp->current = NULL;
} }
static void text_handler(GMarkupParseContext *context, static void text_handler(GMarkupParseContext *context,
const gchar *text, gsize text_len, const gchar *text, gsize text_len,
gpointer user_data, GError **error) gpointer user_data, GError **error)
{ {
struct eppsd_response *rsp = user_data; struct eppsd_response *rsp = user_data;
@ -130,7 +130,7 @@ static void text_handler(GMarkupParseContext *context,
} }
static void error_handler(GMarkupParseContext *context, static void error_handler(GMarkupParseContext *context,
GError *error, gpointer user_data) GError *error, gpointer user_data)
{ {
ofono_debug("Error parsing xml response from eppsd: %s\n", ofono_debug("Error parsing xml response from eppsd: %s\n",
error->message); error->message);
@ -173,8 +173,7 @@ static struct conn_info *conn_info_create(unsigned int device,
/* /*
* Creates a new IP interface for CAIF. * Creates a new IP interface for CAIF.
*/ */
static gboolean caif_if_create(const char *interface, static gboolean caif_if_create(const char *interface, unsigned int connid)
unsigned int connid)
{ {
int s; int s;
static struct ifcaif_param param; static struct ifcaif_param param;
@ -195,7 +194,7 @@ static gboolean caif_if_create(const char *interface,
goto error; goto error;
} }
return TRUE; return TRUE;
error: error:
return FALSE; return FALSE;
@ -204,8 +203,7 @@ error:
/* /*
* Removes IP interface for CAIF. * Removes IP interface for CAIF.
*/ */
static gboolean caif_if_remove(const char *interface, static gboolean caif_if_remove(const char *interface, unsigned int connid)
unsigned int connid)
{ {
int s; int s;
static struct ifcaif_param param; static struct ifcaif_param param;
@ -239,8 +237,8 @@ error:
return FALSE; return FALSE;
} }
static void ste_eppsd_down_cb(gboolean ok, static void ste_eppsd_down_cb(gboolean ok, GAtResult *result,
GAtResult *result, gpointer user_data) gpointer user_data)
{ {
struct cb_data *cbd = user_data; struct cb_data *cbd = user_data;
ofono_gprs_context_cb_t cb = cbd->cb; ofono_gprs_context_cb_t cb = cbd->cb;
@ -265,11 +263,14 @@ static void ste_eppsd_down_cb(gboolean ok,
gcd->active_context); gcd->active_context);
goto error; goto error;
} }
conn = l->data; conn = l->data;
if (!caif_if_remove(conn->interface, conn->channel_id)) { if (!caif_if_remove(conn->interface, conn->channel_id)) {
ofono_debug("Failed to remove caif interface %s.", ofono_debug("Failed to remove caif interface %s.",
conn->interface); conn->interface);
} }
conn->cid = 0; conn->cid = 0;
decode_at_error(&error, g_at_result_final_response(result)); decode_at_error(&error, g_at_result_final_response(result));
@ -308,6 +309,7 @@ static void ste_eppsd_up_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->active_context); gcd->active_context);
goto error; goto error;
} }
conn = l->data; conn = l->data;
if (!ok) if (!ok)
@ -318,6 +320,7 @@ static void ste_eppsd_up_cb(gboolean ok, GAtResult *result, gpointer user_data)
memset(&rsp, 0, sizeof(rsp)); memset(&rsp, 0, sizeof(rsp));
g_at_result_iter_init(&iter, result); g_at_result_iter_init(&iter, result);
for (i = 0; i < g_at_result_num_response_lines(result); i++) { for (i = 0; i < g_at_result_num_response_lines(result); i++) {
g_at_result_iter_next(&iter, NULL); g_at_result_iter_next(&iter, NULL);
res_string = strdup(g_at_result_iter_raw_line(&iter)); res_string = strdup(g_at_result_iter_raw_line(&iter));
@ -350,6 +353,7 @@ static void ste_eppsd_up_cb(gboolean ok, GAtResult *result, gpointer user_data)
FALSE, rsp.ip_address, rsp.subnet_mask, FALSE, rsp.ip_address, rsp.subnet_mask,
rsp.default_gateway, dns, cbd->data); rsp.default_gateway, dns, cbd->data);
} }
return; return;
error: error:
@ -404,6 +408,7 @@ static void ste_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
ofono_debug("at_cgdcont_cb, no more available devices"); ofono_debug("at_cgdcont_cb, no more available devices");
goto error; goto error;
} }
conn = l->data; conn = l->data;
conn->cid = gcd->active_context; conn->cid = gcd->active_context;
sprintf(buf, "AT*EPPSD=1,%u,%u", conn->channel_id, conn->cid); sprintf(buf, "AT*EPPSD=1,%u,%u", conn->channel_id, conn->cid);
@ -418,7 +423,7 @@ error:
gcd->active_context = 0; gcd->active_context = 0;
CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL,
NULL, NULL, cbd->data); NULL, NULL, cbd->data);
} }
static void ste_gprs_activate_primary(struct ofono_gprs_context *gc, static void ste_gprs_activate_primary(struct ofono_gprs_context *gc,
@ -447,6 +452,7 @@ static void ste_gprs_activate_primary(struct ofono_gprs_context *gc,
if (g_at_chat_send(gcd->chat, buf, none_prefix, if (g_at_chat_send(gcd->chat, buf, none_prefix,
ste_cgdcont_cb, cbd, g_free) > 0) ste_cgdcont_cb, cbd, g_free) > 0)
return; return;
error: error:
if (cbd) if (cbd)
g_free(cbd); g_free(cbd);
@ -478,6 +484,7 @@ static void ste_gprs_deactivate_primary(struct ofono_gprs_context *gc,
"data (channel id) for connection with cid; %d", id); "data (channel id) for connection with cid; %d", id);
goto error; goto error;
} }
conn = l->data; conn = l->data;
sprintf(buf, "AT*EPPSD=0,%u,%u", conn->channel_id, id); sprintf(buf, "AT*EPPSD=0,%u,%u", conn->channel_id, id);
@ -494,7 +501,7 @@ error:
} }
static void ste_cgact_read_cb(gboolean ok, GAtResult *result, static void ste_cgact_read_cb(gboolean ok, GAtResult *result,
gpointer user_data) gpointer user_data)
{ {
struct ofono_gprs_context *gc = user_data; struct ofono_gprs_context *gc = user_data;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc); struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
@ -505,6 +512,7 @@ static void ste_cgact_read_cb(gboolean ok, GAtResult *result,
if (!ok) if (!ok)
return; return;
g_at_result_iter_init(&iter, result); g_at_result_iter_init(&iter, result);
while (g_at_result_iter_next(&iter, "+CGACT:")) { while (g_at_result_iter_next(&iter, "+CGACT:")) {
@ -549,7 +557,6 @@ static void cgev_notify(GAtResult *result, gpointer user_data)
g_str_has_prefix(event, "NW DEACT ") || g_str_has_prefix(event, "NW DEACT ") ||
g_str_has_prefix(event, "ME DEACT ")) { g_str_has_prefix(event, "ME DEACT ")) {
/* Ask what primary contexts are active now */ /* Ask what primary contexts are active now */
g_at_chat_send(gcd->chat, "AT+CGACT?", cgact_prefix, g_at_chat_send(gcd->chat, "AT+CGACT?", cgact_prefix,
ste_cgact_read_cb, gc, NULL); ste_cgact_read_cb, gc, NULL);
} }