49 struct _stackItem stackItem;
50 struct _stackItem *pStackItem;
57 unsigned char *pstack =
NULL;
85 pEdgeset = _DGL_OUTEDGESET(pgraphIn, pHead);
92 stackItem.pnHead = pHead;
93 stackItem.pnEdge = pEdge;
95 if ((pstack =
dgl_mempush(pstack, &istack,
sizeof(stackItem),
96 &stackItem)) ==
NULL) {
104 pEdgeset = _DGL_INEDGESET(pgraphIn, pHead);
113 stackItem.pnHead = pHead;
114 stackItem.pnEdge = pEdge;
116 if ((pstack =
dgl_mempush(pstack, &istack,
sizeof(stackItem),
117 &stackItem)) ==
NULL) {
131 while ((pStackItem = (
struct _stackItem *)
dgl_mempop(
132 pstack, &istack,
sizeof(stackItem))) !=
NULL) {
133 pHead = pStackItem->pnHead;
134 pEdge = pStackItem->pnEdge;
136 if (pStackItem->iWay == 0)
137 pTail = _DGL_EDGE_TAILNODE(pgraphIn, pEdge);
139 pTail = _DGL_EDGE_HEADNODE(pgraphIn, pEdge);
142 if (
avl_find(pvVisited, &findVisited)) {
150 if (fnClip(pgraphIn, pgraphOut, &clipInput,
NULL, pvClipArg))
171 pEdgeset = _DGL_OUTEDGESET(pgraphIn, pTail);
177 stackItem.pnHead = pTail;
178 stackItem.pnEdge = pEdge;
180 if ((pstack =
dgl_mempush(pstack, &istack,
sizeof(stackItem),
181 &stackItem)) ==
NULL) {
189 pEdgeset = _DGL_INEDGESET(pgraphIn, pTail);
198 stackItem.pnHead = pTail;
199 stackItem.pnEdge = pEdge;
202 sizeof(stackItem), &stackItem)) ==
276 pEdgeset = _DGL_OUTEDGESET(pgraphIn, pHead);
291 pEdgeset = _DGL_INEDGESET(pgraphIn, pHead);
319 if (HeapItem.
flags == 0) {
320 if ((pHead = _DGL_EDGE_HEADNODE(pgraphIn, pEdge)) ==
NULL) {
324 if ((pTail = _DGL_EDGE_TAILNODE(pgraphIn, pEdge)) ==
NULL) {
329 else if (pgraphIn->
Version == 3) {
330 if ((pTail = _DGL_EDGE_HEADNODE(pgraphIn, pEdge)) ==
NULL) {
334 if ((pHead = _DGL_EDGE_TAILNODE(pgraphIn, pEdge)) ==
NULL) {
361 pEdgeset = _DGL_OUTEDGESET(pgraphIn, pHead);
376 pEdgeset = _DGL_OUTEDGESET(pgraphIn, pHead);
int DGL_ADD_EDGE_FUNC(dglGraph_s *pgraph, dglInt32_t nHead, dglInt32_t nTail, dglInt32_t nCost, dglInt32_t nEdge, void *pvHeadAttr, void *pvTailAttr, void *pvEdgeAttr, dglInt32_t nFlags)
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
#define DGL_ERR_MemoryExhausted
#define DGL_ERR_HeadNodeNotFound
#define DGL_ERR_UnexpectedNullPointer
int(* dglSpanClip_fn)(dglGraph_s *, dglGraph_s *, dglSpanClipInput_s *, dglSpanClipOutput_s *, void *)
#define DGL_ERR_HeapError
void dglHeapInit(dglHeap_s *pheap)
int dglHeapInsertMin(dglHeap_s *pheap, long key, unsigned char flags, dglHeapData_u value)
void dglHeapFree(dglHeap_s *pheap, dglHeapCancelItem_fn pfnCancelItem)
int dglHeapExtractMin(dglHeap_s *pheap, dglHeapNode_s *pnoderet)
unsigned char * dgl_mempop(unsigned char *pstack, long *istack, long size)
unsigned char * dgl_mempush(unsigned char *pstack, long *istack, long size, void *pv)
void DGL_EDGESET_T_RELEASE_FUNC(dglEdgesetTraverser_s *pT UNUSED)
dglInt32_t * DGL_EDGESET_T_FIRST_FUNC(dglEdgesetTraverser_s *pT)
int DGL_EDGESET_T_INITIALIZE_FUNC(dglGraph_s *pGraph, dglEdgesetTraverser_s *pT, dglInt32_t *pnEdgeset)
dglInt32_t * DGL_EDGESET_T_NEXT_FUNC(dglEdgesetTraverser_s *pT)
void DGL_NODE_T_RELEASE_FUNC(dglNodeTraverser_s *pT)
int DGL_NODE_T_INITIALIZE_FUNC(dglGraph_s *pGraph, dglNodeTraverser_s *pT)
dglInt32_t * DGL_NODE_T_FIRST_FUNC(dglNodeTraverser_s *pT)
int DGL_ADD_NODE_FUNC(dglGraph_s *pgraph, dglInt32_t nId, void *pvNodeAttr UNUSED, dglInt32_t nFlags UNUSED)
dglInt32_t * DGL_GET_NODE_FUNC(dglGraph_s *pgraph, dglInt32_t nodeid)
int DGL_SPAN_MINIMUM_SPANNING_FUNC(dglGraph_s *pgraphIn, dglGraph_s *pgraphOut, dglInt32_t nVertex, dglSpanClip_fn fnClip UNUSED, void *pvClipArg UNUSED)
int DGL_SPAN_DEPTHFIRST_SPANNING_FUNC(dglGraph_s *pgraphIn, dglGraph_s *pgraphOut, dglInt32_t nVertex, void *pvVisited, dglSpanClip_fn fnClip, void *pvClipArg)
dglTreeNode_s * dglTreeNodeAdd(void *pavl, dglInt32_t nKey)
#define DGL_EDGE_ATTR_PTR
#define DGL_EDGE_STATUS(p)
#define DGL_NODE_ATTR_PTR
dglInt32_t * dglGetNode(dglGraph_s *pGraph, dglInt32_t nNodeId)