]> granicus.if.org Git - graphviz/commitdiff
Add min, max and system functions
authorerg <devnull@localhost>
Fri, 1 May 2009 17:42:51 +0000 (17:42 +0000)
committererg <devnull@localhost>
Fri, 1 May 2009 17:42:51 +0000 (17:42 +0000)
cmd/gvpr/compile.c

index bada6a43c77046602907dd949fbac38ef05047db..2f7f1b1e215d25a6b096ecca26b70a233293f783 100644 (file)
@@ -43,6 +43,8 @@
 #include <math.h>
 
 #define ISEDGE(e) (AGTYPE(e)&2)
+#define MIN(a,b)        ((a)<(b)?(a):(b))
+#define MAX(a,b)        ((a)>(b)?(a):(b))
 
 #include <gdefs.h>
 
@@ -1157,6 +1159,15 @@ getval(Expr_t * pgm, Exnode_t * node, Exid_t * sym, Exref_t * ref,
        case F_log:
            v.floating = log(args[0].floating);
            break;
+       case F_min:
+           v.floating = MIN(args[0].floating, args[1].floating);
+           break;
+       case F_max:
+           v.floating = MAX(args[0].floating, args[1].floating);
+           break;
+       case F_sys:
+           v.integer = system(args[0].string);
+           break;
        case F_hasattr:
        case F_get:
            objp = INT2PTR(Agobj_t *, args[0].integer);