From caff5940423c8bacbacb293bcc3f6f975de35d0d Mon Sep 17 00:00:00 2001 From: Chiel ten Brinke Date: Tue, 3 Jan 2017 15:35:13 +0100 Subject: [PATCH] Expose ageqedge in cgraph.dll. Fix #1188. --- lib/cgraph/cgraph.def | 1 + lib/cgraph/cgraph.h | 4 +++- lib/cgraph/edge.c | 11 ++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/cgraph/cgraph.def b/lib/cgraph/cgraph.def index a8ef3f341..d0e920cf8 100644 --- a/lib/cgraph/cgraph.def +++ b/lib/cgraph/cgraph.def @@ -50,6 +50,7 @@ agedgeseqcmpf agerr agerrorf agerrors +ageqedge agfindnode_by_id agfindnode_by_name agflatten diff --git a/lib/cgraph/cgraph.h b/lib/cgraph/cgraph.h index bb3ddffaf..3141d7af4 100644 --- a/lib/cgraph/cgraph.h +++ b/lib/cgraph/cgraph.h @@ -399,10 +399,12 @@ extern agusererrf agseterrf(agusererrf); #define AGMKIN(e) (AGTYPE(e) == AGINEDGE? (e): AGOUT2IN(e)) #define AGTAIL(e) (AGMKIN(e)->node) #define AGHEAD(e) (AGMKOUT(e)->node) +#define AGEQEDGE(e,f) (AGMKOUT(e) == AGMKOUT(f)) +/* These macros are also exposed as functions, so they can be linked against. */ #define agtail(e) AGTAIL(e) #define aghead(e) AGHEAD(e) #define agopp(e) AGOPP(e) -#define ageqedge(e,f) (AGMKOUT(e) == AGMKOUT(f)) +#define ageqedge(e,f) AGEQEDGE(e,f) #define TAILPORT_ID "tailport" #define HEADPORT_ID "headport" diff --git a/lib/cgraph/edge.c b/lib/cgraph/edge.c index d8d5ab3d9..3e485a4ca 100644 --- a/lib/cgraph/edge.c +++ b/lib/cgraph/edge.c @@ -493,7 +493,16 @@ Dtdisc_t Ag_subedge_id_disc = { NIL(Dtevent_f) }; -/* debug functions */ +/* expose macros as functions for ease of debugging +and to expose them to foreign languages without C preprocessor. */ +#ifdef ageqedge +#undef ageqedge +#endif +Agnode_t *ageqedge(Agedge_t * e, Agedge_t * f) +{ + return AGEQEDGE(e, f); +} + #ifdef agtail #undef agtail #endif -- 2.40.0