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 */
+++ /dev/null
-may 13th 2016
--------------
- -
- -
}
freeaddrinfo(rai);
return -1;
-
}
static int api_ws_socket(const char *path, int server)
return rc;
i++;
}
-
+
return set->subset ? afb_apiset_start_all_services(set->subset, share_session) : 0;
}
else if (!strcmp(av[1], "--raw")) /* request for raw output */
raw = 1;
-
+
/* emit usage and exit */
else
usage(!!strcmp(av[1], "--help"), a0);
#pragma once
/*
- * other definitions ---------------------------------------------------
+ * other definitions ---------------------------------------------------
*/
struct afb_config_list {
/* 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 };
/* 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;
/**
* 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)
- 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
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);
/*****************************************************/
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,
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)
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)
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)
* "b": "int"
* }
* }
- *
+ *
* Invocation: program [file|-]...
*
* without arguments, it reads the input.
d = strtok(d, "/");
while(i && d) {
if (!json_object_object_get_ex(i, d, &i))
- return NULL;
+ return NULL;
d = strtok(NULL, "/");
}
return i;
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)) {
process("-");
else {
do { process(*av); } while(*++av);
- }
+ }
return 0;
}
* "b": "int"
* }
* }
- *
+ *
* Invocation: program [file|-]...
*
* without arguments, it reads the input.
d = strtok(d, "/");
while(i && d) {
if (!json_object_object_get_ex(i, d, &i))
- return NULL;
+ return NULL;
d = strtok(NULL, "/");
}
return i;
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)) {
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);
process("-");
else {
do { process(*av); } while(*++av);
- }
+ }
return 0;
}
* "b": "int"
* }
* }
- *
+ *
* Invocation: program [file|-]...
*
* without arguments, it reads the input.
process("-");
else {
do { process(*av); } while(*++av);
- }
+ }
return 0;
}
ERROR("creation of sd_event failed: %m");
events = NULL;
errno = -rc;
- }
+ }
}
}
}
return f;
if (c >= 0)
high = mid;
- else
+ else
low = mid + 1;
}
return NULL;
/*---------------------------------------------------------
| execute_command
- |
+--------------------------------------------------------- */
static void on_sigchld(int signum, siginfo_t *info, void *uctx)
#!/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
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));
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;