void stinger_physmap_id_to_json(const stinger_physmap_t * p, vindex_t v, FILE * out, int64_t indent_level) { JSON_INIT(out, indent_level); JSON_OBJECT_START_UNLABELED(); JSON_STRING(id, stinger_names_lookup_name(p, v)); JSON_OBJECT_END(); JSON_END(); }
/* * Update data from OrangePi to Azure. */ int OrangePi2Azure(char *name,char *data) { char JSON[200]; char buffer[200]; memset(JSON,0,200); memset(buffer,0,200); Data2JSON(name,data,JSON); JSON_END(JSON); sprintf(buffer,"OrangePi %s",JSON); /* Call OrangePi2Azure API */ printf("Command %s\n",buffer); system(buffer); return 0; }
inline void stinger_vertex_to_json(const stinger_vertices_t * vertices, stinger_physmap_t * phys, vindex_t v, FILE * out, int64_t indent_level) { const stinger_vertex_t * vout = VTX(v); JSON_INIT(out, indent_level); JSON_OBJECT_START_UNLABELED(); JSON_INT64(vid, v); JSON_VTYPE(vtype, vout->type); JSON_VWEIGHT(vweight, vout->weight); JSON_INT64(inDegree, vout->inDegree); JSON_INT64(outDegree, vout->outDegree); JSON_SUBOBJECT(physID); stinger_physmap_id_to_json(phys, v, out, indent_level+1); #if defined(STINGER_VERTEX_KEY_VALUE_STORE) /* TODO attributes */ #endif JSON_OBJECT_END(); JSON_END(); }
inline void stinger_vertex_to_json_with_type_strings(const stinger_vertices_t * vertices, const stinger_names_t * tn, stinger_physmap_t * phys, vindex_t v, FILE * out, int64_t indent_level) { const stinger_vertex_t * vout = VTX(v); JSON_INIT(out, indent_level); JSON_OBJECT_START_UNLABELED(); JSON_INT64(vid, v); char * vtype = stinger_names_lookup_name(tn,vout->type); if(vtype) { JSON_STRING(vtype, vtype); } else { JSON_INT64(vtype, vout->type); } JSON_VWEIGHT(vweight, vout->weight); JSON_INT64(inDegree, vout->inDegree); JSON_INT64(outDegree, vout->outDegree); JSON_SUBOBJECT(physID); stinger_physmap_id_to_json(phys, v, out, indent_level+1); #if defined(STINGER_VERTEX_KEY_VALUE_STORE) /* TODO attributes */ #endif JSON_OBJECT_END(); JSON_END(); }