📄 gb_graph.ch
字号:
@x l.28int main()@yint main(void)@z@x l.266char *gb_alloc(n,s) long n; /* number of consecutive bytes desired */ Area s; /* storage area that will contain the new block */@ychar *gb_alloc(@t\1\1@> long n, /* number of consecutive bytes desired */ Area s@t\2\2@>) /* storage area that will contain the new block */@z@x l.297void gb_free(s) Area s;@yvoid gb_free(Area s)@z@x l.311extern char *gb_alloc(); /* allocate another block for an area */#define gb_typed_alloc(n,t,s) @[@t\quad@>\ @[(t*)@]gb_alloc((long)((n)*@[sizeof@](t)),s)@]extern void gb_free(); /* deallocate all blocks for an area */@yextern char *gb_alloc(long,Area); /* allocate another block for an area */#define gb_typed_alloc(n,t,s) @[@t\quad@>\ @[(t*)@]gb_alloc((long)((n)*@[sizeof@](t)),s)@]extern void gb_free(Area); /* deallocate all blocks for an area */@z@x l.442Graph *gb_new_graph(n) long n; /* desired number of vertices */@yGraph *gb_new_graph(long n) /* desired number of vertices */@z@x l.476extern void make_compound_id(); /* routine to set one |id| field from another */extern void make_double_compound_id(); /* ditto, but from two others */@yextern void make_compound_id(Graph *,char *,Graph *,char *); /* routine to set one |id| field from another */extern void make_double_compound_id(Graph *,char *,Graph *,char *,@| Graph *,char *); /* ditto, but from two others */@z@x l.485void make_compound_id(g,s1,gg,s2) /* |sprintf(g->id,"%s%s%s",s1,gg->id,s2)| */ Graph *g; /* graph whose |id| is to be set */ char *s1; /* string for the beginning of the new |id| */ Graph *gg; /* graph whose |id| is to be copied */ char *s2; /* string for the end of the new |id| */@yvoid make_compound_id(@t\1\1@> /* |sprintf(g->id,"%s%s%s",s1,gg->id,s2)| */ Graph *g, /* graph whose |id| is to be set */ char *s1, /* string for the beginning of the new |id| */ Graph *gg, /* graph whose |id| is to be copied */ char *s2@t\2\2@>) /* string for the end of the new |id| */@z@x l.498void make_double_compound_id(g,s1,gg,s2,ggg,s3) /* |sprintf(g->id,"%s%s%s%s%s",s1,gg->id,s2,ggg->id,s3)| */ Graph *g; /* graph whose |id| is to be set */ char *s1; /* string for the beginning of the new |id| */ Graph *gg; /* first graph whose |id| is to be copied */ char *s2; /* string for the middle of the new |id| */ Graph *ggg; /* second graph whose |id| is to be copied */ char *s3; /* string for the end of the new |id| */@yvoid make_double_compound_id(@t\1\1@> /* |sprintf(g->id,"%s%s%s%s%s",s1,gg->id,s2,ggg->id,s3)| */ Graph *g, /* graph whose |id| is to be set */ char *s1, /* string for the beginning of the new |id| */ Graph *gg, /* first graph whose |id| is to be copied */ char *s2, /* string for the middle of the new |id| */ Graph *ggg, /* second graph whose |id| is to be copied */ char *s3@t\2\2@>) /* string for the end of the new |id| */@z@x l.549Arc *gb_virgin_arc()@yArc *gb_virgin_arc(void)@z@x l.581void gb_new_arc(u,v,len) Vertex *u, *v; /* a newly created arc will go from |u| to |v| */ long len; /* its length */@yvoid gb_new_arc(@t\1\1@> Vertex *u,Vertex *v, /* a newly created arc will go from |u| to |v| */ long len@t\2\2@>) /* its length */@z@x l.626void gb_new_edge(u,v,len) Vertex *u, *v; /* new arcs will go from |u| to |v| and from |v| to |u| */ long len; /* their length */@yvoid gb_new_edge(@t\1\1@> Vertex *u,Vertex *v, /* new arcs will go from |u| to |v| and from |v| to |u| */ long len@t\2\2@>) /* their length */@z@x l.689char *gb_save_string(s) register char *s; /* the string to be copied */@ychar *gb_save_string(register char *s) /* the string to be copied */@z@x l.772void switch_to_graph(g) Graph *g;@yvoid switch_to_graph(Graph *g)@z@x l.790void gb_recycle(g) Graph *g;@yvoid gb_recycle(Graph *g)@z@x l.804extern Graph*gb_new_graph(); /* create a new graph structure */extern void gb_new_arc(); /* append an arc to the current graph */extern Arc*gb_virgin_arc(); /* allocate a new |Arc| record */extern void gb_new_edge(); /* append an edge (two arcs) to the current graph */extern char*gb_save_string(); /* store a string in the current graph */extern void switch_to_graph(); /* save allocation variables, swap in others */extern void gb_recycle(); /* delete a graph structure */@yextern Graph*gb_new_graph(long); /* create a new graph structure */extern void gb_new_arc(Vertex *,Vertex *,long); /* append an arc to the current graph */extern Arc*gb_virgin_arc(void); /* allocate a new |Arc| record */extern void gb_new_edge(Vertex *,Vertex *,long); /* append an edge (two arcs) to the current graph */extern char*gb_save_string(register char *); /* store a string in the current graph */extern void switch_to_graph(Graph *); /* save allocation variables, swap in others */extern void gb_recycle(Graph *); /* delete a graph structure */@z@x l.839extern void hash_in(); /* input a name to the hash table of current graph */extern Vertex* hash_out(); /* find a name in hash table of current graph */extern void hash_setup(); /* create a hash table for a given graph */extern Vertex* hash_lookup(); /* find a name in a given graph */@yextern void hash_in(Vertex *); /* input a name to the hash table of current graph */extern Vertex* hash_out(char *); /* find a name in hash table of current graph */extern void hash_setup(Graph *); /* create a hash table for a given graph */extern Vertex* hash_lookup(char *,Graph *); /* find a name in a given graph */@z@x l.855void hash_in(v) Vertex *v;@yvoid hash_in(Vertex *v)@z@x l.898Vertex* hash_out(s) char* s;@yVertex* hash_out(char *s)@z@x l.909void hash_setup(g) Graph *g;@yvoid hash_setup(Graph *g)@z@x l.924Vertex* hash_lookup(s,g) char *s; Graph *g;@yVertex* hash_lookup(char *s,Graph *g)@z
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -