Move repeated #defines into tr_json_util.h and add documentation
[trust_router.git] / common / tr_rp_client_encoders.c
index 6a7bda9..020962a 100644 (file)
 
 #include <tr_gss_names.h>
 #include <tr_rp_client.h>
-
-/* helper for below */
-#define OBJECT_SET_OR_FAIL(jobj, key, val)     \
-do {                                           \
-  if (val)                                     \
-    json_object_set_new((jobj),(key),(val));   \
-  else                                         \
-    goto cleanup;                              \
-} while (0)
-
-#define ARRAY_APPEND_OR_FAIL(jary, val)        \
-do {                                           \
-  if (val)                                     \
-    json_array_append_new((jary),(val));       \
-  else                                         \
-    goto cleanup;                              \
-} while (0)
+#include <tr_json_util.h>
 
 static json_t *tr_rp_client_to_json(TR_RP_CLIENT *rp_client)
 {