Style changes
authorSteven Luo <steven+maemo@steven676.net>
Fri, 11 Dec 2009 05:28:12 +0000 (21:28 -0800)
committerSteven Luo <steven+maemo@steven676.net>
Fri, 11 Dec 2009 05:28:12 +0000 (21:28 -0800)
browser-switchboard.h
dbus-server-bindings.c
dbus-server-bindings.h
launcher.c
launcher.h
main.c

index 8083f74..726a553 100644 (file)
@@ -26,9 +26,9 @@
 struct swb_context {
        int continuous_mode;
        void (*default_browser_launcher)(struct swb_context *, char *);
 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 */
 };
 
 #endif /* _BROWSER_SWITCHBOARD_H */
index 2790fd9..c610881 100644 (file)
@@ -43,8 +43,8 @@ static void osso_browser_class_init(OssoBrowserClass *klass)
 #include "dbus-server-glue.h"
 
 
 #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] == '/') {
        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,
  * 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,
        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,
        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;
 }
        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,
 /* 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 */
        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)
        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 */
 }
 
 /* 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)
        guint result;
 
        if (!ctx || !ctx->dbus_proxy)
index 664fb83..232ac5d 100644 (file)
@@ -36,18 +36,18 @@ typedef struct _OssoBrowserClass {
 
 /* The com.nokia.osso_browser D-Bus interface */
 gboolean osso_browser_load_url(OssoBrowser *obj,
 
 /* 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,
 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,
 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,
 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;
 
 
 const DBusGObjectInfo dbus_glib_osso_browser_object_info;
 
index b6c9ea4..c897299 100644 (file)
 
 #define LAUNCH_DEFAULT_BROWSER launch_tear
 
 
 #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;
        int status;
-       static DBusGProxy * tear_proxy = NULL;
-       GError * error = NULL;
+       static DBusGProxy *tear_proxy = NULL;
+       GError *error = NULL;
        pid_t pid;
 
        if (!uri)
        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;
        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);
 }
 
        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) {
        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))))
                /* 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);
 }
 
        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);
        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;
 
        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);
 }
        if (ctx && ctx->default_browser_launcher)
                ctx->default_browser_launcher(ctx, uri);
 }
index 4caface..c3ad5b9 100644 (file)
@@ -25,8 +25,8 @@
 
 #include "browser-switchboard.h"
 
 
 #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 */
 
 #endif /* _LAUNCHER_H */
diff --git a/main.c b/main.c
index 5429a59..428d5bc 100644 (file)
--- a/main.c
+++ b/main.c
@@ -40,7 +40,7 @@
 
 struct swb_context ctx;
 
 
 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);
        if (!ctx)
                return;
        free(ctx->other_browser_cmd);
@@ -162,9 +162,9 @@ out_noopen:
 }
 
 int main() {
 }
 
 int main() {
-       OssoBrowser * obj;
-       GMainLoop * mainloop;
-       GError * error = NULL;
+       OssoBrowser *obj;
+       GMainLoop *mainloop;
+       GError *error = NULL;
 
        read_config(0);
 
 
        read_config(0);