#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"
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