From 42f0af690415fc59317203a187501c00c012c9d9 Mon Sep 17 00:00:00 2001 From: Steven Luo Date: Thu, 10 Dec 2009 21:28:12 -0800 Subject: [PATCH] Style changes --- browser-switchboard.h | 6 +++--- dbus-server-bindings.c | 20 ++++++++++---------- dbus-server-bindings.h | 12 ++++++------ launcher.c | 23 +++++++++++------------ launcher.h | 6 +++--- main.c | 8 ++++---- 6 files changed, 37 insertions(+), 38 deletions(-) diff --git a/browser-switchboard.h b/browser-switchboard.h index 8083f74..726a553 100644 --- a/browser-switchboard.h +++ b/browser-switchboard.h @@ -26,9 +26,9 @@ struct swb_context { int continuous_mode; void (*default_browser_launcher)(struct swb_context *, char *); - char * other_browser_cmd; - DBusGConnection * session_bus; - DBusGProxy * dbus_proxy; + char *other_browser_cmd; + DBusGConnection *session_bus; + DBusGProxy *dbus_proxy; }; #endif /* _BROWSER_SWITCHBOARD_H */ diff --git a/dbus-server-bindings.c b/dbus-server-bindings.c index 2790fd9..c610881 100644 --- a/dbus-server-bindings.c +++ b/dbus-server-bindings.c @@ -43,8 +43,8 @@ static void osso_browser_class_init(OssoBrowserClass *klass) #include "dbus-server-glue.h" -static void open_address(const char * uri) { - char * new_uri; +static void open_address(const char *uri) { + char *new_uri; size_t new_uri_len; if (!uri && uri[0] == '/') { @@ -69,19 +69,19 @@ static void open_address(const char * uri) { * The com.nokia.osso_browser D-Bus interface */ gboolean osso_browser_load_url(OssoBrowser *obj, - const char * uri, GError **error) { + const char *uri, GError **error) { open_address(uri); return TRUE; } gboolean osso_browser_mime_open(OssoBrowser *obj, - const char * uri, GError **error) { + const char *uri, GError **error) { open_address(uri); return TRUE; } gboolean osso_browser_open_new_window(OssoBrowser *obj, - const char * uri, GError **error) { + const char *uri, GError **error) { open_address(uri); return TRUE; } @@ -95,15 +95,15 @@ gboolean osso_browser_top_application(OssoBrowser *obj, /* This is a "undocumented", non-standard extension to the API, ONLY for use by /usr/bin/browser wrapper to implement --url */ gboolean osso_browser_switchboard_launch_microb(OssoBrowser *obj, - const char * uri, GError **error) { + const char *uri, GError **error) { launch_microb(&ctx, (char *)uri); return TRUE; } /* Register the name com.nokia.osso_browser on the D-Bus session bus */ -void dbus_request_osso_browser_name(struct swb_context * ctx) { - GError * error = NULL; +void dbus_request_osso_browser_name(struct swb_context *ctx) { + GError *error = NULL; guint result; if (!ctx || !ctx->dbus_proxy) @@ -125,8 +125,8 @@ void dbus_request_osso_browser_name(struct swb_context * ctx) { } /* Release the name com.nokia.osso_browser on the D-Bus session bus */ -void dbus_release_osso_browser_name(struct swb_context * ctx) { - GError * error = NULL; +void dbus_release_osso_browser_name(struct swb_context *ctx) { + GError *error = NULL; guint result; if (!ctx || !ctx->dbus_proxy) diff --git a/dbus-server-bindings.h b/dbus-server-bindings.h index 664fb83..232ac5d 100644 --- a/dbus-server-bindings.h +++ b/dbus-server-bindings.h @@ -36,18 +36,18 @@ typedef struct _OssoBrowserClass { /* The com.nokia.osso_browser D-Bus interface */ gboolean osso_browser_load_url(OssoBrowser *obj, - const char * uri, GError **error); + const char *uri, GError **error); gboolean osso_browser_mime_open(OssoBrowser *obj, - const char * uri, GError **error); + const char *uri, GError **error); gboolean osso_browser_open_new_window(OssoBrowser *obj, - const char * uri, GError **error); + const char *uri, GError **error); gboolean osso_browser_top_application(OssoBrowser *obj, GError **error); /* This is an "undocumented", non-standard extension; DO NOT USE */ gboolean osso_browser_switchboard_launch_microb(OssoBrowser *obj, - const char * uri, GError **error); + const char *uri, GError **error); -void dbus_request_osso_browser_name(struct swb_context * ctx); -void dbus_release_osso_browser_name(struct swb_context * ctx); +void dbus_request_osso_browser_name(struct swb_context *ctx); +void dbus_release_osso_browser_name(struct swb_context *ctx); const DBusGObjectInfo dbus_glib_osso_browser_object_info; diff --git a/launcher.c b/launcher.c index b6c9ea4..c897299 100644 --- a/launcher.c +++ b/launcher.c @@ -34,10 +34,10 @@ #define LAUNCH_DEFAULT_BROWSER launch_tear -static void launch_tear(struct swb_context * ctx, char * uri) { +static void launch_tear(struct swb_context *ctx, char *uri) { int status; - static DBusGProxy * tear_proxy = NULL; - GError * error = NULL; + static DBusGProxy *tear_proxy = NULL; + GError *error = NULL; pid_t pid; if (!uri) @@ -73,7 +73,7 @@ static void launch_tear(struct swb_context * ctx, char * uri) { } } -void launch_microb(struct swb_context * ctx, char * uri) { +void launch_microb(struct swb_context *ctx, char *uri) { int kill_browserd = 0; int status; pid_t pid; @@ -118,17 +118,16 @@ void launch_microb(struct swb_context * ctx, char * uri) { dbus_request_osso_browser_name(ctx); } -static void launch_other_browser(struct swb_context * ctx, char * uri) { - char * command; - char * quoted_uri; +static void launch_other_browser(struct swb_context *ctx, char *uri) { + char *command; + char *quoted_uri, *quote; + size_t cmdlen, urilen; if (!uri || !strcmp(uri, "new_window")) uri = ""; urilen = strlen(uri); if (urilen > 0) { - char * quote; - /* Quote the URI */ /* urilen+3 = length of URI + 2x \' + \0 */ if (!(quoted_uri = calloc(urilen+3, sizeof(char)))) @@ -181,7 +180,7 @@ static void launch_other_browser(struct swb_context * ctx, char * uri) { execl("/bin/sh", "/bin/sh", "-c", command, (char *)NULL); } -static void use_other_browser_cmd(struct swb_context * ctx, char * cmd) { +static void use_other_browser_cmd(struct swb_context *ctx, char *cmd) { size_t len = strlen(cmd); free(ctx->other_browser_cmd); @@ -197,7 +196,7 @@ static void use_other_browser_cmd(struct swb_context * ctx, char * cmd) { } } -void update_default_browser(struct swb_context * ctx, char * default_browser) { +void update_default_browser(struct swb_context *ctx, char *default_browser) { if (!ctx) return; @@ -227,7 +226,7 @@ void update_default_browser(struct swb_context * ctx, char * default_browser) { } } -void launch_browser(struct swb_context * ctx, char * uri) { +void launch_browser(struct swb_context *ctx, char *uri) { if (ctx && ctx->default_browser_launcher) ctx->default_browser_launcher(ctx, uri); } diff --git a/launcher.h b/launcher.h index 4caface..c3ad5b9 100644 --- a/launcher.h +++ b/launcher.h @@ -25,8 +25,8 @@ #include "browser-switchboard.h" -void launch_microb(struct swb_context * ctx, char * uri); -void launch_browser(struct swb_context * ctx, char * uri); -void update_default_browser(struct swb_context * ctx, char * default_browser); +void launch_microb(struct swb_context *ctx, char *uri); +void launch_browser(struct swb_context *ctx, char *uri); +void update_default_browser(struct swb_context *ctx, char *default_browser); #endif /* _LAUNCHER_H */ diff --git a/main.c b/main.c index 5429a59..428d5bc 100644 --- a/main.c +++ b/main.c @@ -40,7 +40,7 @@ struct swb_context ctx; -static void set_config_defaults(struct swb_context * ctx) { +static void set_config_defaults(struct swb_context *ctx) { if (!ctx) return; free(ctx->other_browser_cmd); @@ -162,9 +162,9 @@ out_noopen: } int main() { - OssoBrowser * obj; - GMainLoop * mainloop; - GError * error = NULL; + OssoBrowser *obj; + GMainLoop *mainloop; + GError *error = NULL; read_config(0); -- 1.7.9.5