Remove tailing spaces and TODO file
authorJosé Bollo <jose.bollo@iot.bzh>
Tue, 12 Sep 2017 10:18:22 +0000 (12:18 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Mon, 9 Oct 2017 12:08:28 +0000 (14:08 +0200)
Change-Id: Id7cdad4e24c6ab62bf9c325b542e1605b17223f4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
20 files changed:
include/afb/afb-session-v1.h
src/TODO [deleted file]
src/afb-api-ws.c
src/afb-apiset.c
src/afb-client-demo.c
src/afb-config.h
src/afb-ditf.c
src/afb-monitor.c
src/afb-proto-ws.c
src/afb-proto-ws.h
src/afb-stub-ws.c
src/afb-trace.c
src/genskel/exprefs.c
src/genskel/genskel.c
src/genskel/json2c.c
src/jobs.c
src/locale-root.c
src/main.c
src/tests/test-thread.sh
src/wrap-json.c

index c287765..26d03f1 100644 (file)
@@ -45,12 +45,12 @@ enum afb_session_flags_v1
        AFB_SESSION_LOA_LE_1_V1 = AFB_SESSION_LOA_LE_V1 | AFB_SESSION_LOA_1_V1, /* check LOA <= 1 */
        AFB_SESSION_LOA_LE_2_V1 = AFB_SESSION_LOA_LE_V1 | AFB_SESSION_LOA_2_V1, /* check LOA <= 2 */
        AFB_SESSION_LOA_LE_3_V1 = AFB_SESSION_LOA_LE_V1 | AFB_SESSION_LOA_3_V1, /* check LOA <= 3 */
-                                                                             
+
        AFB_SESSION_LOA_EQ_0_V1 = AFB_SESSION_LOA_EQ_V1 | AFB_SESSION_LOA_0_V1, /* check LOA == 0 */
        AFB_SESSION_LOA_EQ_1_V1 = AFB_SESSION_LOA_EQ_V1 | AFB_SESSION_LOA_1_V1, /* check LOA == 1 */
        AFB_SESSION_LOA_EQ_2_V1 = AFB_SESSION_LOA_EQ_V1 | AFB_SESSION_LOA_2_V1, /* check LOA == 2 */
        AFB_SESSION_LOA_EQ_3_V1 = AFB_SESSION_LOA_EQ_V1 | AFB_SESSION_LOA_3_V1, /* check LOA == 3 */
-                                                                             
+
        AFB_SESSION_LOA_GE_0_V1 = AFB_SESSION_LOA_GE_V1 | AFB_SESSION_LOA_0_V1, /* check LOA >= 0 */
        AFB_SESSION_LOA_GE_1_V1 = AFB_SESSION_LOA_GE_V1 | AFB_SESSION_LOA_1_V1, /* check LOA >= 1 */
        AFB_SESSION_LOA_GE_2_V1 = AFB_SESSION_LOA_GE_V1 | AFB_SESSION_LOA_2_V1, /* check LOA >= 2 */
diff --git a/src/TODO b/src/TODO
deleted file mode 100644 (file)
index 0b6b180..0000000
--- a/src/TODO
+++ /dev/null
@@ -1,4 +0,0 @@
-may 13th 2016
--------------
- - 
- - 
index 0022d52..7e0adb7 100644 (file)
@@ -169,7 +169,6 @@ static int api_ws_socket_inet(const char *path, int server)
        }
        freeaddrinfo(rai);
        return -1;
-       
 }
 
 static int api_ws_socket(const char *path, int server)
index 38edcd5..cad12e9 100644 (file)
@@ -418,7 +418,7 @@ int afb_apiset_start_all_services(struct afb_apiset *set, int share_session)
                        return rc;
                i++;
        }
-       
+
        return set->subset ? afb_apiset_start_all_services(set->subset, share_session) : 0;
 }
 
index b119104..305e1b3 100644 (file)
@@ -85,7 +85,7 @@ int main(int ac, char **av, char **env)
 
                        else if (!strcmp(av[1], "--raw")) /* request for raw output */
                                raw = 1;
-               
+
                        /* emit usage and exit */
                        else
                                usage(!!strcmp(av[1], "--help"), a0);
