digraphanalysis-cvs Mailing List for The Digraph Analysis Project
Status: Planning
Brought to you by:
jbreker
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(10) |
Apr
(31) |
May
(27) |
Jun
(16) |
Jul
(10) |
Aug
|
Sep
(27) |
Oct
|
Nov
|
Dec
|
---|
From: Jeff B. <jb...@us...> - 2005-09-20 15:21:39
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src/libdigraph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13869 Added Files: SConstruct Removed Files: Makefile Log Message: sigh... lets try using scons for a while... --- NEW FILE: SConstruct --- env = Environment() digraph_static = Library('digraph', 'digraph.c') digraph_shared = SharedLibrary('digraph', 'digraph.c') env.Install('/usr/local/lib', [digraph_static, digraph_shared]) env.Install('/usr/local/include', 'digraph.h') env.Alias('install', ['/usr/local/lib', '/usr/local/include']) --- Makefile DELETED --- |
From: Jeff B. <jb...@us...> - 2005-09-20 00:35:18
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src/libdigraph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6897/libdigraph Added Files: Makefile digraph.c digraph.h Log Message: move our digraph structs and the functions that operate on them into a library --- NEW FILE: digraph.h --- /* $Id: digraph.h,v 1.1 2005/09/20 00:35:07 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 _DIGRAPH_H_ #define _DIGRAPH_H_ #include <sys/queue.h> #include <stdio.h> struct listlink { void *object; LIST_ENTRY(listlink) list; }; /* This is LIST_HEAD(list, listlink); but with a function pointer embedded in * it for comparison and printing of its objects. */ struct list { struct listlink *lh_first; int (*compare) (void *, void *); void (*print) (FILE *, void *); }; struct node { char *uid; char *uiddir; float msd; struct list *links; }; struct alias { char *uid; char *name; struct node *node; }; struct graph { struct list *alias_list; struct list *node_list; }; int alias_compare(void *, void *); void alias_free(struct alias *); struct alias *alias_new(char *, char *, struct node *); void alias_print(FILE *, void *); int graph_compare(void *, void *); void graph_free(struct graph *); struct graph *graph_new(struct list *, struct list *); void graph_print(FILE *, void *); void *list_add(struct list *, void *); int list_compare(struct list *, struct list *); struct list *list_duplicate(struct list *); void *list_find(struct list *, void *); void list_free(struct list *); struct list *list_intersection(struct list *, struct list *); struct list *list_merge(struct list *, struct list *); struct list *list_new(int (*) (void *, void *), void (*) (FILE *, void *)); struct listlink *list_new_node(void *); void list_print(FILE *, struct list *); void *list_remove(struct list *, void *); unsigned int list_size(struct list *); struct list *list_subtract(struct list *, struct list *); struct list *list_union(struct list *, struct list *); int node_compare(void *, void *); int node_compare_msd(void *, void *); unsigned int node_distance(struct node *, struct node *); void node_free(struct node *); void node_msd(struct node *, struct list *); struct node *node_new(char *); void node_print(FILE *, void *); #endif --- NEW FILE: digraph.c --- /* $Id: digraph.c,v 1.1 2005/09/20 00:35:07 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. */ #include <sys/queue.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "digraph.h" int alias_compare(void *obj1, void *obj2) { struct alias *alias1 = obj1; struct alias *alias2 = obj2; return strcmp(alias1->uid, alias2->uid); } void alias_free(struct alias *alias) { free(alias->uid); free(alias->name); free(alias); alias = NULL; } struct alias * alias_new(char *uid, char *name, struct node *node) { struct alias *alias; if((alias = (struct alias *) malloc(sizeof(struct alias))) != NULL) { if(((alias->uid = (char *) malloc(strlen(uid) + 1)) == NULL) || ((alias->name = (char *) malloc(strlen(name) + 1)) == NULL)) { free(alias->name); free(alias->uid); free(alias); alias = NULL; } else { strlcpy(alias->uid, uid, strlen(uid) + 1); strlcpy(alias->name, name, strlen(name) + 1); alias->node = node; } } return alias; } void alias_print(FILE *filep, void *alias) { fprintf(filep, "%s", ((struct alias *) alias)->name); return; } int graph_compare(void *arg1, void *arg2) { struct graph *graph1; struct graph *graph2; graph1 = arg1; graph2 = arg2; return list_compare(graph1->node_list, graph2->node_list); } struct graph * graph_new(struct list *alias_list, struct list *node_list) { struct graph *graph; if((graph = (struct graph *) malloc(sizeof(struct graph))) != NULL) { graph->alias_list = alias_list; graph->node_list = node_list; } return graph; } void graph_print(FILE *filep, void *arg2) { struct graph *graph; struct listlink *iter; struct alias *alias; graph = arg2; LIST_FOREACH(iter, graph->node_list, list) { alias = list_find(graph->alias_list, alias_new(((struct node *) iter->object)->uid, "", NULL)); fprintf(filep, " "); node_print(filep, iter->object); fprintf(filep, " "); alias_print(filep, alias); fprintf(filep, "\n"); } return; } void * list_add(struct list *list, void *object) { int i; struct listlink *iter; struct listlink *tmpnode; tmpnode = list_new_node(object); if(LIST_EMPTY(list)) LIST_INSERT_HEAD(list, tmpnode, list); else LIST_FOREACH(iter, list, list) { if((i = list->compare(object, iter->object)) < 0) { if(iter == LIST_FIRST(list)) { LIST_INSERT_HEAD(list, tmpnode, list); } else LIST_INSERT_BEFORE(iter, tmpnode, list); break; } else if(i == 0) return iter->object; else if(LIST_NEXT(iter, list) == NULL) LIST_INSERT_AFTER(iter, tmpnode, list); } return object; } struct list * list_duplicate(struct list *list) { struct list *ret_list; if((ret_list = list_new(list->compare, list->print)) != NULL) if((ret_list = list_merge(ret_list, list)) == NULL) { list_free(ret_list); ret_list = NULL; } return ret_list; } /* struct list * list_duplicate(struct list *list) { struct list *ret_list; struct listlink *list_link; ret_list = list_new(list->compare, list->print); LIST_FOREACH(list_link, list, list) list_add(ret_list, list_link->object); return ret_list; } */ void * list_find(struct list *list, void *object) { void *ret_object; int i; struct listlink *iter; iter = NULL; ret_object = NULL; LIST_FOREACH(iter, list, list) { if((i = list->compare(iter->object, object)) == 0) ret_object = iter->object; if(i >= 0) break; } return ret_object; } void list_free(struct list *list) { struct listlink *iter; for(iter = LIST_FIRST(list); !LIST_EMPTY(list); iter = LIST_FIRST(list)) { LIST_REMOVE(iter, list); free(iter); iter = NULL; } free(list); list = NULL; return; } struct list * list_merge(struct list *list1, struct list *list2) { struct listlink *iter; LIST_FOREACH(iter, list2, list) list_add(list1, iter->object); return list1; } struct list * list_new(int (*compare) (void *, void *), void (*print) (FILE *, void *)) { struct list *list; if((list = (struct list *) malloc(sizeof(struct list))) != NULL) { LIST_INIT(list); list->compare = compare; list->print = print; } return list; } struct listlink * list_new_node(void *object) { struct listlink *node; if((node = (struct listlink *) malloc(sizeof(struct listlink))) == NULL) return NULL; node->object = object; return node; } void * list_remove(struct list *list, void *object) { void *ret_object; struct listlink *iter; int i; ret_object = NULL; LIST_FOREACH(iter, list, list) { if((i = list->compare(iter->object, object)) == 0) { ret_object = iter->object; LIST_REMOVE(iter, list); free(iter); } if(i >= 0) break; } return ret_object; } unsigned int list_size(struct list *list) { struct listlink *iter; unsigned int size; size = 0; LIST_FOREACH(iter, list, list) if((size + 1) != 0) ++size; return size; } struct list * list_union(struct list *list1, struct list *list2) { struct list *list; if((list = list_duplicate(list1)) != NULL) if(list_merge(list, list2) == NULL) { list_free(list); list = NULL; } return list; } int list_compare(struct list *list1, struct list *list2) { return list1->compare(LIST_FIRST(list1)->object, LIST_FIRST(list2)->object); } struct list * list_intersection(struct list *list1, struct list *list2) { struct listlink *iter; struct list *ret_list; ret_list = list_new(list1->compare, list1->print); LIST_FOREACH(iter, list1, list) if(list_find(list2, iter->object) != NULL) list_add(ret_list, iter->object); return ret_list; } void list_print(FILE *filep, struct list *list) { struct listlink *iter; LIST_FOREACH(iter, list, list) list->print(filep, iter->object); return; } struct list * list_subtract(struct list *list1, struct list *list2) { struct listlink *iter; struct list *ret_list; ret_list = list_duplicate(list1); LIST_FOREACH(iter, list2, list) list_remove(ret_list, iter->object); return ret_list; } void node_free(struct node *node) { free(node->uid); list_free(node->links); free(node); } struct node * node_new(char *uid) { struct node *node; size_t len; node = (struct node *) malloc(sizeof(struct node *)); len = strlen(uid) + 1; node->uid = (char *) malloc(len); node->uiddir = (char *) malloc((len >= 3)?3:len); strlcpy(node->uid, uid, len); strlcpy(node->uiddir, uid, (len >=3)?3:len); node->msd = 0; node->links = list_new(node_compare, node_print); return node; } void node_print(FILE *filep, void *node) { fprintf(filep, "%s", ((struct node *) node)->uid); return; } int node_compare(void *node1, void *node2) { return strcmp(((struct node *) node1)->uid, ((struct node *) node2)->uid); } int node_compare_msd(void *node1, void *node2) { int i; float float_tmp; float_tmp = ((struct node *) node1)->msd - ((struct node *) node2)->msd; if(float_tmp == (float) 0) i = node_compare(node1, node2); else if(float_tmp > (float) 0) i = 1; else i = (-1); return i; } /* keyto == node1 * keyfrom == node2 * traversed_keys == traversed_nodes * tmp_keys == tmp_nodes * list_merge_list == nodelist_merge */ unsigned int node_distance(struct node *node1, struct node *node2) { unsigned int distance; unsigned int last_known_size, tmpsize; struct list *traversed_nodes, *tmp_nodes; struct listlink *tmp_node; traversed_nodes = list_new(node_compare, node_print); last_known_size = 0; distance = 1; list_merge(traversed_nodes, node1->links); while((tmpsize = list_size(traversed_nodes)) != last_known_size) { if(list_find(traversed_nodes, node2) != NULL) return distance; last_known_size = tmpsize; ++distance; tmp_nodes = traversed_nodes; tmp_node = LIST_FIRST(tmp_nodes); traversed_nodes = list_new(node_compare, node_print); while(tmp_node != NULL) { list_add(traversed_nodes, tmp_node->object); list_merge(traversed_nodes, ((struct node *) tmp_node->object)->links); tmp_node = LIST_NEXT(tmp_node, list); } } return 0; } void node_msd(struct node *node, struct list *nodes) { unsigned int distance, i, num_nodes; struct listlink *iter; distance = 0; num_nodes = 0; LIST_FOREACH(iter, nodes, list) { i = node_distance(node, iter->object); if(i > 0) { distance += i; num_nodes++; } } node->msd = ((float) distance) / ((float) num_nodes); return; } --- NEW FILE: Makefile --- LIB= digraph LIBDIR= /usr/local/lib LINTLIBDIR= /usr/local/libdata/lint SRCS= digraph.c .include <../../mk/bsd.lib.mk> |
From: Jeff B. <jb...@us...> - 2005-09-20 00:35:18
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6897 Removed Files: alias.c alias.h graph.c graph.h list.c list.h node.c node.h Log Message: move our digraph structs and the functions that operate on them into a library --- node.c DELETED --- --- list.c DELETED --- --- node.h DELETED --- --- list.h DELETED --- --- alias.c DELETED --- --- graph.h DELETED --- --- alias.h DELETED --- --- graph.c DELETED --- |
From: Jeff B. <jb...@us...> - 2005-09-20 00:33:22
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src/libdigraph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5971/libdigraph Log Message: Directory /cvsroot/digraphanalysis/digraphanalysis/src/libdigraph added to the repository |
From: Jeff B. <jb...@us...> - 2005-09-19 22:04:00
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src/digraph_analyze In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3325 Modified Files: main.c Log Message: remove option to resume, implement in the future Index: main.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/digraph_analyze/main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** main.c 18 Sep 2005 13:40:51 -0000 1.3 --- main.c 19 Sep 2005 22:03:51 -0000 1.4 *************** *** 24,30 **** struct graph *analyze_msd(struct graph *); struct list *analyze_subgraphs(struct graph *); - void dump_partial_analysis(struct graph *, struct graph *, struct list *); struct graph *read_input(FILE *); - int resume_analysis(char **, char **, struct graph **, struct graph **, struct list **); void usage(void); int write_output(FILE *, struct graph *, struct list *); --- 24,28 ---- *************** *** 112,116 **** char *inputfile = NULL; char *outputfile = NULL; - char *resumefile = NULL; int rtncode = EX_OK; struct list *subgraphs = NULL; --- 110,113 ---- *************** *** 118,122 **** /* Parse arguments */ ! while((c = getopt(argc, argv, "i:o:r:")) != -1) switch (c) { --- 115,119 ---- /* Parse arguments */ ! while((c = getopt(argc, argv, "i:o:")) != -1) switch (c) { *************** *** 127,133 **** outputfile = optarg; break; - case 'r': - resumefile = optarg; - break; default: usage(); --- 124,127 ---- *************** *** 135,143 **** } - /* Load the resume file if given - */ - if(resumefile != NULL) - resume_analysis(&inputfile, &outputfile, &graph_raw, &graph_msd, &subgraphs); - /* Open the input file or stdin if no file given */ --- 129,132 ---- *************** *** 199,207 **** } void usage(void) { extern char *__progname; ! fprintf(stderr, "usage: %s [[-i <inputfile>] [-o <outputfile]] || [-r <resumefile>]\n", __progname); return; --- 188,236 ---- } + struct graph *read_input(FILE *filein) + { + struct graph *graph = NULL; + + graph = graph_new(list_new(alias_compare, alias_print), list_new(node_compare, node_print)); + + while((line = read_line(filein)) != NULL) + { + type = get_field(&line); + node1 = node_new(get_field(&line)); + if((node_tmp = graph_add_node(graph, node1)) != node1) + { + node_free(node1); + node1 = node_tmp; + } + if(strcmp(type, "n") == 0) + { + alias1 = alias_new(get_field(&line), get_field(&line), node1); + if((alias_tmp = graph_add_alias(graph, alias)) != alias1) + alias_free(alias1); + } + else + if(strcmp(type. "e") == 0) + { + node2 = node_new(get_field(&line)); + if((node_tmp = graph_add_node(graph, node2)) != node2) + { + node_free(node2); + node2 = node_tmp; + } + node_add_link(node1, node2); + } + else + err(ER_DATAERR, "type(%s) is not valid!\n", type); + } + /* *line should == '\0' by now (ie at the very end of what got returned by read_line */ + + return graph; + } + void usage(void) { extern char *__progname; ! fprintf(stderr, "usage: %s [-i <inputfile>] [-o <outputfile]\n", __progname); return; |
From: Jeff B. <jb...@us...> - 2005-09-18 13:40:59
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src/digraph_analyze In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9369 Modified Files: main.c Log Message: finish up analyze_subgraphs Index: main.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/digraph_analyze/main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.c 18 Sep 2005 03:08:32 -0000 1.2 --- main.c 18 Sep 2005 13:40:51 -0000 1.3 *************** *** 52,75 **** struct list *analyze_subgraphs(struct graph *graph_msd) { ! struct graph *graph; ! struct listlink *graph_link; ! struct node *node; ! struct listlink *node_link; ! struct list *subgraphs; if((subgraphs = list_new(graph_compare, graph_print)) == NULL) err(EX_UNAVAILABLE, "list_new(graph_compare, graph_print) == NULL"); ! LIST_FOREACH(node_link, graph_msd->node_list, list) { LIST_FOREACH(graph_link, subgraphs, list) ! if((node = graph_find_node(graph_link->object, node_link->object)) != NULL) break; if(node == NULL) { graph = graph_new(graph_msd->alias_list, list_new(node_compare_msd, node_print)); ! graph_add_node(graph, node_link->object); ! /* todo: Add strongly connected links */ list_add(subgraphs, graph); } } --- 52,97 ---- struct list *analyze_subgraphs(struct graph *graph_msd) { ! struct graph *graph = NULL; ! struct listlink *graph_link = NULL; ! struct node *node = NULL; ! struct listlink *node_link1 = NULL; ! struct listlink *node_link2 = NULL; ! struct listlink *node_link3 = NULL; ! unsigned int size_old = 0; ! unsigned int size_new = 0; ! struct list *subgraphs = NULL; if((subgraphs = list_new(graph_compare, graph_print)) == NULL) err(EX_UNAVAILABLE, "list_new(graph_compare, graph_print) == NULL"); ! LIST_FOREACH(node_link1, graph_msd->node_list, list) { LIST_FOREACH(graph_link, subgraphs, list) ! if((node = graph_find_node(graph_link->object, node_link1->object)) != NULL) break; if(node == NULL) { + /* Create a new graph and add the node to it. + */ graph = graph_new(graph_msd->alias_list, list_new(node_compare_msd, node_print)); ! graph_add_node(graph, node_link1->object); ! ! /* Add all strongly connected links to the graph. ! */ ! size_new = list_size(graph->node_list); ! while(size_old != size_new) ! { ! size_old = size_new; ! LIST_FOREACH(node_link2, graph->node_list, list) ! LIST_FOREACH(node_link3, node_link2->object->links, list) ! if(list_find(node_link3->object->links, nodelink2->object) != NULL) ! graph_add_node(graph, node_link3->object); ! size_new = list_size(graph->node_list); ! } ! ! /* Add the graph to subgraphs. ! */ list_add(subgraphs, graph); + graph = NULL; } } |
From: Jeff B. <jb...@us...> - 2005-09-18 03:08:40
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src/digraph_analyze In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2648/digraph_analyze Modified Files: main.c Log Message: implement some parts Index: main.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/digraph_analyze/main.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.c 17 Sep 2005 22:53:46 -0000 1.1 --- main.c 18 Sep 2005 03:08:32 -0000 1.2 *************** *** 34,38 **** struct graph *analyze_msd(struct graph *graph) { ! struct graph *graph_msd = NULL; return graph_msd; --- 34,47 ---- struct graph *analyze_msd(struct graph *graph) { ! struct graph *graph_msd = NULL; ! struct listlink *node_link = NULL; ! ! graph_msd = graph_new(graph->alias_list, list_new(node_compare_msd, node_print)); ! ! LIST_FOREACH(node_link, graph->node_list, list) ! { ! node_msd(node_link->object, graph->node_list); ! graph_add_node(graph_msd, node_link->object); ! } return graph_msd; *************** *** 43,51 **** struct list *analyze_subgraphs(struct graph *graph_msd) { ! struct list *subgraphs; ! if((subgraphs = list_new()) == NULL) ! err(EX_UNAVAILABLE, "list_new() == NULL"); return subgraphs; } --- 52,78 ---- struct list *analyze_subgraphs(struct graph *graph_msd) { ! struct graph *graph; ! struct listlink *graph_link; ! struct node *node; ! struct listlink *node_link; ! struct list *subgraphs; ! if((subgraphs = list_new(graph_compare, graph_print)) == NULL) ! err(EX_UNAVAILABLE, "list_new(graph_compare, graph_print) == NULL"); + LIST_FOREACH(node_link, graph_msd->node_list, list) + { + LIST_FOREACH(graph_link, subgraphs, list) + if((node = graph_find_node(graph_link->object, node_link->object)) != NULL) + break; + if(node == NULL) + { + graph = graph_new(graph_msd->alias_list, list_new(node_compare_msd, node_print)); + graph_add_node(graph, node_link->object); + /* todo: Add strongly connected links */ + list_add(subgraphs, graph); + } + } + return subgraphs; } |
From: Jeff B. <jb...@us...> - 2005-09-17 22:53:53
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src/digraph_analyze In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21203 Added Files: main.c Log Message: Outline digraph_analyze --- NEW FILE: main.c --- /* $Id: main.c,v 1.1 2005/09/17 22:53:46 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. */ #include <err.h> #include <stdio.h> #include <stdlib.h> #include <sysexits.h> #include <unistd.h> struct graph *analyze_msd(struct graph *); struct list *analyze_subgraphs(struct graph *); void dump_partial_analysis(struct graph *, struct graph *, struct list *); struct graph *read_input(FILE *); int resume_analysis(char **, char **, struct graph **, struct graph **, struct list **); void usage(void); int write_output(FILE *, struct graph *, struct list *); /* Iterate through the graph and calculate the msd for each node. */ struct graph *analyze_msd(struct graph *graph) { struct graph *graph_msd = NULL; return graph_msd; } /* Iterate through the graph and seperate the nodes into thier respected strongly connected sets. */ struct list *analyze_subgraphs(struct graph *graph_msd) { struct list *subgraphs; if((subgraphs = list_new()) == NULL) err(EX_UNAVAILABLE, "list_new() == NULL"); return subgraphs; } /* Reads in output from gpg2digraph, calculates msd and dumps data back out to * a file readable by digraph_report. */ int main(int argc, char **argv) { int c = 0; FILE *filein = NULL; FILE *fileout = NULL; struct graph *graph_msd = NULL; struct graph *graph_raw = NULL; char *inputfile = NULL; char *outputfile = NULL; char *resumefile = NULL; int rtncode = EX_OK; struct list *subgraphs = NULL; /* Parse arguments */ while((c = getopt(argc, argv, "i:o:r:")) != -1) switch (c) { case 'i': inputfile = optarg; break; case 'o': outputfile = optarg; break; case 'r': resumefile = optarg; break; default: usage(); exit(EX_USAGE); } /* Load the resume file if given */ if(resumefile != NULL) resume_analysis(&inputfile, &outputfile, &graph_raw, &graph_msd, &subgraphs); /* Open the input file or stdin if no file given */ if(inputfile == NULL) filein = stdin; else if((filein = fopen(inputfile, "r")) == NULL) err(errno, "fopen(\"%s\", \"r\") == NULL", inputfile); /* Open the output file or stdout if no file given */ if(outputfile == NULL) fileout = stdout; else if((fileout = fopen(outputfile, "w")) == NULL) err(errno, "fopen(\"%s\", \"w\") == NULL", outputfile); /* Parse the input data */ if(graph_raw == NULL) { graph_raw = read_input(filein); if(graph_raw == NULL) err(EX_UNAVAILABLE, "read_input(filein) == NULL"); } /* Analyze the msd of each node */ if(graph_msd == NULL) { graph_msd = analyze_msd(graph_raw); if(graph_msd == NULL) err(EX_UNAVAILABLE, "analyze_msd(graph_raw) == NULL"); } /* Analyze the entire digraph, seperating strongly connected sets into thier own subgraph of the master graph. */ if(subgraphs == NULL) { subgraphs = analyze_subgraphs(graph_msd); if(subgraphs_by_msd == NULL) err(EX_UNAVAILABLE, "analyze_subgraphs(graph_msd) == NULL"); } /* Output the analysis data */ rtncode = write_output(fileout, graph_msd, subgraphs); if(rtncode != EX_OK) err(EX_UNAVAILABLE, "write_output(fileout, graph_msd, subgraphs) != EX_OK"); /* Close the input and output streams */ if(filein != stdin) fclose(filein); if(fileout != stdout) fclose(fileout); return EX_OK; } void usage(void) { extern char *__progname; fprintf(stderr, "usage: %s [[-i <inputfile>] [-o <outputfile]] || [-r <resumefile>]\n", __progname); return; } |
Update of /cvsroot/digraphanalysis/digraphanalysis/mk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26429/mk Added Files: bsd.dep.mk bsd.doc.mk bsd.lib.mk bsd.lkm.mk bsd.man.mk bsd.nls.mk bsd.obj.mk bsd.own.mk bsd.port.mk bsd.port.subdir.mk bsd.prog.mk bsd.regress.mk bsd.subdir.mk bsd.sys.mk Log Message: commit the openbsd build system into our repository in order to utilize it while building on other platforms --- NEW FILE: bsd.own.mk --- # $OpenBSD: bsd.own.mk,v 1.93 2005/08/08 05:53:01 espie Exp $ # $NetBSD: bsd.own.mk,v 1.24 1996/04/13 02:08:09 thorpej Exp $ # Host-specific overrides .if defined(MAKECONF) && exists(${MAKECONF}) .include "${MAKECONF}" .elif exists(/etc/mk.conf) .include "/etc/mk.conf" .endif # Set `WARNINGS' to `yes' to add appropriate warnings to each compilation WARNINGS?= no # Set `SKEY' to `yes' to build with support for S/key authentication. SKEY?= yes # Set `KERBEROS5' to `yes' to build with support for Kerberos5 authentication. KERBEROS5?= yes # Set `YP' to `yes' to build with support for NIS/YP. YP?= yes # Set `TCP_WRAPPERS' to `yes' to build certain networking daemons with # integrated support for libwrap. TCP_WRAPPERS?= yes # Set `AFS` to `yes' to build with AFS support. AFS?= yes # Set `DEBUGLIBS' to `yes' to build libraries with debugging symbols DEBUGLIBS?= no # Set toolchain to be able to know differences. .if ${MACHINE_ARCH} == "m68k" || ${MACHINE_ARCH} == "m88k" || \ ${MACHINE_ARCH} == "vax" ELF_TOOLCHAIN?= no .else ELF_TOOLCHAIN?= yes .endif # gcc3 .if ${MACHINE_ARCH} == "alpha" || \ ${MACHINE_ARCH} == "m68k" || ${MACHINE_ARCH} == "m88k" || \ ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "vax" USE_GCC3?=no .else USE_GCC3?=yes .endif # where the system object and source trees are kept; can be configurable # by the user in case they want them in ~/foosrc and ~/fooobj, for example BSDSRCDIR?= /usr/src BSDOBJDIR?= /usr/obj BINGRP?= bin BINOWN?= root BINMODE?= 555 NONBINMODE?= 444 DIRMODE?= 755 # Define MANZ to have the man pages compressed (gzip) #MANZ= 1 # Define MANPS to have PostScript manual pages generated #MANPS= 1 SHAREDIR?= /usr/share SHAREGRP?= bin SHAREOWN?= root SHAREMODE?= ${NONBINMODE} MANDIR?= /usr/share/man/cat MANGRP?= bin MANOWN?= root MANMODE?= ${NONBINMODE} PSDIR?= /usr/share/man/ps PSGRP?= bin PSOWN?= root PSMODE?= ${NONBINMODE} LIBDIR?= /usr/lib LINTLIBDIR?= /usr/libdata/lint LIBGRP?= ${BINGRP} LIBOWN?= ${BINOWN} LIBMODE?= ${NONBINMODE} DOCDIR?= /usr/share/doc DOCGRP?= bin DOCOWN?= root DOCMODE?= ${NONBINMODE} LKMDIR?= /usr/lkm LKMGRP?= ${BINGRP} LKMOWN?= ${BINOWN} LKMMODE?= ${NONBINMODE} NLSDIR?= /usr/share/nls NLSGRP?= bin NLSOWN?= root NLSMODE?= ${NONBINMODE} LOCALEDIR?= /usr/share/locale LOCALEGRP?= wheel LOCALEOWN?= root LOCALEMODE?= ${NONBINMODE} # Shared files for system gnu configure, not used yet GNUSYSTEM_AUX_DIR?=${BSDSRCDIR}/share/gnu INSTALL_COPY?= -c .ifndef DEBUG INSTALL_STRIP?= -s .endif # This may be changed for _single filesystem_ configurations (such as # routers and other embedded systems); normal systems should leave it alone! STATIC?= -static # Define SYS_INCLUDE to indicate whether you want symbolic links to the system # source (``symlinks''), or a separate copy (``copies''); (latter useful # in environments where it's not possible to keep /sys publicly readable) #SYS_INCLUDE= symlinks # don't try to generate PIC versions of libraries on machines # which don't support PIC. .if (${MACHINE_ARCH} == "vax") || (${MACHINE_ARCH} == "m88k") NOPIC= .endif # pic relocation flags. .if (${MACHINE_ARCH} == "sparc64") PICFLAG=-fPIC .else PICFLAG=-fpic . if ${MACHINE_ARCH} == "m68k" # Function CSE makes gas -k not recognize external function calls as lazily # resolvable symbols, thus sometimes making ld.so report undefined symbol # errors on symbols found in shared library members that would never be # called. Ask ni...@op... for details. PICFLAG+=-fno-function-cse . endif .endif .if (${MACHINE_ARCH} == "sparc64") || (${MACHINE_ARCH} == "sparc") ASPICFLAG=-KPIC .elif (${ELF_TOOLCHAIN:L} == "no") ASPICFLAG=-k .endif # don't try to generate PROFILED versions of libraries on machines # which don't support profiling. .if 0 NOPROFILE= .endif # No lint, for now. NOLINT= BSD_OWN_MK=Done .PHONY: spell clean cleandir obj manpages print all \ depend beforedepend afterdepend cleandepend \ all lint cleanman nlsinstall cleannls includes \ beforeinstall realinstall maninstall afterinstall install --- NEW FILE: bsd.prog.mk --- # $OpenBSD: bsd.prog.mk,v 1.44 2005/04/15 17:18:57 espie Exp $ # $NetBSD: bsd.prog.mk,v 1.55 1996/04/08 21:19:26 jtc Exp $ # @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" .endif .include <bsd.own.mk> .SUFFIXES: .out .o .c .cc .C .cxx .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0 .if ${WARNINGS:L} == "yes" CFLAGS+= ${CDIAGFLAGS} CXXFLAGS+= ${CXXDIAGFLAGS} .endif CFLAGS+= ${COPTS} CXXFLAGS+= ${CXXOPTS} .if (${ELF_TOOLCHAIN:L} == "yes") CRTBEGIN?= ${DESTDIR}/usr/lib/crtbegin.o CRTEND?= ${DESTDIR}/usr/lib/crtend.o .endif LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o LIB45?= ${DESTDIR}/usr/lib/lib45.a LIBACL?= ${DESTDIR}/usr/lib/libacl.a LIBASN1?= ${DESTDIR}/usr/lib/libasn1.a LIBC?= ${DESTDIR}/usr/lib/libc.a LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a LIBCRYPTO?= ${DESTDIR}/usr/lib/libcrypto.a LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a LIBDES?= ${DESTDIR}/usr/lib/libdes.a LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a LIBEVENT?= ${DESTDIR}/usr/lib/libevent.a LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a LIBGSSAPI?= ${DESTDIR}/usr/lib/libgssapi.a LIBHDB?= ${DESTDIR}/usr/lib/libhdb.a LIBKADM?= ${DESTDIR}/usr/lib/libkadm.a LIBKADM5CLNT?= ${DESTDIR}/usr/lib/libkadm5clnt.a LIBKADM5SRV?= ${DESTDIR}/usr/lib/libkadm5srv.a LIBKAFS?= ${DESTDIR}/usr/lib/libkafs.a LIBKDB?= ${DESTDIR}/usr/lib/libkdb.a LIBKEYNOTE?= ${DESTDIR}/usr/lib/libkeynote.a LIBKRB?= ${DESTDIR}/usr/lib/libkrb.a LIBKRB5?= ${DESTDIR}/usr/lib/libkrb5.a LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a LIBL?= ${DESTDIR}/usr/lib/libl.a LIBM?= ${DESTDIR}/usr/lib/libm.a LIBOLDCURSES?= ${DESTDIR}/usr/lib/libocurses.a LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a LIBPERL?= ${DESTDIR}/usr/lib/libperl.a LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a LIBSECTOK?= ${DESTDIR}/usr/lib/libsectok.a LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a LIBSSL?= ${DESTDIR}/usr/lib/libssl.a LIBTELNET?= ${DESTDIR}/usr/lib/libtelnet.a LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a LIBTERMLIB?= ${DESTDIR}/usr/lib/libtermlib.a LIBUSB?= ${DESTDIR}/usr/lib/libusbhid.a LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a LIBY?= ${DESTDIR}/usr/lib/liby.a LIBZ?= ${DESTDIR}/usr/lib/libz.a .if (${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "amd64" || \ ${MACHINE_ARCH} == "i386") LIBARCH?= ${DESTDIR}/usr/lib/lib${MACHINE_ARCH}.a .else LIBARCH?= .endif # old stuff LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a LIBMP?= ${DESTDIR}/usr/lib/libmp.a LIBPC?= ${DESTDIR}/usr/lib/libpc.a LIBPLOT?= ${DESTDIR}/usr/lib/libplot.a LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a .if defined(PROG) SRCS?= ${PROG}.c . if !empty(SRCS:N*.h:N*.sh) OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g} LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} . endif . if defined(OBJS) && !empty(OBJS) . if !empty(SRCS:M*.C) || !empty(SRCS:M*.cc) || !empty(SRCS:M*.cxx) ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD} ${CXX} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD} . else ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD} ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD} . endif . endif # defined(OBJS) && !empty(OBJS) . if !defined(MAN) MAN= ${PROG}.1 . endif # !defined(MAN) .endif # defined(PROG) .MAIN: all all: ${PROG} _SUBDIRUSE .if !target(clean) clean: _SUBDIRUSE rm -f a.out [Ee]rrs mklog core *.core \ ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES} .endif cleandir: _SUBDIRUSE clean .if !target(install) .if !target(beforeinstall) beforeinstall: .endif .if !target(afterinstall) afterinstall: .endif .if !target(realinstall) realinstall: .if defined(PROG) ${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o ${BINOWN} -g ${BINGRP} \ -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR}/${PROG} .endif .endif install: maninstall _SUBDIRUSE .if defined(LINKS) && !empty(LINKS) . for lnk file in ${LINKS} @l=${DESTDIR}${lnk}; \ t=${DESTDIR}${file}; \ echo $$t -\> $$l; \ rm -f $$t; ln $$l $$t . endfor .endif maninstall: afterinstall afterinstall: realinstall realinstall: beforeinstall .endif .if !target(lint) lint: ${LOBJS} .if defined(LOBJS) && !empty(LOBJS) @${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD} .endif .endif .if !defined(NOMAN) .include <bsd.man.mk> .endif .if !defined(NONLS) .include <bsd.nls.mk> .endif .include <bsd.obj.mk> .include <bsd.dep.mk> .include <bsd.subdir.mk> .include <bsd.sys.mk> --- NEW FILE: bsd.lkm.mk --- # $OpenBSD: bsd.lkm.mk,v 1.19 2003/05/20 22:49:13 millert Exp $ .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" .endif .include <bsd.own.mk> .SUFFIXES: .out .o .c .cc .C .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0 # XXX In order to at least diminish the brokenness of trusting /sys to point # to the tree we're actually belonging to we check BSDSRCDIR. On multi-tree # machines /sys isn't always a link to the correct tree. .if defined(BSDSRCDIR) CFLAGS+= ${COPTS} -D_KERNEL -D_LKM -I${BSDSRCDIR}/sys -I${BSDSRCDIR}/sys/arch .else CFLAGS+= ${COPTS} -D_KERNEL -D_LKM -I/sys -I/sys/arch .endif .if ${WARNINGS:L} == "yes" CFLAGS+= ${CDIAGFLAGS} .endif LDFLAGS+= -r .if defined(LKM) SRCS?= ${LKM}.c .if !empty(SRCS:N*.h:N*.sh) OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g} LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} .endif COMBINED?=combined.o .if !defined(POSTINSTALL) POSTINSTALL= ${LKM}install .endif .if defined(OBJS) && !empty(OBJS) ${COMBINED}: ${OBJS} ${DPADD} ${LD} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .endif # defined(OBJS) && !empty(OBJS) .if !defined(MAN) MAN= ${LKM}.1 .endif # !defined(MAN) .endif # defined(LKM) .MAIN: all all: ${COMBINED} _SUBDIRUSE .if !target(clean) clean: _SUBDIRUSE rm -f a.out [Ee]rrs mklog core *.core \ ${LKM} ${COMBINED} ${OBJS} ${LOBJS} ${CLEANFILES} .endif cleandir: _SUBDIRUSE clean .if !target(install) .if !target(beforeinstall) beforeinstall: .endif .if !target(afterinstall) afterinstall: .endif .if !target(realinstall) realinstall: .if defined(LKM) ${INSTALL} ${INSTALL_COPY} -o ${LKMOWN} -g ${LKMGRP} -m ${LKMMODE} \ ${COMBINED} ${DESTDIR}${LKMDIR}/${LKM}.o .if exists(${.CURDIR}/${POSTINSTALL}) ${INSTALL} ${INSTALL_COPY} -o ${LKMOWN} -g ${LKMGRP} -m 555 \ ${.CURDIR}/${POSTINSTALL} ${DESTDIR}${LKMDIR} .endif .endif .endif load: ${COMBINED} if [ -x ${.CURDIR}/${POSTINSTALL} ]; then \ modload -d -o $(LKM) -e$(LKM) -p${.CURDIR}/${POSTINSTALL} $(COMBINED); \ else \ modload -d -o $(LKM) -e$(LKM) $(COMBINED); \ fi unload: modunload -n $(LKM) install: maninstall _SUBDIRUSE .if defined(LINKS) && !empty(LINKS) @set ${LINKS}; \ while test $$# -ge 2; do \ l=${DESTDIR}${LKMDIR}/$$1; \ shift; \ t=${DESTDIR}${LKMDIR}/$$1; \ shift; \ echo $$t -\> $$l; \ rm -f $$t; \ ln $$l $$t; \ done; true .endif maninstall: afterinstall afterinstall: realinstall realinstall: beforeinstall .endif .if !target(lint) lint: ${LOBJS} .if defined(LOBJS) && !empty(LOBJS) @${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD} .endif .endif .if !defined(NOMAN) .include <bsd.man.mk> .endif .if !defined(NONLS) .include <bsd.nls.mk> .endif .include <bsd.obj.mk> .include <bsd.dep.mk> .include <bsd.subdir.mk> .include <bsd.sys.mk> .PHONY: load unload --- NEW FILE: bsd.dep.mk --- # $OpenBSD: bsd.dep.mk,v 1.5 2003/08/07 11:24:03 espie Exp $ # $NetBSD: bsd.dep.mk,v 1.12 1995/09/27 01:15:09 christos Exp $ # some of the rules involve .h sources, so remove them from mkdep line .if !target(depend) depend: beforedepend .depend _SUBDIRUSE afterdepend . if defined(SRCS) .depend: ${SRCS} @rm -f .depend @files="${.ALLSRC:M*.s} ${.ALLSRC:M*.S}"; \ if [ "$$files" != " " ]; then \ echo mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} ${CPPFLAGS} ${AINC} $$files;\ mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} ${CPPFLAGS} ${AINC} $$files; \ fi @files="${.ALLSRC:M*.c}"; \ if [ "$$files" != "" ]; then \ echo mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \ mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \ fi @files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \ if [ "$$files" != " " ]; then \ echo mkdep -a ${MKDEP} ${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \ mkdep -a ${MKDEP} ${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \ fi . else .depend: . endif . if !target(beforedepend) beforedepend: . endif . if !target(afterdepend) afterdepend: . endif .endif .if !target(tags) . if defined(SRCS) tags: ${SRCS} _SUBDIRUSE -cd ${.CURDIR}; ${CTAGS} -f /dev/stdout ${.ALLSRC:N*.h} | \ sed "s;\${.CURDIR}/;;" > tags . else tags: . endif .endif .if defined(SRCS) cleandir: cleandepend cleandepend: rm -f .depend ${.CURDIR}/tags .endif .PHONY: beforedepend depend afterdepend cleandepend --- NEW FILE: bsd.regress.mk --- # $OpenBSD: bsd.regress.mk,v 1.10 2002/09/02 19:56:55 avsm Exp $ # Documented in bsd.regress.mk(5) # No man pages for regression tests. NOMAN= # No installation. install: # If REGRESS_TARGETS is defined and PROG is not defined, set NOPROG .if defined(REGRESS_TARGETS) && !defined(PROG) NOPROG= .endif .include <bsd.prog.mk> .MAIN: all all: regress # Check for deprecated REGRESS* variables and assign them to the # new versions if the new version is not already defined. _REGRESS_DEPRECATED=LOG:LOG SKIPTARGETS:SKIP_TARGETS SKIPSLOW:SKIP_SLOW \ SKIP:SKIP TARGETS:TARGETS MAXTIME:MAXTIME ROOTTARGETS:ROOT_TARGETS .for _I in ${_REGRESS_DEPRECATED} _REGRESS_OLD=REGRESS${_I:C/\:.*//} _REGRESS_NEW=REGRESS_${_I:C/.*\://} . if defined(${_REGRESS_OLD}) ERRORS:= ${ERRORS} "Warning: ${_REGRESS_OLD} is deprecated, use ${_REGRESS_NEW} instead." . if !defined(${_REGRESS_NEW}) ${_REGRESS_NEW}:=${${_REGRESS_OLD}} . endif . endif .endfor # XXX - Need full path to REGRESS_LOG, otherwise there will be much pain. REGRESS_LOG?=/dev/null REGRESS_SKIP_TARGETS?= REGRESS_SKIP_SLOW?=no _REGRESS_NAME=${.CURDIR:S/${BSDSRCDIR}\/regress\///} _REGRESS_TMP?=/dev/null _REGRESS_OUT= | tee -a ${REGRESS_LOG} ${_REGRESS_TMP} 2>&1 > /dev/null .if defined(PROG) && !empty(PROG) run-regress-${PROG}: ${PROG} ./${PROG} .endif .if !defined(REGRESS_TARGETS) REGRESS_TARGETS=run-regress-${PROG} . if defined(REGRESS_SKIP) REGRESS_SKIP_TARGETS=run-regress-${PROG} . endif .endif .if defined(REGRESS_SLOW_TARGETS) && !empty(REGRESS_SKIP_SLOW) REGRESS_SKIP_TARGETS+=${REGRESS_SLOW_TARGETS} .endif .if defined(REGRESS_ROOT_TARGETS) _ROOTUSER!=id -g SUDO?= . if (${_ROOTUSER} != 0) && empty(SUDO) REGRESS_SKIP_TARGETS+=${REGRESS_ROOT_TARGETS} . endif .endif .if defined(ERRORS) .BEGIN: . for _m in ${ERRORS} @echo 1>&2 ${_m} . endfor . if !empty(ERRORS:M"Fatal\:*") || !empty(ERRORS:M'Fatal\:*') @exit 1 . endif .endif regress: .SILENT .if ! ${REGRESS_LOG:M/*} echo ========================================================= echo REGRESS_LOG must contain an absolute path to the log-file. echo It currently points to: ${REGRESS_LOG} echo ========================================================= exit 1 .endif .for RT in ${REGRESS_TARGETS} . if ${REGRESS_SKIP_TARGETS:M${RT}} @echo -n "SKIP " ${_REGRESS_OUT} . else # XXX - we need a better method to see if a test fails due to timeout or just # normal failure. . if !defined(REGRESS_MAXTIME) -if cd ${.CURDIR} && ${MAKE} ${RT}; then \ echo -n "SUCCESS " ${_REGRESS_OUT} ; \ else \ echo -n "FAIL " ${_REGRESS_OUT} ; \ echo FAILED ; \ fi . else -if cd ${.CURDIR} && (ulimit -t ${REGRESS_MAXTIME} ; ${MAKE} ${RT}); then \ echo -n "SUCCESS " ${_REGRESS_OUT} ; \ else \ echo -n "FAIL (possible timeout) " ${_REGRESS_OUT} ; \ echo FAILED ; \ fi . endif . endif @echo ${_REGRESS_NAME}/${RT:S/^run-regress-//} ${_REGRESS_OUT} .endfor .PHONY: regress --- NEW FILE: bsd.subdir.mk --- # $OpenBSD: bsd.subdir.mk,v 1.14 2005/02/05 10:39:50 espie Exp $ # $NetBSD: bsd.subdir.mk,v 1.11 1996/04/04 02:05:06 jtc Exp $ # @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91 .if !target(.MAIN) .MAIN: all .endif # Make sure this is defined SKIPDIR?= _SUBDIRUSE: .USE .if defined(SUBDIR) @for entry in ${SUBDIR}; do \ (set -e; if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ _newdir_="$${entry}.${MACHINE}"; \ else \ _newdir_="$${entry}"; \ fi; \ if test X"${_THISDIR_}" = X""; then \ _nextdir_="$${_newdir_}"; \ else \ _nextdir_="$${_THISDIR_}/$${_newdir_}"; \ fi; \ _makefile_spec_=""; \ if [ -e ${.CURDIR}/$${_newdir_}/Makefile.bsd-wrapper ]; then \ _makefile_spec_="-f Makefile.bsd-wrapper"; \ fi; \ subskipdir=''; \ for skipdir in ${SKIPDIR}; do \ subentry=$${skipdir#$${entry}}; \ if [ X$${subentry} != X$${skipdir} ]; then \ if [ X$${subentry} = X ]; then \ echo "($${_nextdir_} skipped)"; \ break; \ fi; \ subskipdir="$${subskipdir} $${subentry#/}"; \ fi; \ done; \ if [ X$${skipdir} = X -o X$${subentry} != X ]; then \ echo "===> $${_nextdir_}"; \ cd ${.CURDIR}/$${_newdir_}; \ ${MAKE} SKIPDIR="$${subskipdir}" \ $${_makefile_spec_} _THISDIR_="$${_nextdir_}" \ ${MAKE_FLAGS} \ ${.TARGET:S/realinstall/install/:S/.depend/depend/}; \ fi); \ done ${SUBDIR}:: @set -e; if test -d ${.CURDIR}/${.TARGET}.${MACHINE}; then \ _newdir_=${.TARGET}.${MACHINE}; \ else \ _newdir_=${.TARGET}; \ fi; \ _makefile_spec_=""; \ if [ -f ${.CURDIR}/$${_newdir_}/Makefile.bsd-wrapper ]; then \ _makefile_spec_="-f Makefile.bsd-wrapper"; \ fi; \ echo "===> $${_newdir_}"; \ cd ${.CURDIR}/$${_newdir_}; \ ${MAKE} ${MAKE_FLAGS} $${_makefile_spec_} _THISDIR_="$${_newdir_}" all .endif .if !target(install) . if !target(beforeinstall) beforeinstall: . endif . if !target(afterinstall) afterinstall: . endif install: maninstall maninstall: afterinstall afterinstall: realinstall realinstall: beforeinstall _SUBDIRUSE .endif .for t in all clean cleandir includes depend lint obj tags regress . if !target($t) $t: _SUBDIRUSE . endif .endfor .if !defined(BSD_OWN_MK) . include <bsd.own.mk> .endif --- NEW FILE: bsd.doc.mk --- # $OpenBSD: bsd.doc.mk,v 1.8 2001/04/03 23:00:09 espie Exp $ # $NetBSD: bsd.doc.mk,v 1.20 1994/07/26 19:42:37 mycroft Exp $ # @(#)bsd.doc.mk 8.1 (Berkeley) 8/14/93 BIB?= bib EQN?= eqn GREMLIN?= grn GRIND?= vgrind -f INDXBIB?= indxbib PIC?= pic REFER?= refer ROFF?= groff -M/usr/share/tmac ${MACROS} ${PAGES} SOELIM?= soelim TBL?= tbl .PATH: ${.CURDIR} .if !target(all) .MAIN: all all: paper.ps .endif .if !target(paper.ps) paper.ps: ${SRCS} ${ROFF} ${SRCS} > ${.TARGET} .endif .if !target(print) print: paper.ps lpr -P${PRINTER} paper.ps .endif .if !target(manpages) manpages: .endif .if !target(obj) obj: .endif clean cleandir: rm -f paper.* [eE]rrs mklog ${CLEANFILES} FILES?= ${SRCS} install: ${INSTALL} ${INSTALL_COPY} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} \ Makefile ${FILES} ${EXTRA} ${DESTDIR}${DOCDIR}/${DIR} spell: paper.spell paper.spell: ${SRCS} spell ${SRCS} | sort | comm -23 - spell.ok > paper.spell .include <bsd.own.mk> --- NEW FILE: bsd.port.subdir.mk --- .include <bsd.own.mk> PORTSDIR?= /usr/ports .include "${PORTSDIR}/infrastructure/mk/bsd.port.subdir.mk" # if you can't find this file, cvs update your ports tree as well. --- NEW FILE: bsd.man.mk --- # $OpenBSD: bsd.man.mk,v 1.28 2004/02/08 01:19:54 espie Exp $ # $NetBSD: bsd.man.mk,v 1.23 1996/02/10 07:49:33 jtc Exp $ # @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90 MANTARGET?= cat NROFF?= nroff -Tascii TBL?= tbl MANLINT?= \# .if !target(.MAIN) . if exists(${.CURDIR}/../Makefile.inc) . include "${.CURDIR}/../Makefile.inc" . endif .MAIN: all .endif .SUFFIXES: .1 .2 .3 .3p .4 .5 .6 .7 .8 .9 \ .1tbl .2tbl .3tbl .4tbl .5tbl .6tbl .7tbl .8tbl .9tbl \ .cat1 .cat2 .cat3 .cat3p .cat4 .cat5 .cat6 .cat7 .cat8 .cat9 \ .ps1 .ps2 .ps3 .ps3p .ps4 .ps5 .ps6 .ps7 .ps8 .ps9 .9.cat9 .8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 .3p.cat3p .3.cat3 .2.cat2 .1.cat1: @echo "${NROFF} -mandoc ${.IMPSRC} > ${.TARGET}" @${MANLINT} ${.IMPSRC} @${NROFF} -mandoc ${.IMPSRC} > ${.TARGET} || (rm -f ${.TARGET}; false) .9tbl.cat9 .8tbl.cat8 .7tbl.cat7 .6tbl.cat6 .5tbl.cat5 .4tbl.cat4 .3tbl.cat3 \ .2tbl.cat2 .1tbl.cat1: @echo "${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET}" @${MANLINT} -tbl ${.IMPSRC} @${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET} || \ (rm -f ${.TARGET}; false) .9.ps9 .8.ps8 .7.ps7 .6.ps6 .5.ps5 .4.ps4 .3p.ps3p .3.ps3 .2.ps2 .1.ps1: @echo "nroff -Tps -mandoc ${.IMPSRC} > ${.TARGET}" @nroff -Tps -mandoc ${.IMPSRC} > ${.TARGET} || (rm -f ${.TARGET}; false) .9tbl.ps9 .8tbl.ps8 .7tbl.ps7 .6tbl.ps6 .5tbl.ps5 .4tbl.ps4 .3tbl.ps3 \ .2tbl.ps2 .1tbl.ps1: @echo "${TBL} ${.IMPSRC} | nroff -Tps -mandoc > ${.TARGET}" @${TBL} ${.IMPSRC} | nroff -Tps -mandoc > ${.TARGET} || (rm -f ${.TARGET}; false) .if defined(MAN) && !empty(MAN) && !defined(MANALL) . for v s in MANALL .cat PS2ALL .ps $v= ${MAN:S/.1$/$s1/g:S/.2$/$s2/g:S/.3$/$s3/g:S/.3p$/$s3p/g:S/.4$/$s4/g:S/.5$/$s5/g:S/.6$/$s6/g:S/.7$/$s7/g:S/.8$/$s8/g:S/.9$/$s9/g:S/.1tbl$/$s1/g:S/.2tbl$/$s2/g:S/.3tbl$/$s3/g:S/.4tbl$/$s4/g:S/.5tbl$/$s5/g:S/.6tbl$/$s6/g:S/.7tbl$/$s7/g:S/.8tbl$/$s8/g:S/.9tbl$/$s9/g} . endfor . if defined(MANPS) PSALL=${PS2ALL} . endif .endif MINSTALL= ${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} .if defined(MANZ) # chown and chmod are done afterward automatically MCOMPRESS= gzip -cf MCOMPRESSSUFFIX= .gz .endif .if defined(MANSUBDIR) # Add / so that we don't have to specify it. Better arch -> MANSUBDIR mapping MANSUBDIR:=${MANSUBDIR:S,^,/,} .else # XXX MANSUBDIR must be non empty for the mlink loops to work MANSUBDIR='' .endif .if !defined(MCOMPRESS) || empty(MCOMPRESS) install_manpage_fragment= \ echo ${MINSTALL} $$page $$instpage; \ ${MINSTALL} $$page $$instpage .else install_manpage_fragment= \ rm -f $$instpage; \ echo ${MCOMPRESS} $$page \> $$instpage; \ ${MCOMPRESS} $$page > $$instpage; \ chown ${MANOWN}:${MANGRP} $$instpage; \ chmod ${MANMODE} $$instpage .endif maninstall: .for v d s t in MANALL ${MANDIR} .cat .0 PSALL ${PSDIR} .ps .ps . if defined($v) @for page in ${$v}; do \ set -- ${MANSUBDIR}; \ subdir=$$1; \ dir=${DESTDIR}$d$${page##*$s}; \ base=$${page##*/}; \ instpage=$${dir}$${subdir}/$${base%.*}$t${MCOMPRESSSUFFIX}; \ ${install_manpage_fragment}; \ while test $$# -ge 2; do \ shift; \ extra=$${dir}$$1/$${base%.*}$t${MCOMPRESSSUFFIX}; \ echo $$extra -\> $$instpage; \ ln -f $$instpage $$extra; \ done; \ done . endif .endfor .if defined(MLINKS) && !empty(MLINKS) . for sub in ${MANSUBDIR} . for lnk file in ${MLINKS} @l=${DESTDIR}${MANDIR}${lnk:E}${sub}/${lnk:R}.0${MCOMPRESSSUFFIX}; \ t=${DESTDIR}${MANDIR}${file:E}${sub}/${file:R}.0${MCOMPRESSSUFFIX}; \ echo $$t -\> $$l; \ rm -f $$t; ln $$l $$t; . endfor . endfor .endif .if (defined(MANALL) || defined(PSALL)) && !defined(MANLOCALBUILD) all: ${MANALL} ${PSALL} cleandir: cleanman cleanman: rm -f ${MANALL} ${PS2ALL} .endif --- NEW FILE: bsd.sys.mk --- # $OpenBSD: bsd.sys.mk,v 1.8 2000/07/06 23:12:41 millert Exp $ # $NetBSD: bsd.sys.mk,v 1.2 1995/12/13 01:25:07 cgd Exp $ # # Overrides used for OpenBSD source tree builds. #CFLAGS+= -Werror .if defined(DESTDIR) CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include CXXFLAGS+= -idirafter ${DESTDIR}/usr/include/g++ .endif .if defined(PARALLEL) # Lex .l: ${LEX.l} -o${.TARGET:R}.yy.c ${.IMPSRC} ${LINK.c} -o ${.TARGET} ${.TARGET:R}.yy.c ${LDLIBS} -ll rm -f ${.TARGET:R}.yy.c .l.c: ${LEX.l} -o${.TARGET} ${.IMPSRC} .l.o: ${LEX.l} -o${.TARGET:R}.yy.c ${.IMPSRC} ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.yy.c rm -f ${.TARGET:R}.yy.c # Yacc .y: ${YACC.y} -b ${.TARGET:R} ${.IMPSRC} ${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS} rm -f ${.TARGET:R}.tab.c .y.c: ${YACC.y} -b ${.TARGET:R} ${.IMPSRC} mv ${.TARGET:R}.tab.c ${.TARGET} .y.o: ${YACC.y} -b ${.TARGET:R} ${.IMPSRC} ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c rm -f ${.TARGET:R}.tab.c .endif --- NEW FILE: bsd.port.mk --- .include <bsd.own.mk> PORTSDIR?= /usr/ports .include "${PORTSDIR}/infrastructure/mk/bsd.port.mk" # if you can't find this file, cvs update your ports tree as well. --- NEW FILE: bsd.nls.mk --- # $OpenBSD: bsd.nls.mk,v 1.6 2002/11/21 03:08:44 marc Exp $ # $NetBSD: bsd.nls.mk,v 1.2 1995/04/27 18:05:38 jtc Exp $ .if !target(.MAIN) .MAIN: all .endif .SUFFIXES: .cat .msg .msg.cat: @rm -f ${.TARGET} gencat ${.TARGET} ${.IMPSRC} .if defined(NLS) && !empty(NLS) NLSALL= ${NLS:.msg=.cat} .endif .if !defined(NLSNAME) .if defined(PROG) NLSNAME=${PROG} .else NLSNAME=lib${LIB} .endif .endif nlsinstall: .if defined(NLSALL) @for msg in ${NLSALL}; do \ NLSLANG=`basename $$msg .cat`; \ dir=${DESTDIR}${NLSDIR}/$${NLSLANG}; \ ${INSTALL} -d $$dir; \ ${INSTALL} ${INSTALL_COPY} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} $$msg $$dir/${NLSNAME}.cat; \ done .endif .if defined(NLSALL) all: ${NLSALL} install: nlsinstall cleandir: cleannls cleannls: rm -f ${NLSALL} .endif --- NEW FILE: bsd.obj.mk --- # $OpenBSD: bsd.obj.mk,v 1.12 2003/10/28 17:09:33 espie Exp $ # $NetBSD: bsd.obj.mk,v 1.9 1996/04/10 21:08:05 thorpej Exp $ .if !target(obj) . if defined(NOOBJ) obj: . else . if defined(MAKEOBJDIR) __baseobjdir= ${MAKEOBJDIR} . else __baseobjdir= obj . endif . if defined(OBJMACHINE) __objdir= ${__baseobjdir}.${MACHINE} . else __objdir= ${__baseobjdir} . endif . if defined(USR_OBJMACHINE) __usrobjdir= ${BSDOBJDIR}.${MACHINE} __usrobjdirpf= . else __usrobjdir= ${BSDOBJDIR} . if defined(OBJMACHINE) __usrobjdirpf= .${MACHINE} . else __usrobjdirpf= . endif . endif _SUBDIRUSE: obj! _SUBDIRUSE @cd ${.CURDIR}; \ here=`/bin/pwd`; bsdsrcdir=`cd ${BSDSRCDIR}; /bin/pwd`; \ subdir=$${here#$${bsdsrcdir}/}; \ if test $$here != $$subdir ; then \ dest=${__usrobjdir}/$$subdir${__usrobjdirpf} ; \ echo "$$here/${__objdir} -> $$dest"; \ if test ! -L ${__objdir} -o \ X`readlink ${__objdir}` != X$$dest; \ then \ if test -e ${__objdir}; then rm -rf ${__objdir}; fi; \ ln -sf $$dest ${__objdir}; \ fi; \ if test -d ${__usrobjdir} -a ! -d $$dest; then \ mkdir -p $$dest; \ else \ true; \ fi; \ else \ true ; \ dest=$$here/${__objdir} ; \ if test ! -d ${__objdir} ; then \ echo "making $$dest" ; \ mkdir $$dest; \ fi ; \ fi; . endif .endif --- NEW FILE: bsd.lib.mk --- # $OpenBSD: bsd.lib.mk,v 1.43 2004/09/20 18:52:38 espie Exp $ # $NetBSD: bsd.lib.mk,v 1.67 1996/01/17 20:39:26 mycroft Exp $ # @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 .include <bsd.own.mk> # for 'NOPIC' definition .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" .endif .if exists(${.CURDIR}/shlib_version) .include "${.CURDIR}/shlib_version" SHLIB_MAJOR=${major} SHLIB_MINOR=${minor} .endif .MAIN: all # prefer .S to a .c, add .po, remove stuff not used in the BSD libraries. # .so used for PIC object files. .ln used for lint output files. # .m for objective c files. .SUFFIXES: .SUFFIXES: .out .o .go .po .so .S .s .c .cc .C .cxx .f .y .l .ln .m4 .m .c.o: @echo "${COMPILE.c} ${.IMPSRC} -o ${.TARGET}" @${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o @${LD} -x -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .c.go: @echo "${COMPILE.c} -g ${.IMPSRC} -o ${.TARGET}" @${COMPILE.c} -g ${.IMPSRC} -o ${.TARGET}.o @${LD} -X -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .c.po: @echo "${COMPILE.c} -p ${.IMPSRC} -o ${.TARGET}" @${COMPILE.c} -p ${.IMPSRC} -o ${.TARGET}.o @${LD} -X -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .c.so: @echo "${COMPILE.c} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}" @${COMPILE.c} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o @${LD} -x -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .c.ln: ${LINT} ${LINTFLAGS} ${CFLAGS:M-[IDU]*} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC} .cc.o .C.o .cxx.o: @echo "${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}" @${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o @${LD} -x -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .cc.go .C.go .cxx.go: @echo "${COMPILE.cc} -g ${.IMPSRC} -o ${.TARGET}" @${COMPILE.cc} -g ${.IMPSRC} -o ${.TARGET}.o @${LD} -X -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .cc.po .C.po .cxx.po: @echo "${COMPILE.cc} -p ${.IMPSRC} -o ${.TARGET}" @${COMPILE.cc} -p ${.IMPSRC} -o ${.TARGET}.o @${LD} -X -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .cc.so .C.so .cxx.so: @echo "${COMPILE.cc} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}" @${COMPILE.cc} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o @${LD} -x -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .S.o .s.o: .if (${MACHINE_ARCH} == "arm") @echo ${COMPILE.S:Q} ${CPPFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} @${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o .else @echo "${CPP} ${CPPFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \ ${AS} -o ${.TARGET}" @${CPP} ${CPPFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \ ${AS} -o ${.TARGET}.o .endif @${LD} -x -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .S.go .s.go: @echo "${CPP} ${CPPFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} |\ ${AS} -o ${.TARGET}" @${CPP} ${CPPFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \ ${AS} -o ${.TARGET}.o @${LD} -X -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .S.po .s.po: @echo "${CPP} -DPROF ${CPPFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} |\ ${AS} -o ${.TARGET}" @${CPP} -DPROF ${CPPFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \ ${AS} -o ${.TARGET}.o @${LD} -X -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .S.so .s.so: @echo "${CPP} -DPIC ${CPPFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \ ${AS} ${ASPICFLAG} -o ${.TARGET}" @${CPP} -DPIC ${CPPFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \ ${AS} ${ASPICFLAG} -o ${.TARGET}.o @${LD} -x -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o .if ${WARNINGS:L} == "yes" CFLAGS+= ${CDIAGFLAGS} CXXFLAGS+= ${CXXDIAGFLAGS} .endif CFLAGS+= ${COPTS} CXXFLAGS+= ${CXXOPTS} _LIBS=lib${LIB}.a .if (${DEBUGLIBS:L} == "yes") _LIBS+=lib${LIB}_g.a .endif .if !defined(NOPROFILE) _LIBS+=lib${LIB}_p.a .endif .if !defined(NOPIC) .if (${MACHINE_ARCH} != "mips64") _LIBS+=lib${LIB}_pic.a .endif .if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR) _LIBS+=lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} .endif .endif .if !defined(NOLINT) _LIBS+=llib-l${LIB}.ln .endif all: ${_LIBS} _SUBDIRUSE OBJS+= ${SRCS:N*.h:R:S/$/.o/g} lib${LIB}.a:: ${OBJS} @echo building standard ${LIB} library @rm -f lib${LIB}.a @${AR} cq lib${LIB}.a `${LORDER} ${OBJS} | tsort -q` ${RANLIB} lib${LIB}.a GOBJS+= ${OBJS:.o=.go} lib${LIB}_g.a:: ${GOBJS} @echo building debugging ${LIB} library @rm -f lib${LIB}_g.a @${AR} cq lib${LIB}_g.a `${LORDER} ${GOBJS} | tsort -q` ${RANLIB} lib${LIB}_g.a POBJS+= ${OBJS:.o=.po} lib${LIB}_p.a:: ${POBJS} @echo building profiled ${LIB} library @rm -f lib${LIB}_p.a @${AR} cq lib${LIB}_p.a `${LORDER} ${POBJS} | tsort -q` ${RANLIB} lib${LIB}_p.a SOBJS+= ${OBJS:.o=.so} lib${LIB}_pic.a:: ${SOBJS} @echo building shared object ${LIB} library @rm -f lib${LIB}_pic.a @${AR} cq lib${LIB}_pic.a `${LORDER} ${SOBJS} | tsort -q` ${RANLIB} lib${LIB}_pic.a lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: ${SOBJS} ${DPADD} @echo building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\) @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ${CC} -shared ${PICFLAG} \ -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ `${LORDER} ${SOBJS}|tsort -q` ${LDADD} LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} # the following looks XXX to me... -- cgd LLIBS?= -lc llib-l${LIB}.ln: ${LOBJS} @echo building llib-l${LIB}.ln @rm -f llib-l${LIB}.ln @${LINT} -C${LIB} ${LOBJS} ${LLIBS} .if !target(clean) clean: _SUBDIRUSE rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES} rm -f lib${LIB}.a ${OBJS} rm -f lib${LIB}_g.a ${GOBJS} rm -f lib${LIB}_p.a ${POBJS} rm -f lib${LIB}_pic.a lib${LIB}.so.*.* ${SOBJS} rm -f llib-l${LIB}.ln ${LOBJS} .endif cleandir: _SUBDIRUSE clean .if defined(SRCS) afterdepend: .depend @(TMP=`mktemp -q /tmp/_dependXXXXXXXXXX`; \ if [ $$? -ne 0 ]; then \ echo "$$0: cannot create temp file, exiting..."; \ exit 1; \ fi; \ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so:/' \ < .depend > $$TMP; \ mv $$TMP .depend) .endif .if !target(install) .if !target(beforeinstall) beforeinstall: .endif realinstall: # ranlib lib${LIB}.a ${INSTALL} ${INSTALL_COPY} -o ${LIBOWN} -g ${LIBGRP} -m 600 lib${LIB}.a \ ${DESTDIR}${LIBDIR} .if (${INSTALL_COPY} != "-p") ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}.a .endif chmod ${LIBMODE} ${DESTDIR}${LIBDIR}/lib${LIB}.a .if (${DEBUGLIBS:L} == "yes") # ranlib lib${LIB}_g.a ${INSTALL} ${INSTALL_COPY} -o ${LIBOWN} -g ${LIBGRP} -m 600 \ lib${LIB}_g.a ${DESTDIR}${LIBDIR}/debug/lib${LIB}.a .if (${INSTALL_COPY} != "-p") ${RANLIB} -t ${DESTDIR}${LIBDIR}/debug/lib${LIB}.a .endif chmod ${LIBMODE} ${DESTDIR}${LIBDIR}/debug/lib${LIB}.a .endif .if !defined(NOPROFILE) # ranlib lib${LIB}_p.a ${INSTALL} ${INSTALL_COPY} -o ${LIBOWN} -g ${LIBGRP} -m 600 \ lib${LIB}_p.a ${DESTDIR}${LIBDIR} .if (${INSTALL_COPY} != "-p") ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_p.a .endif chmod ${LIBMODE} ${DESTDIR}${LIBDIR}/lib${LIB}_p.a .endif .if !defined(NOPIC) && (${MACHINE_ARCH} != "mips64") # ranlib lib${LIB}_pic.a ${INSTALL} ${INSTALL_COPY} -o ${LIBOWN} -g ${LIBGRP} -m 600 \ lib${LIB}_pic.a ${DESTDIR}${LIBDIR} .if (${INSTALL_COPY} != "-p") ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a .endif chmod ${LIBMODE} ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a .endif .if !defined(NOPIC) && defined(SHLIB_MAJOR) && defined(SHLIB_MINOR) ${INSTALL} ${INSTALL_COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ${DESTDIR}${LIBDIR} .endif .if !defined(NOLINT) ${INSTALL} ${INSTALL_COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ llib-l${LIB}.ln ${DESTDIR}${LINTLIBDIR} .endif .if defined(LINKS) && !empty(LINKS) . for lnk file in ${LINKS} @l=${DESTDIR}${lnk}; \ t=${DESTDIR}${file}; \ echo $$t -\> $$l; \ rm -f $$t; ln $$l $$t . endfor .endif install: maninstall _SUBDIRUSE maninstall: afterinstall afterinstall: realinstall realinstall: beforeinstall .endif .if !defined(NOMAN) .include <bsd.man.mk> .endif .if !defined(NONLS) .include <bsd.nls.mk> .endif .include <bsd.obj.mk> .include <bsd.dep.mk> .include <bsd.subdir.mk> .include <bsd.sys.mk> |
From: Jeff B. <jb...@us...> - 2005-09-17 20:28:43
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26429/src Modified Files: Makefile Log Message: commit the openbsd build system into our repository in order to utilize it while building on other platforms Index: Makefile =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 13 Sep 2005 20:52:27 -0000 1.2 --- Makefile 17 Sep 2005 20:28:35 -0000 1.3 *************** *** 1,46 **** ! all: digraphanalysis gpg2digraph gpg2dot ! ! alias.o: alias.c alias.h ! gcc -ansi -c -Wall -o alias.o alias.c ! ! analysis.o: analysis.c analysis.h ! gcc -ansi -c -Wall -o analysis.o analysis.c ! ! clean: ! rm -f digraphanalysis gpg2digraph gpg2dot ! rm -f *.o ! ! digraphanalysis: alias.o analysis.o graph.o input.o list.o main.o node.o output.o ! gcc -ansi -Wall -o digraphanalysis alias.o analysis.o graph.o input.o list.o main.o node.o output.o ! ! gpg2digraph: gpg2digraph.o ! gcc -ansi -Wall -o gpg2digraph gpg2digraph.o ! ! gpg2digraph.o: gpg2digraph.c gpg2digraph.h ! gcc -ansi -c -Wall -o gpg2digraph.o gpg2digraph.c ! ! gpg2dot: gpg2dot.o ! gcc -ansi -Wall -o gpg2dot gpg2dot.o ! ! gpg2dot.o: gpg2dot.c gpg2dot.h ! gcc -ansi -c -Wall -o gpg2dot.o gpg2dot.c ! ! graph.o: graph.c graph.h ! gcc -ansi -c -Wall -o graph.o graph.c ! ! input.o: input.c input.h ! gcc -ansi -c -Wall -o input.o input.c ! ! list.o: list.c list.h ! gcc -ansi -c -Wall -o list.o list.c ! ! main.o: main.c main.h ! gcc -ansi -c -Wall -o main.o main.c ! ! node.o: node.c node.h ! gcc -ansi -c -Wall -o node.o node.c ! ! output.o: output.c output.h ! gcc -ansi -c -Wall -o output.o output.c ! --- 1,7 ---- + SUBDIR= digraph_analyze \ + digraph_report \ + digraphanalysis \ + gpg2digraph \ + gpg2dot ! .include <../mk/bsd.subdir.mk> |
From: Jeff B. <jb...@us...> - 2005-09-17 20:25:32
|
Update of /cvsroot/digraphanalysis/digraphanalysis/mk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26013/mk Log Message: Directory /cvsroot/digraphanalysis/digraphanalysis/mk added to the repository |
From: Jeff B. <jb...@us...> - 2005-09-17 20:25:19
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src/digraphanalysis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25916/digraphanalysis Log Message: Directory /cvsroot/digraphanalysis/digraphanalysis/src/digraphanalysis added to the repository |
From: Jeff B. <jb...@us...> - 2005-09-17 20:25:19
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src/gpg2digraph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25916/gpg2digraph Log Message: Directory /cvsroot/digraphanalysis/digraphanalysis/src/gpg2digraph added to the repository |
From: Jeff B. <jb...@us...> - 2005-09-17 20:25:19
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src/gpg2dot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25916/gpg2dot Log Message: Directory /cvsroot/digraphanalysis/digraphanalysis/src/gpg2dot added to the repository |
From: Jeff B. <jb...@us...> - 2005-09-17 20:25:17
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src/digraph_report In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25916/digraph_report Log Message: Directory /cvsroot/digraphanalysis/digraphanalysis/src/digraph_report added to the repository |
From: Jeff B. <jb...@us...> - 2005-09-17 20:25:17
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src/digraph_analyze In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25916/digraph_analyze Log Message: Directory /cvsroot/digraphanalysis/digraphanalysis/src/digraph_analyze added to the repository |
From: Jeff B. <jb...@us...> - 2005-09-14 01:39:48
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5536 Modified Files: graph.c graph.h output.c output.h Log Message: clean up Index: output.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/output.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** output.h 24 May 2005 22:40:45 -0000 1.2 --- output.h 14 Sep 2005 01:39:40 -0000 1.3 *************** *** 27,30 **** --- 27,31 ---- int output_new_directory(char *); void output_file(struct node *, struct graph *); + void output_file_node_list(FILE *, struct graph *, char *); void output_print_list(FILE *, struct graph *); Index: output.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/output.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** output.c 13 Sep 2005 20:03:50 -0000 1.11 --- output.c 14 Sep 2005 01:39:40 -0000 1.12 *************** *** 31,34 **** --- 31,108 ---- #include "output.h" + void + output_file(struct node *node, struct graph *graph) + { + struct alias *alias; + struct listlink *node_link; + struct list *nodes_we_link_to; + struct graph *tmp_graph; + FILE *filep; + + output_new_directory(node->uiddir); + + chdir(node->uiddir); + + filep = fopen(node->uid, "a"); + + fprintf(filep, "Keyid: %s\n", node->uid); + + alias = list_find(graph->alias_list, alias_new(node->uid, "", NULL)); + fprintf(filep, "Name: %s \n\n", alias->name); + + tmp_graph = graph_new(graph->alias_list, node->links); + output_file_node_list(filep, tmp_graph, "Signatures to this key:"); + graph_free(tmp_graph); + + nodes_we_link_to = list_new(node_compare, node_print); + LIST_FOREACH(node_link, graph->node_list, list) + if(list_find(((struct node *) node_link->object)->links, node) != NULL) + list_add(nodes_we_link_to, node_link->object); + + tmp_graph = graph_new(graph->alias_list, nodes_we_link_to); + output_file_node_list(filep, tmp_graph, "Signatures from this key:"); + graph_free(tmp_graph); + + fprintf(filep, "MSD: %.4f\n\n", node->msd); + + tmp_graph = graph_new(graph->alias_list, list_subtract(graph->node_list, list_union(node->links, nodes_we_link_to))); + output_file_node_list(filep, tmp_graph, "This key has not signed, nor been signed by:"); + list_free(tmp_graph->node_list); + graph_free(tmp_graph); + + tmp_graph = graph_new(graph->alias_list, list_subtract(node->links, nodes_we_link_to)); + output_file_node_list(filep, tmp_graph, "This key has not signed, but has been signed by:"); + list_free(tmp_graph->node_list); + graph_free(tmp_graph); + + tmp_graph = graph_new(graph->alias_list, list_subtract(nodes_we_link_to, node->links)); + output_file_node_list(filep, tmp_graph, "This key has signed, but has not been signed by:"); + list_free(tmp_graph->node_list); + graph_free(tmp_graph); + + tmp_graph = graph_new(graph->alias_list, list_intersection(node->links, nodes_we_link_to)); + output_file_node_list(filep, tmp_graph, "This key has signed and has been signed by:"); + list_free(tmp_graph->node_list); + graph_free(tmp_graph); + + fclose(filep); + chdir(".."); + + return; + } + + void + output_file_node_list(FILE *filep, struct graph *graph, char *desc) + { + unsigned int num_nodes; + + fprintf(filep, "%s\n", desc); + graph_print(filep, graph); + num_nodes = list_size(graph->node_list); + fprintf(filep, " Total: %u key%s in this set.\n\n", num_nodes, ((num_nodes == 1)?"":"s")); + + return; + } + /* Create and enter the main output directory. */ *************** *** 53,56 **** --- 127,170 ---- } + /* Create a new directory using the same directory stats as the parent directory. + */ + int + output_new_directory(char *dirname) + { + int rtn; + struct stat *sb; + + rtn = 0; + sb = NULL; + /* Allocate memory for sb */ + if(((sb = (struct stat *) malloc(sizeof(struct stat))) == NULL) || + /* Stat the current working directory for mode value */ + (stat(".", sb) == -1) || + /* Make the new directory with the cwd's mode value */ + (mkdir(dirname, sb->st_mode) == -1)) + rtn = -1; + free(sb); + return rtn; + } + + void + output_print_list(FILE *filep, struct graph *graph) + { + struct node *node; + struct listlink *node_link; + char *uid; + char *name; + + LIST_FOREACH(node_link, graph->node_list, list) + { + node = node_link->object; + uid = node->uid; + name = ((struct alias *) list_find(graph->alias_list, alias_new(uid, "", NULL)))->name; + fprintf(filep, " %s %s\n", uid, name); + } + return; + + } + /* Generate the main report. */ *************** *** 129,239 **** return; } - - /* Create a new directory using the same directory stats as the parent directory. - */ - int - output_new_directory(char *dirname) - { - int rtn; - struct stat *sb; - - rtn = 0; - sb = NULL; - /* Allocate memory for sb */ - if(((sb = (struct stat *) malloc(sizeof(struct stat))) == NULL) || - /* Stat the current working directory for mode value */ - (stat(".", sb) == -1) || - /* Make the new directory with the cwd's mode value */ - (mkdir(dirname, sb->st_mode) == -1)) - rtn = -1; - free(sb); - return rtn; - } - - void - output_file(struct node *node, struct graph *graph) - { - struct alias *alias; - struct listlink *node_link; - struct list *nodes_we_link_to; - struct list *tmp_nodelist; - FILE *filep; - unsigned int tmp_size; - - output_new_directory(node->uiddir); - - chdir(node->uiddir); - - filep = fopen(node->uid, "a"); - - fprintf(filep, "Keyid: %s\n", node->uid); - - alias = list_find(graph->alias_list, alias_new(node->uid, "", NULL)); - fprintf(filep, "Name: %s \n\n", alias->name); - - fprintf(filep, "Signatures to this key:\n"); - graph_print(filep, graph_new(graph->alias_list, node->links)); - tmp_size = list_size(node->links); - fprintf(filep, " Total: %u signature%s to this key from this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); - - nodes_we_link_to = list_new(node_compare, node_print); - LIST_FOREACH(node_link, graph->node_list, list) - if(list_find(((struct node *) node_link->object)->links, node) != NULL) - list_add(nodes_we_link_to, node_link->object); - fprintf(filep, "Signatures from this key:\n"); - graph_print(filep, graph_new(graph->alias_list, nodes_we_link_to)); - tmp_size = list_size(nodes_we_link_to); - fprintf(filep, " Total: %u signature%s from this key to this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); - - fprintf(filep, "MSD: %.4f\n\n", node->msd); - - tmp_nodelist = list_subtract(graph->node_list, list_union(node->links, nodes_we_link_to)); - fprintf(filep, "This key has not signed, nor been signed by:\n"); - graph_print(filep, graph_new(graph->alias_list, tmp_nodelist)); - tmp_size = list_size(tmp_nodelist); - fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); - - tmp_nodelist = list_subtract(node->links, nodes_we_link_to); - fprintf(filep, "This key has not signed, but has been signed by:\n"); - graph_print(filep, graph_new(graph->alias_list, tmp_nodelist)); - tmp_size = list_size(tmp_nodelist); - fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); - list_free(tmp_nodelist); - - tmp_nodelist = list_subtract(nodes_we_link_to, node->links); - fprintf(filep, "This key has signed, but has not been signed by:\n"); - graph_print(filep, graph_new(graph->alias_list, tmp_nodelist)); - tmp_size = list_size(tmp_nodelist); - fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); - list_free(tmp_nodelist); - - tmp_nodelist = list_intersection(node->links, nodes_we_link_to); - fprintf(filep, "This key has signed and has been signed by:\n"); - graph_print(filep, graph_new(graph->alias_list, tmp_nodelist)); - tmp_size = list_size(tmp_nodelist); - fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); - list_free(tmp_nodelist); - fclose(filep); - chdir(".."); - - return; - } - - void - output_print_list(FILE *filep, struct graph *graph) - { - struct node *node; - struct listlink *node_link; - char *uid; - char *name; - - LIST_FOREACH(node_link, graph->node_list, list) - { - node = node_link->object; - uid = node->uid; - name = ((struct alias *) list_find(graph->alias_list, alias_new(uid, "", NULL)))->name; - fprintf(filep, " %s %s\n", uid, name); - } - return; - - } --- 243,244 ---- Index: graph.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/graph.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** graph.c 13 Sep 2005 20:03:50 -0000 1.9 --- graph.c 14 Sep 2005 01:39:40 -0000 1.10 *************** *** 50,58 **** void ! graph_print(FILE *filep, struct graph *graph) { struct listlink *iter; struct alias *alias; LIST_FOREACH(iter, graph->node_list, list) { --- 50,61 ---- void ! graph_print(FILE *filep, void *arg2) { + struct graph *graph; struct listlink *iter; struct alias *alias; + graph = arg2; + LIST_FOREACH(iter, graph->node_list, list) { Index: graph.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/graph.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** graph.h 13 Sep 2005 20:03:50 -0000 1.5 --- graph.h 14 Sep 2005 01:39:40 -0000 1.6 *************** *** 30,36 **** }; ! int graph_compare(void *, void *); ! struct graph *graph_new(struct list *, struct list *); ! void graph_print(FILE *, struct graph *); #endif /* _GRAPH_H_ */ --- 30,37 ---- }; ! int graph_compare(void *, void *); ! void graph_free(struct graph *); ! struct graph *graph_new(struct list *, struct list *); ! void graph_print(FILE *, void *); #endif /* _GRAPH_H_ */ |
From: Jeff B. <jb...@us...> - 2005-09-13 20:52:43
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv803/src Modified Files: Makefile Log Message: add clean target Index: Makefile =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 5 Sep 2005 14:03:39 -0000 1.1 --- Makefile 13 Sep 2005 20:52:27 -0000 1.2 *************** *** 8,11 **** --- 8,15 ---- gcc -ansi -c -Wall -o analysis.o analysis.c + clean: + rm -f digraphanalysis gpg2digraph gpg2dot + rm -f *.o + digraphanalysis: alias.o analysis.o graph.o input.o list.o main.o node.o output.o gcc -ansi -Wall -o digraphanalysis alias.o analysis.o graph.o input.o list.o main.o node.o output.o |
From: Jeff B. <jb...@us...> - 2005-09-13 20:03:59
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21772/src Modified Files: alias.c graph.c graph.h node.c output.c Log Message: implement graph_print Index: alias.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/alias.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** alias.c 28 May 2005 20:58:00 -0000 1.10 --- alias.c 13 Sep 2005 20:03:50 -0000 1.11 *************** *** 69,73 **** alias_print(FILE *filep, void *alias) { ! fprintf(filep, " %s\n", ((struct alias *) alias)->name); return; --- 69,73 ---- alias_print(FILE *filep, void *alias) { ! fprintf(filep, "%s", ((struct alias *) alias)->name); return; Index: graph.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/graph.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** graph.h 28 May 2005 20:58:00 -0000 1.4 --- graph.h 13 Sep 2005 20:03:50 -0000 1.5 *************** *** 32,36 **** int graph_compare(void *, void *); struct graph *graph_new(struct list *, struct list *); ! void graph_print(FILE *, void *); #endif /* _GRAPH_H_ */ --- 32,36 ---- int graph_compare(void *, void *); struct graph *graph_new(struct list *, struct list *); ! void graph_print(FILE *, struct graph *); #endif /* _GRAPH_H_ */ Index: output.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/output.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** output.c 7 Sep 2005 00:01:44 -0000 1.10 --- output.c 13 Sep 2005 20:03:50 -0000 1.11 *************** *** 61,65 **** FILE *filep; struct graph *graph; ! struct listlink *graph_link; int i; int j; --- 61,65 ---- FILE *filep; struct graph *graph; ! struct listlink *graph_link; int i; int j; *************** *** 173,177 **** fprintf(filep, "Signatures to this key:\n"); ! list_print(filep, node->links); tmp_size = list_size(node->links); fprintf(filep, " Total: %u signature%s to this key from this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); --- 173,177 ---- fprintf(filep, "Signatures to this key:\n"); ! graph_print(filep, graph_new(graph->alias_list, node->links)); tmp_size = list_size(node->links); fprintf(filep, " Total: %u signature%s to this key from this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); *************** *** 182,186 **** list_add(nodes_we_link_to, node_link->object); fprintf(filep, "Signatures from this key:\n"); ! list_print(filep, nodes_we_link_to); tmp_size = list_size(nodes_we_link_to); fprintf(filep, " Total: %u signature%s from this key to this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); --- 182,186 ---- list_add(nodes_we_link_to, node_link->object); fprintf(filep, "Signatures from this key:\n"); ! graph_print(filep, graph_new(graph->alias_list, nodes_we_link_to)); tmp_size = list_size(nodes_we_link_to); fprintf(filep, " Total: %u signature%s from this key to this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); *************** *** 190,194 **** tmp_nodelist = list_subtract(graph->node_list, list_union(node->links, nodes_we_link_to)); fprintf(filep, "This key has not signed, nor been signed by:\n"); ! list_print(filep, tmp_nodelist); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); --- 190,194 ---- tmp_nodelist = list_subtract(graph->node_list, list_union(node->links, nodes_we_link_to)); fprintf(filep, "This key has not signed, nor been signed by:\n"); ! graph_print(filep, graph_new(graph->alias_list, tmp_nodelist)); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); *************** *** 196,200 **** tmp_nodelist = list_subtract(node->links, nodes_we_link_to); fprintf(filep, "This key has not signed, but has been signed by:\n"); ! list_print(filep, tmp_nodelist); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); --- 196,200 ---- tmp_nodelist = list_subtract(node->links, nodes_we_link_to); fprintf(filep, "This key has not signed, but has been signed by:\n"); ! graph_print(filep, graph_new(graph->alias_list, tmp_nodelist)); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); *************** *** 203,207 **** tmp_nodelist = list_subtract(nodes_we_link_to, node->links); fprintf(filep, "This key has signed, but has not been signed by:\n"); ! list_print(filep, tmp_nodelist); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); --- 203,207 ---- tmp_nodelist = list_subtract(nodes_we_link_to, node->links); fprintf(filep, "This key has signed, but has not been signed by:\n"); ! graph_print(filep, graph_new(graph->alias_list, tmp_nodelist)); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); *************** *** 210,214 **** tmp_nodelist = list_intersection(node->links, nodes_we_link_to); fprintf(filep, "This key has signed and has been signed by:\n"); ! list_print(filep, tmp_nodelist); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); --- 210,214 ---- tmp_nodelist = list_intersection(node->links, nodes_we_link_to); fprintf(filep, "This key has signed and has been signed by:\n"); ! graph_print(filep, graph_new(graph->alias_list, tmp_nodelist)); tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); Index: node.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/node.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** node.c 28 May 2005 20:58:00 -0000 1.15 --- node.c 13 Sep 2005 20:03:50 -0000 1.16 *************** *** 55,59 **** node_print(FILE *filep, void *node) { ! fprintf(filep, "%s\n", ((struct node *) node)->uid); return; --- 55,59 ---- node_print(FILE *filep, void *node) { ! fprintf(filep, "%s", ((struct node *) node)->uid); return; Index: graph.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/graph.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** graph.c 4 Sep 2005 22:50:21 -0000 1.8 --- graph.c 13 Sep 2005 20:03:50 -0000 1.9 *************** *** 50,56 **** void ! graph_print(FILE *filep, void *graph) { ! /* Iterate through nodelist, find the alias for the node and print both */ return; } --- 50,70 ---- void ! graph_print(FILE *filep, struct graph *graph) { ! struct listlink *iter; ! struct alias *alias; ! ! LIST_FOREACH(iter, graph->node_list, list) ! { ! alias = list_find(graph->alias_list, alias_new(((struct node *) iter->object)->uid, "", NULL)); ! ! fprintf(filep, " "); ! node_print(filep, iter->object); ! fprintf(filep, " "); ! alias_print(filep, alias); ! fprintf(filep, "\n"); ! ! } ! return; } |
From: Jeff B. <jb...@us...> - 2005-09-07 00:09:03
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19899 Modified Files: main.c Log Message: bug - When creating a list of nodes use node_print instead of alias_print. Index: main.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/main.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** main.c 4 Sep 2005 22:50:22 -0000 1.16 --- main.c 7 Sep 2005 00:08:55 -0000 1.17 *************** *** 43,47 **** char *output_dir; ! graph = graph_new(list_new(alias_compare, alias_print), list_new(node_compare, alias_print)); output_dir = NULL; --- 43,47 ---- char *output_dir; ! graph = graph_new(list_new(alias_compare, alias_print), list_new(node_compare, node_print)); output_dir = NULL; |
From: Jeff B. <jb...@us...> - 2005-09-07 00:01:51
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17444 Modified Files: list.c output.c Log Message: bugs - When the list gets new nodes in the front via list_merge our pointer that we passed points to the middle of the list. therefore we must always use the returned object instead of assuming the passed object is updated. (Thats probably one of the first things they teach when teaching variable passing with pointers to functions, geez :) - if the object we are looking for is larger than the object we are inspecting then break if larger not smaller. Index: output.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/output.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** output.c 5 Sep 2005 17:52:41 -0000 1.9 --- output.c 7 Sep 2005 00:01:44 -0000 1.10 *************** *** 31,37 **** #include "output.h" ! /* Note: analysis_main_directory -> output_main_directory ! * ! * Create and enter the main output directory. */ int --- 31,35 ---- #include "output.h" ! /* Create and enter the main output directory. */ int *************** *** 55,59 **** } ! /* analysis_output_report -> output_report */ void --- 53,57 ---- } ! /* Generate the main report. */ void *************** *** 132,135 **** --- 130,135 ---- } + /* Create a new directory using the same directory stats as the parent directory. + */ int output_new_directory(char *dirname) Index: list.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/list.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** list.c 5 Sep 2005 17:52:41 -0000 1.7 --- list.c 7 Sep 2005 00:01:44 -0000 1.8 *************** *** 68,72 **** if((ret_list = list_new(list->compare, list->print)) != NULL) ! if(list_merge(ret_list, list) == NULL) { list_free(ret_list); --- 68,72 ---- if((ret_list = list_new(list->compare, list->print)) != NULL) ! if((ret_list = list_merge(ret_list, list)) == NULL) { list_free(ret_list); *************** *** 189,193 **** free(iter); } ! if(i <= 0) break; } --- 189,193 ---- free(iter); } ! if(i >= 0) break; } |
From: Jeff B. <jb...@us...> - 2005-09-05 17:52:49
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14866 Modified Files: analysis.c list.c node.h output.c Log Message: mmm code that works (note still some odd bugs around) Index: node.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/node.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** node.h 28 May 2005 20:58:00 -0000 1.11 --- node.h 5 Sep 2005 17:52:41 -0000 1.12 *************** *** 35,38 **** --- 35,39 ---- unsigned int node_distance(struct node *, struct node *); void node_free(struct node *); + void node_msd(struct node *, struct list *); struct node *node_new(char *); void node_print(FILE *, void *); Index: output.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/output.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** output.c 4 Sep 2005 22:50:22 -0000 1.8 --- output.c 5 Sep 2005 17:52:41 -0000 1.9 *************** *** 191,194 **** --- 191,195 ---- fprintf(filep, "This key has not signed, nor been signed by:\n"); list_print(filep, tmp_nodelist); + tmp_size = list_size(tmp_nodelist); fprintf(filep, " Total: %u key%s in this set.\n\n", tmp_size, ((tmp_size == 1)?"":"s")); Index: analysis.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/analysis.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** analysis.c 28 May 2005 20:58:00 -0000 1.4 --- analysis.c 5 Sep 2005 17:52:41 -0000 1.5 *************** *** 48,52 **** --- 48,55 ---- LIST_FOREACH(node_link, graph->node_list, list) + { + node_msd(node_link->object, graph->node_list); output_file(node_link->object, graph); + } return; Index: list.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/list.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** list.c 28 May 2005 20:58:00 -0000 1.6 --- list.c 5 Sep 2005 17:52:41 -0000 1.7 *************** *** 202,205 **** --- 202,207 ---- unsigned int size; + size = 0; + LIST_FOREACH(iter, list, list) if((size + 1) != 0) *************** *** 269,271 **** return ret_list; } - --- 271,272 ---- |
From: Jeff B. <jb...@us...> - 2005-09-05 17:06:23
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4473 Modified Files: gpg2digraph.c gpg2digraph.h Log Message: move header stuff into the header file. Index: gpg2digraph.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/gpg2digraph.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gpg2digraph.c 5 Jul 2005 00:42:11 -0000 1.1 --- gpg2digraph.c 5 Sep 2005 17:06:15 -0000 1.2 *************** *** 23,34 **** #include <unistd.h> ! char *do_pub(void); ! void do_sig(char *); ! char *do_uid(char *); ! unsigned int encode(char *); ! void func001(unsigned int); ! char *get_fingerprint(); ! char *get_keyid(); ! char *get_name(); /* Handle a sig line. --- 23,27 ---- #include <unistd.h> ! #include "gpg2digraph.h" /* Handle a sig line. Index: gpg2digraph.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/gpg2digraph.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gpg2digraph.h 5 Sep 2005 14:03:39 -0000 1.1 --- gpg2digraph.h 5 Sep 2005 17:06:15 -0000 1.2 *************** *** 0 **** --- 1,10 ---- + + char *do_pub(void); + void do_sig(char *); + char *do_uid(char *); + unsigned int encode(char *); + void func001(unsigned int); + char *get_fingerprint(); + char *get_keyid(); + char *get_name(); + |
From: Jeff B. <jb...@us...> - 2005-09-05 14:03:50
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22719 Added Files: Makefile gpg2digraph.h gpg2dot.h Log Message: from scratch build system. take that autotools :) --- NEW FILE: gpg2dot.h --- --- NEW FILE: Makefile --- all: digraphanalysis gpg2digraph gpg2dot alias.o: alias.c alias.h gcc -ansi -c -Wall -o alias.o alias.c analysis.o: analysis.c analysis.h gcc -ansi -c -Wall -o analysis.o analysis.c digraphanalysis: alias.o analysis.o graph.o input.o list.o main.o node.o output.o gcc -ansi -Wall -o digraphanalysis alias.o analysis.o graph.o input.o list.o main.o node.o output.o gpg2digraph: gpg2digraph.o gcc -ansi -Wall -o gpg2digraph gpg2digraph.o gpg2digraph.o: gpg2digraph.c gpg2digraph.h gcc -ansi -c -Wall -o gpg2digraph.o gpg2digraph.c gpg2dot: gpg2dot.o gcc -ansi -Wall -o gpg2dot gpg2dot.o gpg2dot.o: gpg2dot.c gpg2dot.h gcc -ansi -c -Wall -o gpg2dot.o gpg2dot.c graph.o: graph.c graph.h gcc -ansi -c -Wall -o graph.o graph.c input.o: input.c input.h gcc -ansi -c -Wall -o input.o input.c list.o: list.c list.h gcc -ansi -c -Wall -o list.o list.c main.o: main.c main.h gcc -ansi -c -Wall -o main.o main.c node.o: node.c node.h gcc -ansi -c -Wall -o node.o node.c output.o: output.c output.h gcc -ansi -c -Wall -o output.o output.c --- NEW FILE: gpg2digraph.h --- |
From: Jeff B. <jb...@us...> - 2005-09-05 13:49:12
|
Update of /cvsroot/digraphanalysis/digraphanalysis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18451 Removed Files: AUTHORS COPYING ChangeLog INSTALL Makefile.am NEWS README aclocal.m4 config.guess config.sub configure.ac install-sh missing mkinstalldirs Log Message: autotool crap is pissing me off. --- mkinstalldirs DELETED --- --- COPYING DELETED --- --- missing DELETED --- --- ChangeLog DELETED --- --- config.guess DELETED --- --- config.sub DELETED --- --- README DELETED --- --- configure.ac DELETED --- --- Makefile.am DELETED --- --- INSTALL DELETED --- --- NEWS DELETED --- --- aclocal.m4 DELETED --- --- install-sh DELETED --- --- AUTHORS DELETED --- |