aboutsummaryrefslogtreecommitdiffstats
path: root/mail/pathalias/files/patch-mapaux.c
blob: 7d92bdbb4e10aa46126a91ec83e121271d4b9f16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
--- mapaux.c.orig   1993-03-03 22:10:03.000000000 +0100
+++ mapaux.c    2013-06-17 00:07:15.000000000 +0200
@@ -1,33 +1,21 @@
 /* pathalias -- by steve bellovin, as told to peter honeyman */
 #ifndef lint
-static char    *sccsid = "@(#)mapaux.c 9.8 91/06/23";
+static const char  *sccsid = "@(#)mapaux.c 9.8 91/06/23";
 #endif /* lint */
 
 #include "def.h"
 
 /* imports */
-extern long Nheap, Hashpart, Tabsize, NumNcopy, Nlink, NumLcopy;
-extern node **Table, *Home;
-extern char *Graphout, *Linkout, *Netchars, **Argv;
-extern int Vflag;
-extern void freelink(), die();
-extern long pack();
-extern link *newlink();
-extern node *newnode();
-extern char *strsave();
-extern int strcmp(), strlen();
 
 /* exports */
-extern long pack();
-extern void resetnodes(), dumpgraph(), showlinks(), terminalnet();
-extern int tiebreaker();
-extern node *ncopy();
 
 /* privates */
 static FILE *Gstream;  /* for dumping graph */
-STATIC void dumpnode(), untangle(), dfs();
-STATIC int height();
-STATIC link *lcopy();
+STATIC void dumpnode(register node *from);
+STATIC void untangle(void);
+STATIC void dfs(register node *n);
+STATIC int height(register node *n);
+STATIC palink *lcopy(register node *parent, register node *n);
 
 /*
  * slide everything from Table[low] to Table[high]
@@ -103,8 +91,8 @@
 dumpnode(from)
    register node *from;
 {  register node *to;
-   register link *l;
-   link *lnet = 0, *ll, *lnext;
+   register palink *l;
+   palink *lnet = 0, *ll, *lnext;
 
    for (l = from->n_link ; l; l = l->l_next) {
        to = l->l_to;
@@ -182,7 +170,7 @@
 STATIC void
 dfs(n)
    register node *n;
-{  register link *l;
+{  register palink *l;
    register node *next;
 
    n->n_flag |= INDFS;
@@ -203,7 +191,7 @@
 
 void
 showlinks() 
-{  register link *l;
+{  register palink *l;
    register node *n;
    register long i;
    FILE    *estream;
@@ -223,7 +211,7 @@
            fputs(l->l_to->n_name, estream);
            if (NETDIR(l) == LLEFT)
                putc(NETCHAR(l), estream);
-           fprintf(estream, "(%d)\n", l->l_cost);
+           fprintf(estream, "(%ld)\n", l->l_cost);
        }
    }
    (void) fclose(estream);
@@ -323,7 +311,7 @@
 node *
 ncopy(parent, l)
    register node *parent;
-   register link *l;
+   register palink *l;
 {  register node *n, *ncp;
 
 #ifdef DEBUG
@@ -359,11 +347,11 @@
  *
  * why copy any links other than aliases?  hmmm ...
  */
-STATIC link *
+STATIC palink *
 lcopy(parent, n)
    register node *parent, *n;
-{  register link *l, *lcp;
-   link *first = 0, *last = 0;
+{  register palink *l, *lcp;
+   palink *first = 0, *last = 0;
  
    for (l = n->n_link; l != 0; l = l->l_next) {
        /* skip if dest is already mapped */