index f1a27f7..b47670d 100644 (file)
@@ -17,7 +17,7 @@
 #pragma once
 
 /*
- * other definitions --------------------------------------------------- 
+ * other definitions ---------------------------------------------------
  */
 
 struct afb_config_list {
index d3db9bb..a7f97dd 100644 (file)
@@ -67,7 +67,6 @@ static struct afb_event event_make_cb(void *closure, const char *name)
 
        /* check daemon state */
        if (ditf->state == Daemon_Pre_Init) {
-               
                ERROR("[API %s] Bad call to 'afb_daemon_event_make(%s)', must not be in PreInit", ditf->api, name);
                errno = EINVAL;
                return (struct afb_event){ .itf = NULL, .closure = NULL };
@@ -93,7 +92,6 @@ static int event_broadcast_cb(void *closure, const char *name, struct json_objec
 
        /* check daemon state */
        if (ditf->state == Daemon_Pre_Init) {
-               
                ERROR("[API %s] Bad call to 'afb_daemon_event_broadcast(%s, %s)', must not be in PreInit", ditf->api, name, json_object_to_json_string(object));
                errno = EINVAL;
                return 0;
index 937e216..168b13d 100644 (file)
@@ -148,7 +148,7 @@ static void set_verbosity(struct json_object *spec)
 
 /**
  * Translate verbosity level to a protocol indication.
- * @param level the verbosity 
+ * @param level the verbosity
  * @return the encoded verbosity
  */
 static struct json_object *encode_verbosity(int level)
index 1f17cd7..24f70e5 100644 (file)
@@ -55,7 +55,7 @@ The client can require the following actions:
 
   - ask for description
 
-The server must reply to the previous actions by 
+The server must reply to the previous actions by
 
   - answering success or failure of the call
 
index 9cdf490..a3d4a0d 100644 (file)
@@ -24,7 +24,7 @@ struct afb_proto_ws_subcall;
 struct afb_proto_ws_describe;
 
 struct afb_proto_ws_client_itf
-{  
+{
        void (*on_reply_success)(void *closure, void *request, struct json_object *result, const char *info);
        void (*on_reply_fail)(void *closure, void *request, const char *status, const char *info);
 
index 1f0a3e6..083f72b 100644 (file)
@@ -543,12 +543,12 @@ static void on_describe(void *closure, struct afb_proto_ws_describe *describe)
 /*****************************************************/
 
 static const struct afb_proto_ws_client_itf client_itf =
-{  
+{
        .on_reply_success = on_reply_success,
        .on_reply_fail = on_reply_fail,
        .on_event_create = on_event_create,
        .on_event_remove = on_event_remove,
-       .on_event_subscribe = on_event_subscribe, 
+       .on_event_subscribe = on_event_subscribe,
        .on_event_unsubscribe = on_event_unsubscribe,
        .on_event_push = on_event_push,
        .on_event_broadcast = on_event_broadcast,
index b63756d..8537081 100644 (file)
@@ -960,7 +960,7 @@ static void trace_cleanup(struct afb_trace *trace)
        psession = &trace->sessions;
        while ((session = *psession)) {
                /* search for session */
-               for (hook = NULL, i = 0 ; !hook && i < Trace_Type_Count ; i++) 
+               for (hook = NULL, i = 0 ; !hook && i < Trace_Type_Count ; i++)
                        for (hook = trace->hooks[i] ; hook && hook->session != session ; hook = hook->next);
                /* keep or free whether used or not */
                if (hook)
@@ -976,7 +976,7 @@ static void trace_cleanup(struct afb_trace *trace)
        ptag = &trace->tags;
        while ((tag = *ptag)) {
                /* search for tag */
-               for (hook = NULL, i = 0 ; !hook && i < Trace_Type_Count ; i++) 
+               for (hook = NULL, i = 0 ; !hook && i < Trace_Type_Count ; i++)
                        for (hook = trace->hooks[i] ; hook && hook->tag != tag ; hook = hook->next);
                /* keep or free whether used or not */
                if (hook)
@@ -990,7 +990,7 @@ static void trace_cleanup(struct afb_trace *trace)
        pevent = &trace->events;
        while ((event = *pevent)) {
                /* search for event */
-               for (hook = NULL, i = 0 ; !hook && i < Trace_Type_Count ; i++) 
+               for (hook = NULL, i = 0 ; !hook && i < Trace_Type_Count ; i++)
                        for (hook = trace->hooks[i] ; hook && hook->event != event ; hook = hook->next);
                /* keep or free whether used or not */
                if (hook)
index 8d41cd5..4ea44b4 100644 (file)
@@ -34,7 +34,7 @@
  *      "b": "int"
  *    }
  *  }
- * 
+ *
  * Invocation:   program  [file|-]...
  *
  * without arguments, it reads the input.
@@ -80,7 +80,7 @@ struct json_object *search(const char *path)
        d = strtok(d, "/");
        while(i && d) {
                if (!json_object_object_get_ex(i, d, &i))
-                       return NULL; 
+                       return NULL;
                d = strtok(NULL, "/");
        }
        return i;
@@ -94,7 +94,7 @@ struct json_object *expand(struct path path)
        struct path *p;
        struct json_object *o, *x;
        int n, i;
-       struct json_object_iterator ji, jn; 
+       struct json_object_iterator ji, jn;
 
        /* expansion depends of the type of the node */
        switch (json_object_get_type(path.object)) {
@@ -192,7 +192,7 @@ int main(int ac, char **av)
                process("-");
        else {
                do { process(*av); } while(*++av);
-       }       
+       }
        return 0;
 }
 
index 8b179aa..62dfe3f 100644 (file)
@@ -34,7 +34,7 @@
  *      "b": "int"
  *    }
  *  }
- * 
+ *
  * Invocation:   program  [file|-]...
  *
  * without arguments, it reads the input.
@@ -95,7 +95,7 @@ struct json_object *search(const char *path)
        d = strtok(d, "/");
        while(i && d) {
                if (!json_object_object_get_ex(i, d, &i))
-                       return NULL; 
+                       return NULL;
                d = strtok(NULL, "/");
        }
        return i;
@@ -109,7 +109,7 @@ struct json_object *expand_$ref(struct path path)
        struct path *p;
        struct json_object *o, *x;
        int n, i;
-       struct json_object_iterator ji, jn; 
+       struct json_object_iterator ji, jn;
 
        /* expansion depends of the type of the node */
        switch (json_object_get_type(path.object)) {
@@ -305,7 +305,7 @@ struct json_object *new_perm(struct json_object *obj, const char *desc)
                if (!d_perms) {
                        d_perms = json_object_new_object();
                        a_perms = json_object_new_array();
-               }       
+               }
 
                asprintf(&b, "&_afb_auths_v2_%s[%d]", capi, json_object_array_length(a_perms));
                x = json_object_new_string(desc);
@@ -698,7 +698,7 @@ int main(int ac, char **av)
                process("-");
        else {
                do { process(*av); } while(*++av);
-       }       
+       }
        return 0;
 }
 
index cb541bf..109b6ee 100644 (file)
@@ -34,7 +34,7 @@
  *      "b": "int"
  *    }
  *  }
- * 
+ *
  * Invocation:   program  [file|-]...
  *
  * without arguments, it reads the input.
@@ -167,7 +167,7 @@ int main(int ac, char **av)
                process("-");
        else {
                do { process(*av); } while(*++av);
-       }       
+       }
        return 0;
 }
 
