about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-10-25 22:47:42 +0000
committerJames Booth <boothj5@gmail.com>2015-10-25 22:47:42 +0000
commit00170984001803cd1306ed000fcbbb0a4297f2be (patch)
tree0a69e05e40350347ee235ddd9d695b580fd78c19
parent39d183fe236b593fe4eb8c83a910413a4c9d19da (diff)
downloadprofani-tty-00170984001803cd1306ed000fcbbb0a4297f2be.tar.gz
Applied coding style to src/tools/
-rw-r--r--src/tools/autocomplete.c22
-rw-r--r--src/tools/autocomplete.h14
-rw-r--r--src/tools/parser.c16
-rw-r--r--src/tools/parser.h10
-rw-r--r--src/tools/tinyurl.c2
-rw-r--r--src/tools/tinyurl.h2
6 files changed, 33 insertions, 33 deletions
diff --git a/src/tools/autocomplete.c b/src/tools/autocomplete.c
index 7624f1df..f7f97309 100644
--- a/src/tools/autocomplete.c
+++ b/src/tools/autocomplete.c
@@ -46,7 +46,7 @@ struct autocomplete_t {
     gchar *search_str;
 };
 
-static gchar * _search_from(Autocomplete ac, GSList *curr, gboolean quote);
+static gchar* _search_from(Autocomplete ac, GSList *curr, gboolean quote);
 
 Autocomplete
 autocomplete_new(void)
@@ -118,7 +118,7 @@ autocomplete_add(Autocomplete ac, const char *item)
 }
 
 void
-autocomplete_remove(Autocomplete ac, const char * const item)
+autocomplete_remove(Autocomplete ac, const char *const item)
 {
     if (ac) {
         GSList *curr = g_slist_find_custom(ac->items, item, (GCompareFunc)strcmp);
@@ -139,7 +139,7 @@ autocomplete_remove(Autocomplete ac, const char * const item)
     return;
 }
 
-GSList *
+GSList*
 autocomplete_create_list(Autocomplete ac)
 {
     GSList *copy = NULL;
@@ -168,7 +168,7 @@ autocomplete_contains(Autocomplete ac, const char *value)
     return FALSE;
 }
 
-gchar *
+gchar*
 autocomplete_complete(Autocomplete ac, const gchar *search_str, gboolean quote)
 {
     gchar *found = NULL;
@@ -215,8 +215,8 @@ autocomplete_complete(Autocomplete ac, const gchar *search_str, gboolean quote)
     }
 }
 
