From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:17:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C72E1066BF7; Sun, 6 Nov 2011 08:17:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FC5E8FC20; Sun, 6 Nov 2011 08:17:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68HmYw009357; Sun, 6 Nov 2011 08:17:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68HmXt009355; Sun, 6 Nov 2011 08:17:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060817.pA68HmXt009355@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227189 - head/usr.bin/tsort X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:17:48 -0000 Author: ed Date: Sun Nov 6 08:17:47 2011 New Revision: 227189 URL: http://svn.freebsd.org/changeset/base/227189 Log: Add missing static keywords to tsort(1) Modified: head/usr.bin/tsort/tsort.c Modified: head/usr.bin/tsort/tsort.c ============================================================================== --- head/usr.bin/tsort/tsort.c Sun Nov 6 08:17:42 2011 (r227188) +++ head/usr.bin/tsort/tsort.c Sun Nov 6 08:17:47 2011 (r227189) @@ -96,18 +96,18 @@ typedef struct _buf { int b_bsize; } BUF; -DB *db; -NODE *graph, **cycle_buf, **longest_cycle; -int debug, longest, quiet; - -void add_arc(char *, char *); -int find_cycle(NODE *, NODE *, int, int); -NODE *get_node(char *); -void *grow_buf(void *, size_t); -void remove_node(NODE *); -void clear_cycle(void); -void tsort(void); -void usage(void); +static DB *db; +static NODE *graph, **cycle_buf, **longest_cycle; +static int debug, longest, quiet; + +static void add_arc(char *, char *); +static int find_cycle(NODE *, NODE *, int, int); +static NODE *get_node(char *); +static void *grow_buf(void *, size_t); +static void remove_node(NODE *); +static void clear_cycle(void); +static void tsort(void); +static void usage(void); int main(int argc, char *argv[]) @@ -185,7 +185,7 @@ main(int argc, char *argv[]) } /* double the size of oldbuf and return a pointer to the new buffer. */ -void * +static void * grow_buf(void *bp, size_t size) { if ((bp = realloc(bp, size)) == NULL) @@ -197,7 +197,7 @@ grow_buf(void *bp, size_t size) * add an arc from node s1 to node s2 in the graph. If s1 or s2 are not in * the graph, then add them. */ -void +static void add_arc(char *s1, char *s2) { NODE *n1; @@ -232,7 +232,7 @@ add_arc(char *s1, char *s2) } /* Find a node in the graph (insert if not found) and return a pointer to it. */ -NODE * +static NODE * get_node(char *name) { DBT data, key; @@ -284,7 +284,7 @@ get_node(char *name) /* * Clear the NODEST flag from all nodes. */ -void +static void clear_cycle(void) { NODE *n; @@ -294,7 +294,7 @@ clear_cycle(void) } /* do topological sort on graph */ -void +static void tsort(void) { NODE *n, *next; @@ -357,7 +357,7 @@ tsort(void) } /* print node and remove from graph (does not actually free node) */ -void +static void remove_node(NODE *n) { NODE **np; @@ -374,7 +374,7 @@ remove_node(NODE *n) /* look for the longest? cycle from node from to node to. */ -int +static int find_cycle(NODE *from, NODE *to, int longest_len, int depth) { NODE **np; @@ -420,7 +420,7 @@ find_cycle(NODE *from, NODE *to, int lon return (longest_len); } -void +static void usage(void) { (void)fprintf(stderr, "usage: tsort [-dlq] [file]\n");