diff --git a/xdu.c b/xdu.c index 4cc3dc7..7347dea 100644 --- a/xdu.c +++ b/xdu.c @@ -88,12 +88,12 @@ int ncols = NCOLS; * internal routines */ // char *strdup(); -void addtree(); -void parse_file(); -void parse_entry(); +static void addtree(); +static void parse_file(); +static void parse_entry(); void dumptree(); -void clearrects(); -void sorttree(); +static void clearrects(); +static void sorttree(); /* * order to sort paths by @@ -139,7 +139,7 @@ long nnodes = 0; /* * create a new node with the given name and size info */ -struct node* +static struct node* makenode(char* name, long long size) { struct node* np; @@ -157,7 +157,7 @@ makenode(char* name, long long size) * Return the node (if any) which has a draw rectangle containing * the given x,y point. */ -struct node* +static struct node* findnode(struct node* treep, int x, int y) { struct node* np; @@ -188,7 +188,7 @@ findnode(struct node* treep, int x, int y) /* * return a count of the number of children of a given node */ -int numchildren(struct node* nodep) +static int numchildren(struct node* nodep) { int n; @@ -207,7 +207,7 @@ int numchildren(struct node* nodep) * had their sizes initialized. [DPT911113] * * * * This function is recursive * * * */ -long fix_tree(struct node* top) +static long fix_tree(struct node* top) { struct node* nd; @@ -278,7 +278,7 @@ int main(int argc, char** argv) exit(0); } -void parse_file(char* filename) +static void parse_file(char* filename) { char buf[4096]; char name[4096]; @@ -317,7 +317,7 @@ void parse_file(char* filename) /* * bust up a path string and link it into the tree */ -void parse_entry(char* name, long long size) +static void parse_entry(char* name, long long size) { char* path[MAXDEPTH]; /* break up path into this list */ char buf[MAXNAME]; /* temp space for path element @@ -369,7 +369,7 @@ void parse_entry(char* name, long long size) * 0 if it is a toss up. * 1 if it should go after. */ -int compare(struct node* n1, struct node* n2, int order) +static int compare(struct node* n1, struct node* n2, int order) { switch (order) { case ORD_SIZE: @@ -424,7 +424,7 @@ int compare(struct node* n1, struct node* n2, int order) /* * add path as a child of top - recursively */ -void addtree(struct node* top, char* path[], long long size) +static void addtree(struct node* top, char* path[], long long size) { struct node* np; @@ -493,7 +493,7 @@ void dumptree(struct node* np, int level) } } -void sorttree(struct node* np, int order) +static void sorttree(struct node* np, int order) { struct node* subnp; struct node *np0, @@ -541,7 +541,7 @@ void sorttree(struct node* np, int order) * Draws all children of a node within the given rectangle. * Recurses on children. */ -void drawchildren(struct node* nodep, struct rect rect) +static void drawchildren(struct node* nodep, struct rect rect) { long long totalsize; int totalheight; @@ -618,7 +618,7 @@ void drawchildren(struct node* nodep, struct rect rect) * Draws a node in the given rectangle, and all of its children * to the "right" of the given rectangle. */ -void drawnode(struct node* nodep, struct rect rect) +static void drawnode(struct node* nodep, struct rect rect) { struct rect subrect; @@ -651,7 +651,7 @@ void drawnode(struct node* nodep, struct rect rect) * clear the rectangle information of a given node * and all of its decendents */ -void clearrects(struct node* nodep) +static void clearrects(struct node* nodep) { struct node* np; @@ -671,7 +671,7 @@ void clearrects(struct node* nodep) } } -void pwd(void) +static void pwd(void) { struct node* np; struct node* stack[MAXDEPTH]; @@ -702,7 +702,7 @@ void pwd(void) } #ifdef NEED_STRDUP -char* strdup(char* s) +static char* strdup(char* s) { int n; char* cp; @@ -874,7 +874,7 @@ XDU Version %s - Keyboard Commands\n\ XDU_VERSION); } -void fprintpsstart(FILE* fp) +static void fprintpsstart(FILE* fp) { fprintf(fp, "%%!\n" @@ -901,7 +901,7 @@ void fprintpsstart(FILE* fp) "/xduorigctm matrix currentmatrix def\n\n"); } -void fprintpsend(FILE* fp) +static void fprintpsend(FILE* fp) { fprintf(fp, "grestore\n" @@ -914,7 +914,7 @@ void fprintpsend(FILE* fp) "%%%%EOF\n"); } -void fprintpsbox(FILE* fp, int x1, int y1, int x2, int y2) +static void fprintpsbox(FILE* fp, int x1, int y1, int x2, int y2) { fprintf(fp, "%%BOX\n" @@ -932,7 +932,7 @@ void fprintpsbox(FILE* fp, int x1, int y1, int x2, int y2) x1, y1, x2 + x1, y1, x2 + x1, y2 + y1, x1, y2 + y1); } -void fprintpstext(FILE* fp, int x, int y, char* s) +static void fprintpstext(FILE* fp, int x, int y, char* s) { fprintf(fp, "%%TEXT\n" @@ -945,7 +945,7 @@ void fprintpstext(FILE* fp, int x, int y, char* s) x, y, s); } -void savepschildren(FILE* fp, struct node* nodep, struct rect rect, int showsize) +static void savepschildren(FILE* fp, struct node* nodep, struct rect rect, int showsize) { long long size, totalsize; int totalheight, @@ -1016,7 +1016,7 @@ void savepschildren(FILE* fp, struct node* nodep, struct rect rect, int showsize } } -void savepsnode(FILE* fp, struct node* nodep, struct rect rect, int showsize) +static void savepsnode(FILE* fp, struct node* nodep, struct rect rect, int showsize) { struct rect subrect; char label[1024], @@ -1081,24 +1081,24 @@ void savetops(char* fname, int showsize) } } -void fprintsvgstart(FILE* fp, int width, int height) +static void fprintsvgstart(FILE* fp, int width, int height) { fprintf(fp, "\n\n", width, height); } -void fprintsvgend(FILE* fp) +static void fprintsvgend(FILE* fp) { fprintf(fp, ""); } -void fprintsvgnode(FILE* fp, struct rect rect) +static void fprintsvgnode(FILE* fp, struct rect rect) { fprintf(fp, " \n", rect.left, rect.top, rect.width, rect.height); } -void fprintsvgnodetext(FILE* fp, int x, int y, long long size, char* name, int showsize) +static void fprintsvgnodetext(FILE* fp, int x, int y, long long size, char* name, int showsize) { char buffer[1024], *text="n/a"; @@ -1135,7 +1135,7 @@ void fprintsvgnodetext(FILE* fp, int x, int y, long long size, char* name, int s x, y, text); } -void savesvgnode(FILE* fp, struct node* nodep, int showsize, int depth) +static void savesvgnode(FILE* fp, struct node* nodep, int showsize, int depth) { struct node* np;