static int query_rdesc (flux_t h, int64_t j, JSON *jcb) { JSON o = NULL; int64_t nnodes = -1; int64_t ntasks = -1; if (extract_raw_nnodes (h, j, &nnodes) < 0) return -1; if (extract_raw_ntasks (h, j, &ntasks) < 0) return -1; *jcb = Jnew (); o = Jnew (); Jadd_int64 (o, JSC_RDESC_NNODES, nnodes); Jadd_int64 (o, JSC_RDESC_NTASKS, ntasks); json_object_object_add (*jcb, JSC_RDESC, o); return 0; }
static int query_rdesc (flux_t *h, int64_t j, json_object **jcb) { json_object *o = NULL; int64_t nnodes = -1; int64_t ntasks = -1; int64_t walltime = -1; if (extract_raw_nnodes (h, j, &nnodes) < 0) return -1; if (extract_raw_ntasks (h, j, &ntasks) < 0) return -1; if (extract_raw_walltime (h, j, &walltime) < 0) return -1; *jcb = Jnew (); o = Jnew (); Jadd_int64 (o, JSC_RDESC_NNODES, nnodes); Jadd_int64 (o, JSC_RDESC_NTASKS, ntasks); Jadd_int64 (o, JSC_RDESC_WALLTIME, walltime); json_object_object_add (*jcb, JSC_RDESC, o); return 0; }