-
-
-
-
-
-
-
-
-
-#if 0
-
-
-
-
-
-static void wsj1_emit(struct afb_wsj1 *wsj1, int code, const char *id, size_t idlen, struct json_object *data, const char *token)
-{
- json_object *msg;
- const char *txt;
-
- /* pack the message */
- msg = json_object_new_array();
- json_object_array_add(msg, json_object_new_int(code));
- json_object_array_add(msg, json_object_new_string_len(id, (int)idlen));
- json_object_array_add(msg, data);
- if (token)
- json_object_array_add(msg, json_object_new_string(token));
-
- /* emits the reply */
- txt = json_object_to_json_string(msg);
- afb_ws_text(wsj1->ws, txt, strlen(txt));
- json_object_put(msg);
-}
-
-static void wsj1_msg_reply(struct afb_wsj1_msg *msg, int retcode, const char *status, const char *info, json_object *resp)