From: ellson Date: Tue, 1 Feb 2005 17:58:34 +0000 (+0000) Subject: move exch_xy(point) and exch_xy(pointf) to utils.c from emit.c X-Git-Tag: LAST_LIBGRAPH~32^2~7964 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac7e2f7c2242add18c39ea5626a1bdca9cf5c961;p=graphviz move exch_xy(point) and exch_xy(pointf) to utils.c from emit.c --- diff --git a/lib/common/emit.c b/lib/common/emit.c index 239a3b151..3858a7ed7 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -31,27 +31,10 @@ #define MAX_CODEGENS 100 -static char *defaultlinestyle[3] = { "solid\0", "setlinewidth\0001\0", 0 }; int Obj; static attrsym_t *G_peripheries; -static point exch_xy(point p) -{ - int t; - t = p.x; - p.x = p.y; - p.y = t; - return p; -} - -static pointf exch_xyf(pointf p) -{ - double t; - t = p.x; - p.x = p.y; - p.y = t; - return p; -} +static char *defaultlinestyle[3] = { "solid\0", "setlinewidth\0001\0", 0 }; /* parse_layers: * Split input string into tokens, with separators specified by diff --git a/lib/common/renderprocs.h b/lib/common/renderprocs.h index 9ec9a7f85..24406d921 100644 --- a/lib/common/renderprocs.h +++ b/lib/common/renderprocs.h @@ -85,6 +85,8 @@ extern "C" { extern void epsf_init(node_t * n); extern void epsf_free(node_t * n); extern void epsf_gencode(GVC_t * gvc, node_t * n); + extern point exch_xy(point p); + extern pointf exch_xyf(pointf p); extern shape_desc *find_user_shape(char *); extern box flip_rec_box(box b, point p); extern point flip_pt(point p, int rankdir); diff --git a/lib/common/utils.c b/lib/common/utils.c index f9782d67a..e5534ffee 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -342,6 +342,24 @@ pointf sub_pointfs(pointf p0, pointf p1) return p0; } +point exch_xy(point p) +{ + int t; + t = p.x; + p.x = p.y; + p.y = t; + return p; +} + +pointf exch_xyf(pointf p) +{ + double t; + t = p.x; + p.x = p.y; + p.y = t; + return p; +} + /* from Glassner's Graphics Gems */ #define W_DEGREE 5