summaryrefslogtreecommitdiffstats
path: root/usr.bin/tsort
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2011-11-06 08:17:47 +0000
committered <ed@FreeBSD.org>2011-11-06 08:17:47 +0000
commit0aac214b40f1ba9081b0f1ab98c6cbc3b9b9b907 (patch)
treec1e01f378bfde6ca04789c4db6735d13f3c1c899 /usr.bin/tsort
parent9e267acf2e4cdf0ff6ca57d6a6d7d67bb7e3d79c (diff)
downloadFreeBSD-src-0aac214b40f1ba9081b0f1ab98c6cbc3b9b9b907.zip
FreeBSD-src-0aac214b40f1ba9081b0f1ab98c6cbc3b9b9b907.tar.gz
Add missing static keywords to tsort(1)
Diffstat (limited to 'usr.bin/tsort')
-rw-r--r--usr.bin/tsort/tsort.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/usr.bin/tsort/tsort.c b/usr.bin/tsort/tsort.c
index def1624..1511b36 100644
--- a/usr.bin/tsort/tsort.c
+++ b/usr.bin/tsort/tsort.c
@@ -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 longest_len, int depth)
return (longest_len);
}
-void
+static void
usage(void)
{
(void)fprintf(stderr, "usage: tsort [-dlq] [file]\n");
OpenPOWER on IntegriCloud