Thread: [digraphanalysis-cvs] digraphanalysis/src output.h, BSDmakefile, main.c, main.h, output.c,
Status: Planning
Brought to you by:
jbreker
|
From: Jeff B. <jb...@us...> - 2005-05-16 23:59:14
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28005 Modified Files: BSDmakefile main.c main.h output.c Added Files: output.h Log Message: +output.h --- NEW FILE: output.h --- /* $Id: output.h,v 1.1 2005/05/16 23:59:03 jbreker Exp $ * * Copyright (C) 2005 Jeff Breker <jb...@sy...> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _OUTPUT_H_ #define _OUTPUT_H_ #include <stdio.h> #include "graph.h" int output_main_directory(char *); void output_report(struct graphlist *); int output_new_directory(char *); void output_file(struct node *, struct graph *); void output_print_list(FILE *, struct graph *); #endif Index: output.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/output.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** output.c 14 May 2005 19:34:29 -0000 1.2 --- output.c 16 May 2005 23:59:03 -0000 1.3 *************** *** 16,33 **** */ - #include <sys/stat.h> #include <sys/types.h> - #include <ctype.h> - #include <err.h> #include <libgen.h> - #include <stdio.h> - #include <stdlib.h> - #include <string.h> #include <sysexits.h> - #include <unistd.h> int ! analysis_main_directory(char *outputdir) { char *dir; --- 16,33 ---- */ #include <sys/types.h> + #include <sys/stat.h> #include <libgen.h> #include <sysexits.h> + #include "output.h" + + /* Note: analysis_main_directory -> output_main_directory + * + * Create and enter the main output directory. + */ int ! output_main_directory(char *outputdir) { char *dir; *************** *** 36,51 **** dir = NULL; rtn = 0; ! /* Create and enter the output directory */ if((dir = dirname(outputdir)) == NULL) ! errx(EX_OSERR, "Error on dirname"); if((chdir(dir) == -1) || ! (create_new_directory(outputdir) == -1) || (chdir(outputdir) == -1)) rtn = -1; return rtn; } void ! analysis_output_report(struct graphlist *graph_list) { struct alias *alias; --- 36,55 ---- dir = NULL; rtn = 0; ! if((dir = dirname(outputdir)) == NULL) ! errx(EX_OSERR, "Cannot obtain dirname of %s", outputdir); ! if((chdir(dir) == -1) || ! (output_new_directory(outputdir) == -1) || (chdir(outputdir) == -1)) rtn = -1; + return rtn; } + /* analysis_output_report -> output_report + */ void ! output_report(struct graphlist *graph_list) { struct alias *alias; *************** *** 122,126 **** int ! create_new_directory(char *dirname) { int rtn; --- 126,130 ---- int ! output_new_directory(char *dirname) { int rtn; *************** *** 150,154 **** unsigned int tmp_size; ! create_new_directory(node->uiddir); chdir(node->uiddir); --- 154,158 ---- unsigned int tmp_size; ! output_new_directory(node->uiddir); chdir(node->uiddir); *************** *** 208,212 **** } ! void print_list(FILE *filep, struct graph *graph) { struct node *node; --- 212,216 ---- } ! void output_print_list(FILE *filep, struct graph *graph) { struct node *node; Index: BSDmakefile =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/BSDmakefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BSDmakefile 26 Apr 2005 03:49:27 -0000 1.1 --- BSDmakefile 16 May 2005 23:59:03 -0000 1.2 *************** *** 19,23 **** graph.c \ main.c \ ! node.c .include <bsd.prog.mk> --- 19,24 ---- graph.c \ main.c \ ! node.c \ ! output.c .include <bsd.prog.mk> Index: main.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/main.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** main.c 14 May 2005 19:34:29 -0000 1.10 --- main.c 16 May 2005 23:59:03 -0000 1.11 *************** *** 43,51 **** graph_list = NULL; ! if(analysis_main_directory(outputdir) == (-1)) return (-1); analysis_nodes(graph); graph_list = analysis_seperate_nodes(graph); ! analysis_output_report(graph_list); return 0; } --- 43,51 ---- graph_list = NULL; ! if(output_main_directory(outputdir) == (-1)) return (-1); analysis_nodes(graph); graph_list = analysis_seperate_nodes(graph); ! output_report(graph_list); return 0; } Index: main.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/main.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** main.h 27 Apr 2005 02:18:26 -0000 1.4 --- main.h 16 May 2005 23:59:03 -0000 1.5 *************** *** 26,40 **** #include "node.h" - int analysis_main_directory(char *); void analysis_nodes(struct graph *); - void analysis_output_report(struct graphlist *); struct graphlist *analysis_seperate_nodes(struct graph *); int do_analysis(struct graph *, char *); char *get_field(void); - void output_file(struct node *, struct graph *); void parse_input(struct graph *); - void print_graph(FILE *, struct nodelist *); void usage(void); - int wot_compare(void *, void *); #endif --- 26,35 ---- |