index ed812f8..347ad5c 100644 (file)
@@ -674,7 +674,7 @@ struct sd_event *jobs_get_sd_event()
                                                ERROR("creation of sd_event failed: %m");
                                                events = NULL;
                                                errno = -rc;
-                                       } 
+                                       }
                                }
                        }
                }
index c9cdf7d..38d488d 100644 (file)
@@ -146,7 +146,7 @@ static struct locale_folder *search_folder(struct locale_container *container, c
                        return f;
                if (c >= 0)
                        high = mid;
-               else    
+               else
                        low = mid + 1;
        }
        return NULL;
index 6ec392a..e2e8ce3 100644 (file)
@@ -283,7 +283,6 @@ static struct afb_hsrv *start_http_server()
 
 /*---------------------------------------------------------
  | execute_command
- |   
  +--------------------------------------------------------- */
 
 static void on_sigchld(int signum, siginfo_t *info, void *uctx)
index a7bb45a..4ece13c 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-cc test-thread.c ../afb-thread.c ../verbose.c ../sig-monitor.c ../jobs.c -o test-thread -lrt -lpthread -lsystemd -I../../include -g 
+cc test-thread.c ../afb-thread.c ../verbose.c ../sig-monitor.c ../jobs.c -o test-thread -lrt -lpthread -lsystemd -I../../include -g
 ./test-thread
index 164e127..9bb8d19 100644 (file)
@@ -718,7 +718,7 @@ void p(const char *desc, ...)
        va_start(args, desc);
        rc = wrap_json_vpack(&result, desc, args);
        va_end(args);
-       if (!rc) 
+       if (!rc)
                printf("  SUCCESS %s\n\n", json_object_to_json_string(result));
        else
                printf("  ERROR[char %d err %d] %s\n\n", wrap_json_get_error_position(rc), wrap_json_get_error_code(rc), wrap_json_get_error_string(rc));
@@ -749,7 +749,7 @@ void u(const char *value, const char *desc, ...)
        va_start(args, desc);
        rc = wrap_json_vunpack(obj, desc, args);
        va_end(args);
-       if (rc) 
+       if (rc)
                printf("  ERROR[char %d err %d] %s\n\n", wrap_json_get_error_position(rc), wrap_json_get_error_code(rc), wrap_json_get_error_string(rc));
        else {
                value = NULL;