static Agraph_t* getClusterPtr(SEXP graph, SEXP cluster) { Agraph_t *g = getAgraphPtr(graph); if ( !g ) return(NULL); int i = INTEGER(cluster)[0]; char subGName[256]; sprintf(subGName, "%s_%d", CLUSTERFLAG, i); Agraph_t *sg = agfindsubg(g, subGName); return(sg); }
static graph_t *getCluster(graph_t * g, char *cluster_name) #endif { Agraph_t* sg; if (!cluster_name || (*cluster_name == '\0')) return NULL; #ifdef WITH_CGRAPH sg = findCluster (map, cluster_name); #else sg = agfindsubg(g, cluster_name); #endif if (sg == NULL) { agerr(AGWARN, "cluster named %s not found\n", cluster_name); } return sg; }
//------------------------------------------------- Agraph_t *findsubg(Agraph_t *g, char *name) { if (!g || !name) return NULL; return agfindsubg(g, name); }