From: Erwin Janssen Date: Sat, 1 Apr 2017 08:52:34 +0000 (+0200) Subject: Remove unused function `allow_edits` from neatogen X-Git-Tag: 2.42.0~184^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=593ccd787a18a7844f12a16e6b3d185ded487dc0;p=graphviz Remove unused function `allow_edits` from neatogen This function is defined but never used, it can therefore be removed. --- diff --git a/lib/neatogen/neatoprocs.h b/lib/neatogen/neatoprocs.h index 63173c189..0657f62f7 100644 --- a/lib/neatogen/neatoprocs.h +++ b/lib/neatogen/neatoprocs.h @@ -2,7 +2,7 @@ /* vim:set shiftwidth=4 ts=8: */ /************************************************************************* - * Copyright (c) 2011 AT&T Intellectual Property + * Copyright (c) 2011 AT&T Intellectual Property * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -19,7 +19,6 @@ extern "C" { #endif #include "adjust.h" - extern int allow_edits(int); extern void avoid_cycling(graph_t *, Agnode_t *, double *); extern int checkStart(graph_t * G, int nG, int); extern Agnode_t *choose_node(graph_t *, int); diff --git a/lib/neatogen/stuff.c b/lib/neatogen/stuff.c index c71495d6f..9f60854e9 100644 --- a/lib/neatogen/stuff.c +++ b/lib/neatogen/stuff.c @@ -2,7 +2,7 @@ /* vim:set shiftwidth=4 ts=8: */ /************************************************************************* - * Copyright (c) 2011 AT&T Intellectual Property + * Copyright (c) 2011 AT&T Intellectual Property * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -725,50 +725,3 @@ void make_spring(graph_t * G, node_t * u, node_t * v, double f) j = ND_id(v); GD_dist(G)[i][j] = GD_dist(G)[j][i] = f; } - -int allow_edits(int nsec) -{ -#ifdef INTERACTIVE - static int onetime = TRUE; - static FILE *fp; - static fd_set fd; - static struct timeval tv; - - char buf[256], name[256]; - double x, y; - node_t *np; - - if (onetime) { - fp = fopen("/dev/tty", "r"); - if (fp == NULL) - exit(1); - setbuf(fp, NULL); - tv.tv_usec = 0; - onetime = FALSE; - } - tv.tv_sec = nsec; - FD_ZERO(&fd); - FD_SET(fileno(fp), &fd); - if (select(32, &fd, (fd_set *) 0, (fd_set *) 0, &tv) > 0) { - fgets(buf, sizeof(buf), fp); - switch (buf[0]) { - case 'm': /* move node */ - if (sscanf(buf + 1, "%s %lf%lf", name, &x, &y) == 3) { - np = getnode(G, name); - if (np) { - NP_pos(np)[0] = x; - NP_pos(np)[1] = y; - diffeq_model(); - } - } - break; - case 'q': - return FALSE; - default: - agerr(AGERR, "unknown command '%s', ignored\n", buf); - } - return TRUE; - } -#endif - return FALSE; -}