+/*
+ * Sends for message 'msg' the OK reply with the 'object' and, if not NULL, the token.
+ * If not NULL, 'object' should be a valid JSON string.
+ * Return 0 in case of success. Otherwise, returns -1 and set errno.
+ */
+static inline int afb_wsj1_reply_ok_s(struct afb_wsj1_msg *msg, const char *object, const char *token)
+{
+ return afb_wsj1_reply_s(msg, object, token, 0);
+}
+
+/*
+ * Sends for message 'msg' the OK reply with the 'object' and, if not NULL, the token.
+ * 'object' can be NULL.
+ * 'object' is dereferenced using 'json_object_put'. Use 'json_object_get' to keep it.
+ * Return 0 in case of success. Otherwise, returns -1 and set errno.
+ */
+static inline int afb_wsj1_reply_ok_j(struct afb_wsj1_msg *msg, struct json_object *object, const char *token)
+{
+ return afb_wsj1_reply_j(msg, object, token, 0);
+}
+
+/*
+ * Sends for message 'msg' the ERROR reply with the 'object' and, if not NULL, the token.
+ * If not NULL, 'object' should be a valid JSON string.
+ * Return 0 in case of success. Otherwise, returns -1 and set errno.
+ */
+static inline int afb_wsj1_reply_error_s(struct afb_wsj1_msg *msg, const char *object, const char *token)
+{
+ return afb_wsj1_reply_s(msg, object, token, 1);
+}
+
+/*
+ * Sends for message 'msg' the ERROR reply with the 'object' and, if not NULL, the token.
+ * 'object' can be NULL.
+ * 'object' is dereferenced using 'json_object_put'. Use 'json_object_get' to keep it.
+ * Return 0 in case of success. Otherwise, returns -1 and set errno.
+ */
+static inline int afb_wsj1_reply_error_j(struct afb_wsj1_msg *msg, struct json_object *object, const char *token)
+{
+ return afb_wsj1_reply_j(msg, object, token, 1);
+}