-char *
-autocomplete_param_with_func(const char * const input, char *command, autocomplete_func func)
+char*
+autocomplete_param_with_func(const char *const input, char *command, autocomplete_func func)
 {
     GString *auto_msg = NULL;
     char *result = NULL;
@@ -246,8 +246,8 @@ autocomplete_param_with_func(const char * const input, char *command, autocomple
     return result;
 }
 
-char *
-autocomplete_param_with_ac(const char * const input, char *command, Autocomplete ac, gboolean quote)
+char*
+autocomplete_param_with_ac(const char *const input, char *command, Autocomplete ac, gboolean quote)
 {
     GString *auto_msg = NULL;
     char *result = NULL;
@@ -277,8 +277,8 @@ autocomplete_param_with_ac(const char * const input, char *command, Autocomplete
     return result;
 }
 
-char *
-autocomplete_param_no_with_func(const char * const input, char *command, int arg_number, autocomplete_func func)
+char*
+autocomplete_param_no_with_func(const char *const input, char *command, int arg_number, autocomplete_func func)
 {
     if (strncmp(input, command, strlen(command)) == 0 && (strlen(input) > strlen(command))) {
         GString *result_str = NULL;
@@ -309,7 +309,7 @@ autocomplete_param_no_with_func(const char * const input, char *command, int arg
     return NULL;
 }
 
-static gchar *
+static gchar*
 _search_from(Autocomplete ac, GSList *curr, gboolean quote)
 {
     while(curr) {
diff --git a/src/tools/autocomplete.h b/src/tools/autocomplete.h
index c4b94b09..df741c99 100644
--- a/src/tools/autocomplete.h
+++ b/src/tools/autocomplete.h
@@ -37,7 +37,7 @@
 
 #include <glib.h>
 
-typedef char*(*autocomplete_func)(const char * const);
+typedef char* (*autocomplete_func)(const char *const);
 typedef struct autocomplete_t *Autocomplete;
 
 // allocate new autocompleter with no items
@@ -50,21 +50,21 @@ void autocomplete_clear(Autocomplete ac);
 void autocomplete_free(Autocomplete ac);
 
 void autocomplete_add(Autocomplete ac, const char *item);
-void autocomplete_remove(Autocomplete ac, const char * const item);
+void autocomplete_remove(Autocomplete ac, const char *const item);
 
 // find the next item prefixed with search string
-gchar * autocomplete_complete(Autocomplete ac, const gchar *search_str, gboolean quote);
+gchar* autocomplete_complete(Autocomplete ac, const gchar *search_str, gboolean quote);
 
-GSList * autocomplete_create_list(Autocomplete ac);
+GSList* autocomplete_create_list(Autocomplete ac);
 gint autocomplete_length(Autocomplete ac);
 
-char * autocomplete_param_with_func(const char * const input, char *command,
+char* autocomplete_param_with_func(const char *const input, char *command,
     autocomplete_func func);
 
-char * autocomplete_param_with_ac(const char * const input, char *command,
+char* autocomplete_param_with_ac(const char *const input, char *command,
     Autocomplete ac, gboolean quote);
 
-char * autocomplete_param_no_with_func(const char * const input, char *command,
+char* autocomplete_param_no_with_func(const char *const input, char *command,
     int arg_number, autocomplete_func func);
 
 void autocomplete_reset(Autocomplete ac);
diff --git a/src/tools/parser.c b/src/tools/parser.c
index d3a23264..b0fc9234 100644
--- a/src/tools/parser.c
+++ b/src/tools/parser.c
@@ -61,8 +61,8 @@
  * { "arg1", "arg2", NULL }
  *
  */
-gchar **
-parse_args(const char * const inp, int min, int max, gboolean *result)
+gchar**
+parse_args(const char *const inp, int min, int max, gboolean *result)
 {
     if (inp == NULL) {
         *result = FALSE;
@@ -195,8 +195,8 @@ parse_args(const char * const inp, int min, int max, gboolean *result)
  * { "arg1", "arg2", "some free text", NULL }
  *
  */
-gchar **
-parse_args_with_freetext(const char * const inp, int min, int max, gboolean *result)
+gchar**
+parse_args_with_freetext(const char *const inp, int min, int max, gboolean *result)
 {
     if (inp == NULL) {
         *result = FALSE;
@@ -316,7 +316,7 @@ parse_args_with_freetext(const char * const inp, int min, int max, gboolean *res
 }
 
 int
-count_tokens(const char * const string)
+count_tokens(const char *const string)
 {
     int length = g_utf8_strlen(string, -1);
     gboolean in_quotes = FALSE;
@@ -346,8 +346,8 @@ count_tokens(const char * const string)
     return num_tokens;
 }
 
-char *
-get_start(const char * const string, int tokens)
+char*
+get_start(const char *const string, int tokens)
 {
     GString *result = g_string_new("");
     int length = g_utf8_strlen(string, -1);
@@ -388,7 +388,7 @@ get_start(const char * const string, int tokens)
     return result_str;
 }
 
-GHashTable *
+GHashTable*
 parse_options(gchar **args, gchar **opt_keys, gboolean *res)
 {
     GList *keys = NULL;
diff --git a/src/tools/parser.h b/src/tools/parser.h
index 34fa55a0..f01df374 100644
--- a/src/tools/parser.h
+++ b/src/tools/parser.h
@@ -37,11 +37,11 @@
 
 #include <glib.h>
 
-gchar** parse_args(const char * const inp, int min, int max, gboolean *result);
-gchar** parse_args_with_freetext(const char * const inp, int min, int max, gboolean *result);
-int count_tokens(const char * const string);
-char* get_start(const char * const string, int tokens);
+gchar** parse_args(const char *const inp, int min, int max, gboolean *result);
+gchar** parse_args_with_freetext(const char *const inp, int min, int max, gboolean *result);
+int count_tokens(const char *const string);
+char* get_start(const char *const string, int tokens);
 GHashTable* parse_options(gchar **args, gchar **keys, gboolean *res);
 void options_destroy(GHashTable *options);
 
-#endif
\ No newline at end of file
+#endif
diff --git a/src/tools/tinyurl.c b/src/tools/tinyurl.c
index 92ff97b8..b12e0dd6 100644
--- a/src/tools/tinyurl.c
+++ b/src/tools/tinyurl.c
@@ -54,7 +54,7 @@ tinyurl_valid(char *url)
         g_str_has_prefix(url, "https://"));
 }
 
-char *
+char*
 tinyurl_get(char *url)
 {
     GString *full_url = g_string_new("http://tinyurl.com/api-create.php?url=");
diff --git a/src/tools/tinyurl.h b/src/tools/tinyurl.h
index f69570c3..69db4587 100644
--- a/src/tools/tinyurl.h
+++ b/src/tools/tinyurl.h
@@ -38,6 +38,6 @@
 #include <glib.h>
 
 gboolean tinyurl_valid(char *url);
-char * tinyurl_get(char *url);
+char* tinyurl_get(char *url);
 
 #endif