| author | Tomas Zeman <tzeman@volny.cz> |
| Wed, 15 Feb 2012 15:15:20 +0100 | |
| changeset 108 | 5bae177dcf8e |
| parent 1 | 32f160a66da4 |
| permissions | -rw-r--r-- |
| 1 | 1 |
From: Tomas Zeman <tzeman@volny.cz> |
2 |
Date: Tue, 6 Nov 2007 11:43:46 +0100 |
|
|
108
5bae177dcf8e
diet-qmailanalog.patch: folded w/ upgrade-0.9-diet-qmailanalog.patch
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
3 |
|
|
5bae177dcf8e
diet-qmailanalog.patch: folded w/ upgrade-0.9-diet-qmailanalog.patch
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
4 |
diet-qmailanalog |
| 1 | 5 |
|
|
108
5bae177dcf8e
diet-qmailanalog.patch: folded w/ upgrade-0.9-diet-qmailanalog.patch
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
6 |
diff -r e38f008c268e source/dietlibc/diet-qmailanalog/FrugalBuild |
|
5bae177dcf8e
diet-qmailanalog.patch: folded w/ upgrade-0.9-diet-qmailanalog.patch
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
7 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
5bae177dcf8e
diet-qmailanalog.patch: folded w/ upgrade-0.9-diet-qmailanalog.patch
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
8 |
+++ b/source/dietlibc/diet-qmailanalog/FrugalBuild Wed Feb 15 15:15:07 2012 +0100 |
| 1 | 9 |
@@ -0,0 +1,37 @@ |
10 |
+# Maintainer: Tomas Zeman <tzeman@volny.cz> |
|
11 |
+# Accepts tai64 format dates (lines starting with @....) + mlmatchup |
|
12 |
+# see http://www.magma.com.ni/moin/TipsAnd/QmailAnalog |
|
13 |
+ |
|
14 |
+branch=diet |
|
15 |
+pkgorig=qmailanalog |
|
16 |
+pkgname=$branch-$pkgorig |
|
17 |
+pkgver=0.70 |
|
|
108
5bae177dcf8e
diet-qmailanalog.patch: folded w/ upgrade-0.9-diet-qmailanalog.patch
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
18 |
+pkgrel=2 |
|
5bae177dcf8e
diet-qmailanalog.patch: folded w/ upgrade-0.9-diet-qmailanalog.patch
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
19 |
+pkgdesc="collection of tools to help you analyze qmail's activity record" |
| 1 | 20 |
+makedepends=(dietlibc) |
21 |
+url="http://cr.yp.to/qmailanalog.html" |
|
22 |
+archs=(i686) |
|
23 |
+up2date='lynx -dump -nolist $url|grep $pkgorig|grep tar.gz|head -1|sed -e "s/.*$pkgorig-\(.*\)\.tar.gz.*$/\1/"' |
|
24 |
+source=(http://cr.yp.to/software/$pkgorig-$pkgver.tar.gz \ |
|
25 |
+ qmailanalog-multilog.patch) |
|
26 |
+sha1sums=('d9f47b6c5348759aeba3873b6b7653b823b2f92c' \
|
|
27 |
+ '05b9b7995e3bef33d8c9c2af239d9d23d95f813f') |
|
28 |
+provides=(qmailanalog) |
|
29 |
+ |
|
30 |
+build() {
|
|
31 |
+ qmail_dir=/var/qmail |
|
32 |
+ Fcd $pkgorig-$pkgver |
|
33 |
+ echo "$qmail_dir" > conf-home |
|
34 |
+ echo "diet gcc $CFLAGS" > conf-cc |
|
35 |
+ echo "diet gcc -s -static" > conf-ld |
|
36 |
+ Fmkdir $qmail_dir |
|
37 |
+ patch -p1 < $Fsrcdir/qmailanalog-multilog.patch || Fdie |
|
38 |
+ sed -i -e "s{(auto_home,{(\"$Fdestdir$qmail_dir\",{" hier.c
|
|
39 |
+ make || Fdie |
|
40 |
+ make setup || Fdie |
|
41 |
+ Frm $qmail_dir/man/cat* |
|
42 |
+ Fmkdir /usr/share/doc/$pkgname-$pkgver |
|
43 |
+ Fmv $qmail_dir/doc/* /usr/share/doc/$pkgname-$pkgver |
|
44 |
+ Frm $qmail_dir/doc |
|
45 |
+} |
|
46 |
+# vim: ft=sh |
|
|
108
5bae177dcf8e
diet-qmailanalog.patch: folded w/ upgrade-0.9-diet-qmailanalog.patch
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
47 |
diff -r e38f008c268e source/dietlibc/diet-qmailanalog/qmailanalog-multilog.patch |
|
5bae177dcf8e
diet-qmailanalog.patch: folded w/ upgrade-0.9-diet-qmailanalog.patch
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
48 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
5bae177dcf8e
diet-qmailanalog.patch: folded w/ upgrade-0.9-diet-qmailanalog.patch
Tomas Zeman <tzeman@volny.cz>
parents:
1
diff
changeset
|
49 |
+++ b/source/dietlibc/diet-qmailanalog/qmailanalog-multilog.patch Wed Feb 15 15:15:07 2012 +0100 |
| 1 | 50 |
@@ -0,0 +1,885 @@ |
51 |
+diff -x .svn -Naur qmailanalog-0.70/error.h qmailanalog/error.h |
|
52 |
+--- qmailanalog-0.70/error.h 1998-08-30 23:39:27.000000000 +0200 |
|
53 |
++++ qmailanalog/error.h 2007-04-30 20:57:24.000000000 +0200 |
|
54 |
+@@ -1,7 +1,8 @@ |
|
55 |
+ #ifndef ERROR_H |
|
56 |
+ #define ERROR_H |
|
57 |
+ |
|
58 |
+-extern int errno; |
|
59 |
++/* extern int errno; */ |
|
60 |
++#include <errno.h> |
|
61 |
+ |
|
62 |
+ extern int error_intr; |
|
63 |
+ extern int error_nomem; |
|
64 |
+diff -x .svn -Naur qmailanalog-0.70/FILES qmailanalog/FILES |
|
65 |
+--- qmailanalog-0.70/FILES 1998-08-30 23:39:26.000000000 +0200 |
|
66 |
++++ qmailanalog/FILES 2007-04-30 20:57:24.000000000 +0200 |
|
67 |
+@@ -132,3 +132,6 @@ |
|
68 |
+ case.3 |
|
69 |
+ case.h |
|
70 |
+ case_lowers.c |
|
71 |
++mlmatchup.8 |
|
72 |
++mlmatchup.c |
|
73 |
++mlmatchup |
|
74 |
+diff -x .svn -Naur qmailanalog-0.70/hier.c qmailanalog/hier.c |
|
75 |
+--- qmailanalog-0.70/hier.c 1998-08-30 23:39:27.000000000 +0200 |
|
76 |
++++ qmailanalog/hier.c 2007-06-13 11:09:42.000000000 +0200 |
|
77 |
+@@ -9,12 +9,16 @@ |
|
78 |
+ d(auto_home,"man",-1,-1,02755); |
|
79 |
+ d(auto_home,"man/man1",-1,-1,02755); |
|
80 |
+ d(auto_home,"man/cat1",-1,-1,02755); |
|
81 |
++ d(auto_home,"man/man8",-1,-1,02755); |
|
82 |
++ d(auto_home,"man/cat8",-1,-1,02755); |
|
83 |
+ |
|
84 |
+ c(auto_home,"doc","MATCHUP",-1,-1,0644); |
|
85 |
+ c(auto_home,"doc","ACCOUNTING",-1,-1,0644); |
|
86 |
+ |
|
87 |
+ c(auto_home,"man/man1","matchup.1",-1,-1,0644); |
|
88 |
+ c(auto_home,"man/cat1","matchup.0",-1,-1,0644); |
|
89 |
++ c(auto_home,"man/man8","mlmatchup.8",-1,-1,0644); |
|
90 |
++ c(auto_home,"man/cat8","mlmatchup.0",-1,-1,0644); |
|
91 |
+ c(auto_home,"man/man1","xqp.1",-1,-1,0644); |
|
92 |
+ c(auto_home,"man/cat1","xqp.0",-1,-1,0644); |
|
93 |
+ c(auto_home,"man/man1","xsender.1",-1,-1,0644); |
|
94 |
+@@ -25,6 +29,7 @@ |
|
95 |
+ c(auto_home,"man/cat1","columnt.0",-1,-1,0644); |
|
96 |
+ |
|
97 |
+ c(auto_home,"bin","matchup",-1,-1,0755); |
|
98 |
++ c(auto_home,"bin","mlmatchup",-1,-1,0755); |
|
99 |
+ c(auto_home,"bin","columnt",-1,-1,0755); |
|
100 |
+ c(auto_home,"bin","zoverall",-1,-1,0755); |
|
101 |
+ c(auto_home,"bin","zsendmail",-1,-1,0755); |
|
102 |
+diff -x .svn -Naur qmailanalog-0.70/Makefile qmailanalog/Makefile |
|
103 |
+--- qmailanalog-0.70/Makefile 1998-08-30 23:39:26.000000000 +0200 |
|
104 |
++++ qmailanalog/Makefile 2007-05-03 00:15:12.000000000 +0200 |
|
105 |
+@@ -243,7 +243,7 @@ |
|
106 |
+ chmod 755 makelib |
|
107 |
+ |
|
108 |
+ man: \ |
|
109 |
+-matchup.0 columnt.0 xqp.0 xsender.0 xrecipient.0 alloc.0 case.0 \ |
|
110 |
++matchup.0 mlmatchup.0 columnt.0 xqp.0 xsender.0 xrecipient.0 alloc.0 case.0 \ |
|
111 |
+ error.0 error_str.0 getln2.0 getln.0 stralloc.0 |
|
112 |
+ |
|
113 |
+ matchup: \ |
|
114 |
+@@ -275,7 +275,7 @@ |
|
115 |
+ ./compile open_trunc.c |
|
116 |
+ |
|
117 |
+ prog: \ |
|
118 |
+-matchup columnt zoverall zsendmail xqp xsender xrecipient ddist \ |
|
119 |
++matchup mlmatchup columnt zoverall zsendmail xqp xsender xrecipient ddist \ |
|
120 |
+ deferrals failures successes rhosts recipients rxdelay senders suids \ |
|
121 |
+ zddist zdeferrals zfailures zsuccesses zrhosts zrecipients zrxdelay \ |
|
122 |
+ zsenders zsuids |
|
123 |
+@@ -566,3 +566,22 @@ |
|
124 |
+ | sed s}HOME}"`head -1 conf-home`"}g \ |
|
125 |
+ > zsuids |
|
126 |
+ chmod 755 zsuids |
|
127 |
++ |
|
128 |
++mlmatchup: \ |
|
129 |
++load mlmatchup.o strerr.a getln.a substdio.a stralloc.a alloc.a error.a \ |
|
130 |
++str.a fs.a case.a |
|
131 |
++ ./load mlmatchup strerr.a getln.a substdio.a stralloc.a \ |
|
132 |
++ alloc.a error.a str.a fs.a case.a |
|
133 |
++ |
|
134 |
++mlmatchup.0: \ |
|
135 |
++mlmatchup.8 |
|
136 |
++ nroff -man mlmatchup.8 > mlmatchup.0 |
|
137 |
++ |
|
138 |
++mlmatchup.o: \ |
|
139 |
++compile mlmatchup.c stralloc.h gen_alloc.h gen_alloc.h gen_allocdefs.h \ |
|
140 |
++strerr.h getln.h substdio.h subfd.h substdio.h readwrite.h exit.h \ |
|
141 |
++str.h fmt.h scan.h case.h |
|
142 |
++ ./compile mlmatchup.c |
|
143 |
++ |
|
144 |
++clean: |
|
145 |
++ rm -f `cat TARGETS` |
|
146 |
+diff -x .svn -Naur qmailanalog-0.70/man.do qmailanalog/man.do |
|
147 |
+--- qmailanalog-0.70/man.do 1998-08-30 23:39:27.000000000 +0200 |
|
148 |
++++ qmailanalog/man.do 2007-04-30 20:57:24.000000000 +0200 |
|
149 |
+@@ -1,4 +1,4 @@ |
|
150 |
+ dependon \ |
|
151 |
+-matchup.0 columnt.0 \ |
|
152 |
++matchup.0 mlmatchup.0 columnt.0 \ |
|
153 |
+ xqp.0 xsender.0 xrecipient.0 \ |
|
154 |
+ alloc.0 case.0 error.0 error_str.0 getln2.0 getln.0 stralloc.0 |
|
155 |
+diff -x .svn -Naur qmailanalog-0.70/matchup.1 qmailanalog/matchup.1 |
|
156 |
+--- qmailanalog-0.70/matchup.1 1998-08-30 23:39:27.000000000 +0200 |
|
157 |
++++ qmailanalog/matchup.1 2007-04-30 20:57:24.000000000 +0200 |
|
158 |
+@@ -7,7 +7,9 @@ |
|
159 |
+ .B matchup |
|
160 |
+ reads a series of lines from |
|
161 |
+ .BR qmail-send , |
|
162 |
+-with a numeric timestamp in front of each line. |
|
163 |
++with a numeric timestamp in the format seconds.nanoseconds or a TAI64N timestamps |
|
164 |
++in front of each line, allowing either splogger(8) or multilog(8) to produce the |
|
165 |
++logfiles. |
|
166 |
+ .B matchup |
|
167 |
+ matches the end of each delivery attempt with the start of the delivery attempt |
|
168 |
+ and with the relevant message information; |
|
169 |
+@@ -108,4 +110,6 @@ |
|
170 |
+ xsender(1), |
|
171 |
+ accustamp(1), |
|
172 |
+ qmail-log(5), |
|
173 |
+-splogger(8) |
|
174 |
++splogger(8), |
|
175 |
++multilog(8), |
|
176 |
++mlmatchup(1) |
|
177 |
+diff -x .svn -Naur qmailanalog-0.70/matchup.c qmailanalog/matchup.c |
|
178 |
+--- qmailanalog-0.70/matchup.c 1998-08-30 23:39:27.000000000 +0200 |
|
179 |
++++ qmailanalog/matchup.c 2007-04-30 20:57:24.000000000 +0200 |
|
180 |
+@@ -183,6 +183,47 @@ |
|
181 |
+ poolbytes = pool.len; /* redundant, but doesn't hurt */ |
|
182 |
+ } |
|
183 |
+ |
|
184 |
++/* turn TAI date into old fashioned date */ |
|
185 |
++/* dates without @ are left alone */ |
|
186 |
++ |
|
187 |
++static char datebuf[FMT_ULONG+FMT_ULONG+2]; /* ssssssssss.ffffffffff\n */ |
|
188 |
++ |
|
189 |
++char * |
|
190 |
++datize(s) |
|
191 |
++char *s; |
|
192 |
++{
|
|
193 |
++ int c; |
|
194 |
++ int len; |
|
195 |
++ unsigned long u; |
|
196 |
++ unsigned long seconds = 0; |
|
197 |
++ unsigned long nanoseconds = 0; |
|
198 |
++ |
|
199 |
++ if(*s != '@') return s; |
|
200 |
++ s++; |
|
201 |
++ |
|
202 |
++ while ((c = *s++)) {
|
|
203 |
++ u = c - '0'; |
|
204 |
++ if (u >= 10) {
|
|
205 |
++ u = c - 'a'; |
|
206 |
++ if (u >= 6) break; |
|
207 |
++ u += 10; |
|
208 |
++ } |
|
209 |
++ seconds <<= 4; |
|
210 |
++ seconds += nanoseconds >> 28; |
|
211 |
++ nanoseconds &= 0xfffffff; |
|
212 |
++ nanoseconds <<= 4; |
|
213 |
++ nanoseconds += u; |
|
214 |
++ } |
|
215 |
++ seconds -= 4611686018427387914ULL; |
|
216 |
++ |
|
217 |
++ len = fmt_ulong(datebuf, seconds); |
|
218 |
++ datebuf[len++] = '.'; |
|
219 |
++ len += fmt_uint0(datebuf+len, nanoseconds, 9); |
|
220 |
++ datebuf[len] = 0; |
|
221 |
++ |
|
222 |
++ return datebuf; |
|
223 |
++} |
|
224 |
++ |
|
225 |
+ stralloc line = {0};
|
|
226 |
+ int match; |
|
227 |
+ |
|
228 |
+@@ -209,7 +250,7 @@ |
|
229 |
+ dmsg.u[dpos] = m; |
|
230 |
+ |
|
231 |
+ dstart.u[dpos] = pool.len; |
|
232 |
+- if (!stralloc_cats(&pool,line.s + field[0])) nomem(); |
|
233 |
++ if (!stralloc_cats(&pool,datize(line.s + field[0]))) nomem(); |
|
234 |
+ if (!stralloc_0(&pool)) nomem(); |
|
235 |
+ |
|
236 |
+ dchan.u[dpos] = pool.len; |
|
237 |
+@@ -267,7 +308,7 @@ |
|
238 |
+ if (mpos != -1) {
|
|
239 |
+ outs(pool.s + birth.u[mpos]); |
|
240 |
+ outs(" "); outs(pool.s + dstart.u[dpos]);
|
|
241 |
+- outs(" "); outs(line.s + field[0]);
|
|
242 |
++ outs(" "); outs(datize(line.s + field[0]));
|
|
243 |
+ outs(" "); out(strnum,fmt_ulong(strnum,bytes.u[mpos]));
|
|
244 |
+ outs(" "); outs(pool.s + sender.u[mpos]);
|
|
245 |
+ outs(" "); outs(pool.s + dchan.u[dpos]);
|
|
246 |
+@@ -279,7 +320,7 @@ |
|
247 |
+ else {
|
|
248 |
+ outs(pool.s + dstart.u[dpos]); |
|
249 |
+ outs(" "); outs(pool.s + dstart.u[dpos]);
|
|
250 |
+- outs(" "); outs(line.s + field[0]);
|
|
251 |
++ outs(" "); outs(datize(line.s + field[0]));
|
|
252 |
+ outs(" 0 ? "); outs(pool.s + dchan.u[dpos]);
|
|
253 |
+ outs("."); outs(pool.s + drecip.u[dpos]);
|
|
254 |
+ outs(" ? ? "); outs(reason);
|
|
255 |
+@@ -313,7 +354,7 @@ |
|
256 |
+ if (mpos == -1) return; |
|
257 |
+ |
|
258 |
+ outs("m "); outs(pool.s + birth.u[mpos]);
|
|
259 |
+- outs(" "); outs(line.s + field[0]);
|
|
260 |
++ outs(" "); outs(datize(line.s + field[0]));
|
|
261 |
+ outs(" "); out(strnum,fmt_ulong(strnum,bytes.u[mpos]));
|
|
262 |
+ outs(" "); out(strnum,fmt_ulong(strnum,numk.u[mpos]));
|
|
263 |
+ outs(" "); out(strnum,fmt_ulong(strnum,numd.u[mpos]));
|
|
264 |
+@@ -344,7 +385,7 @@ |
|
265 |
+ numz.u[mpos] = 0; |
|
266 |
+ |
|
267 |
+ birth.u[mpos] = pool.len; |
|
268 |
+- if (!stralloc_cats(&pool,line.s + field[0])) nomem(); |
|
269 |
++ if (!stralloc_cats(&pool,datize(line.s + field[0]))) nomem(); |
|
270 |
+ if (!stralloc_0(&pool)) nomem(); |
|
271 |
+ |
|
272 |
+ sender.u[mpos] = pool.len; |
|
273 |
+diff -x .svn -Naur qmailanalog-0.70/mlmatchup.8 qmailanalog/mlmatchup.8 |
|
274 |
+--- qmailanalog-0.70/mlmatchup.8 1970-01-01 01:00:00.000000000 +0100 |
|
275 |
++++ qmailanalog/mlmatchup.8 2007-04-30 20:57:24.000000000 +0200 |
|
276 |
+@@ -0,0 +1,33 @@ |
|
277 |
++.TH mlmatchup 8 |
|
278 |
++.SH NAME |
|
279 |
++mlmatchup \- collect information on messages and deliveries through multilog |
|
280 |
++.SH SYNTAX |
|
281 |
++.B mlmatchup |
|
282 |
++.SH DESCRIPTION |
|
283 |
++.B mlmatchup |
|
284 |
++behaves exactly like |
|
285 |
++.BR matchup(1) |
|
286 |
++with the difference, that it first reads (pending delivery) lines |
|
287 |
++from file descriptor 4. This makes |
|
288 |
++.B mlmatchup |
|
289 |
++suitable as a procesor action for multilog. |
|
290 |
++ |
|
291 |
++If you use multilog to process |
|
292 |
++.B qmail-send |
|
293 |
++logfiles expand the run file of qmail-send's log services like this: |
|
294 |
++ |
|
295 |
++.EX |
|
296 |
++ exec setuidgid qmaill multilog t ./main \\ |
|
297 |
++.br |
|
298 |
++ !/usr/local/qmailanalog/bin/mlmatchup ./qmailanalog |
|
299 |
++.EE |
|
300 |
++ |
|
301 |
++.SH "SEE ALSO" |
|
302 |
++multilog(8), |
|
303 |
++matchup(1), |
|
304 |
++xqp(1), |
|
305 |
++xrecipient(1), |
|
306 |
++xsender(1), |
|
307 |
++accustamp(1), |
|
308 |
++qmail-log(5), |
|
309 |
++splogger(8) |
|
310 |
+diff -x .svn -Naur qmailanalog-0.70/mlmatchup.c qmailanalog/mlmatchup.c |
|
311 |
+--- qmailanalog-0.70/mlmatchup.c 1970-01-01 01:00:00.000000000 +0100 |
|
312 |
++++ qmailanalog/mlmatchup.c 2007-04-30 20:57:24.000000000 +0200 |
|
313 |
+@@ -0,0 +1,536 @@ |
|
314 |
++#include "stralloc.h" |
|
315 |
++#include "gen_alloc.h" |
|
316 |
++#include "gen_allocdefs.h" |
|
317 |
++#include "strerr.h" |
|
318 |
++#include "getln.h" |
|
319 |
++#include "substdio.h" |
|
320 |
++#include "subfd.h" |
|
321 |
++#include "readwrite.h" |
|
322 |
++#include "exit.h" |
|
323 |
++#include "str.h" |
|
324 |
++#include "fmt.h" |
|
325 |
++#include "scan.h" |
|
326 |
++#include "case.h" |
|
327 |
++ |
|
328 |
++#define FATAL "matchup: fatal: " |
|
329 |
++ |
|
330 |
++void nomem() { strerr_die2x(111,FATAL,"out of memory"); }
|
|
331 |
++void die_read() { strerr_die2sys(111,FATAL,"unable to read input: "); }
|
|
332 |
++void die_write() { strerr_die2sys(111,FATAL,"unable to write output: "); }
|
|
333 |
++void die_write5() { strerr_die2sys(111,FATAL,"unable to write fd 5: "); }
|
|
334 |
++ |
|
335 |
++void out(buf,len) char *buf; int len; |
|
336 |
++{ if (substdio_put(subfdout,buf,len) == -1) die_write(); }
|
|
337 |
++void outs(buf) char *buf; |
|
338 |
++{ if (substdio_puts(subfdout,buf) == -1) die_write(); }
|
|
339 |
++ |
|
340 |
++char buf5[512]; |
|
341 |
++substdio ss5 = SUBSTDIO_FDBUF(write,5,buf5,sizeof buf5); |
|
342 |
++ |
|
343 |
++void out5(buf,len) char *buf; int len; |
|
344 |
++{ if (substdio_put(&ss5,buf,len) == -1) die_write5(); }
|
|
345 |
++void outs5(buf) char *buf; |
|
346 |
++{ if (substdio_puts(&ss5,buf) == -1) die_write5(); }
|
|
347 |
++ |
|
348 |
++GEN_ALLOC_typedef(ulongalloc,unsigned long,u,len,a) |
|
349 |
++GEN_ALLOC_ready(ulongalloc,unsigned long,u,len,a,i,n,x,30,ulongalloc_ready) |
|
350 |
++GEN_ALLOC_readyplus(ulongalloc,unsigned long,u,len,a,i,n,x,30,ulongalloc_readyplus) |
|
351 |
++ |
|
352 |
++char strnum[FMT_ULONG]; |
|
353 |
++ |
|
354 |
++stralloc pool = {0};
|
|
355 |
++unsigned int poolbytes = 0; |
|
356 |
++ |
|
357 |
++int nummsg = 0; |
|
358 |
++ulongalloc msg = {0};
|
|
359 |
++ulongalloc bytes = {0};
|
|
360 |
++ulongalloc qp = {0};
|
|
361 |
++ulongalloc uid = {0};
|
|
362 |
++ulongalloc numk = {0};
|
|
363 |
++ulongalloc numd = {0};
|
|
364 |
++ulongalloc numz = {0};
|
|
365 |
++ulongalloc sender = {0};
|
|
366 |
++ulongalloc birth = {0};
|
|
367 |
++ |
|
368 |
++int msg_find(m) |
|
369 |
++unsigned long m; |
|
370 |
++{
|
|
371 |
++ int i; |
|
372 |
++ for (i = 0;i < nummsg;++i) if (msg.u[i] == m) return i; |
|
373 |
++ return -1; |
|
374 |
++} |
|
375 |
++ |
|
376 |
++int msg_add(m) |
|
377 |
++unsigned long m; |
|
378 |
++{
|
|
379 |
++ int i; |
|
380 |
++ for (i = 0;i < nummsg;++i) if (msg.u[i] == m) return i; |
|
381 |
++ i = nummsg++; |
|
382 |
++ if (!ulongalloc_ready(&msg,nummsg)) nomem(); |
|
383 |
++ if (!ulongalloc_ready(&bytes,nummsg)) nomem(); |
|
384 |
++ if (!ulongalloc_ready(&qp,nummsg)) nomem(); |
|
385 |
++ if (!ulongalloc_ready(&uid,nummsg)) nomem(); |
|
386 |
++ if (!ulongalloc_ready(&numk,nummsg)) nomem(); |
|
387 |
++ if (!ulongalloc_ready(&numd,nummsg)) nomem(); |
|
388 |
++ if (!ulongalloc_ready(&numz,nummsg)) nomem(); |
|
389 |
++ if (!ulongalloc_ready(&sender,nummsg)) nomem(); |
|
390 |
++ if (!ulongalloc_ready(&birth,nummsg)) nomem(); |
|
391 |
++ msg.u[i] = m; |
|
392 |
++ return i; |
|
393 |
++} |
|
394 |
++ |
|
395 |
++int msg_kill(i) |
|
396 |
++int i; |
|
397 |
++{
|
|
398 |
++ poolbytes -= str_len(pool.s + sender.u[i]) + 1; |
|
399 |
++ poolbytes -= str_len(pool.s + birth.u[i]) + 1; |
|
400 |
++ |
|
401 |
++ --nummsg; |
|
402 |
++ msg.u[i] = msg.u[nummsg]; |
|
403 |
++ bytes.u[i] = bytes.u[nummsg]; |
|
404 |
++ qp.u[i] = qp.u[nummsg]; |
|
405 |
++ uid.u[i] = uid.u[nummsg]; |
|
406 |
++ numk.u[i] = numk.u[nummsg]; |
|
407 |
++ numd.u[i] = numd.u[nummsg]; |
|
408 |
++ numz.u[i] = numz.u[nummsg]; |
|
409 |
++ sender.u[i] = sender.u[nummsg]; |
|
410 |
++ birth.u[i] = birth.u[nummsg]; |
|
411 |
++} |
|
412 |
++ |
|
413 |
++int numdel = 0; |
|
414 |
++ulongalloc del = {0};
|
|
415 |
++ulongalloc dmsg = {0};
|
|
416 |
++ulongalloc dchan = {0};
|
|
417 |
++ulongalloc drecip = {0};
|
|
418 |
++ulongalloc dstart = {0};
|
|
419 |
++ |
|
420 |
++int del_find(d) |
|
421 |
++unsigned long d; |
|
422 |
++{
|
|
423 |
++ int i; |
|
424 |
++ for (i = 0;i < numdel;++i) if (del.u[i] == d) return i; |
|
425 |
++ return -1; |
|
426 |
++} |
|
427 |
++ |
|
428 |
++int del_add(d) |
|
429 |
++unsigned long d; |
|
430 |
++{
|
|
431 |
++ int i; |
|
432 |
++ for (i = 0;i < numdel;++i) if (del.u[i] == d) return i; |
|
433 |
++ i = numdel++; |
|
434 |
++ if (!ulongalloc_ready(&del,numdel)) nomem(); |
|
435 |
++ if (!ulongalloc_ready(&dmsg,numdel)) nomem(); |
|
436 |
++ if (!ulongalloc_ready(&dchan,numdel)) nomem(); |
|
437 |
++ if (!ulongalloc_ready(&drecip,numdel)) nomem(); |
|
438 |
++ if (!ulongalloc_ready(&dstart,numdel)) nomem(); |
|
439 |
++ del.u[i] = d; |
|
440 |
++ return i; |
|
441 |
++} |
|
442 |
++ |
|
443 |
++void del_kill(i) |
|
444 |
++int i; |
|
445 |
++{
|
|
446 |
++ poolbytes -= str_len(pool.s + dchan.u[i]) + 1; |
|
447 |
++ poolbytes -= str_len(pool.s + drecip.u[i]) + 1; |
|
448 |
++ poolbytes -= str_len(pool.s + dstart.u[i]) + 1; |
|
449 |
++ --numdel; |
|
450 |
++ del.u[i] = del.u[numdel]; |
|
451 |
++ dmsg.u[i] = dmsg.u[numdel]; |
|
452 |
++ dchan.u[i] = dchan.u[numdel]; |
|
453 |
++ drecip.u[i] = drecip.u[numdel]; |
|
454 |
++ dstart.u[i] = dstart.u[numdel]; |
|
455 |
++} |
|
456 |
++ |
|
457 |
++stralloc pool2 = {0};
|
|
458 |
++ |
|
459 |
++void garbage() |
|
460 |
++{
|
|
461 |
++ int i; |
|
462 |
++ char *x; |
|
463 |
++ |
|
464 |
++ if (pool.len - poolbytes < poolbytes + 4096) return; |
|
465 |
++ |
|
466 |
++ if (!stralloc_copys(&pool2,"")) nomem(); |
|
467 |
++ |
|
468 |
++ for (i = 0;i < nummsg;++i) {
|
|
469 |
++ x = pool.s + birth.u[i]; |
|
470 |
++ birth.u[i] = pool2.len; |
|
471 |
++ if (!stralloc_cats(&pool2,x)) nomem(); |
|
472 |
++ if (!stralloc_0(&pool2)) nomem(); |
|
473 |
++ x = pool.s + sender.u[i]; |
|
474 |
++ sender.u[i] = pool2.len; |
|
475 |
++ if (!stralloc_cats(&pool2,x)) nomem(); |
|
476 |
++ if (!stralloc_0(&pool2)) nomem(); |
|
477 |
++ } |
|
478 |
++ |
|
479 |
++ for (i = 0;i < numdel;++i) {
|
|
480 |
++ x = pool.s + dstart.u[i]; |
|
481 |
++ dstart.u[i] = pool2.len; |
|
482 |
++ if (!stralloc_cats(&pool2,x)) nomem(); |
|
483 |
++ if (!stralloc_0(&pool2)) nomem(); |
|
484 |
++ x = pool.s + dchan.u[i]; |
|
485 |
++ dchan.u[i] = pool2.len; |
|
486 |
++ if (!stralloc_cats(&pool2,x)) nomem(); |
|
487 |
++ if (!stralloc_0(&pool2)) nomem(); |
|
488 |
++ x = pool.s + drecip.u[i]; |
|
489 |
++ drecip.u[i] = pool2.len; |
|
490 |
++ if (!stralloc_cats(&pool2,x)) nomem(); |
|
491 |
++ if (!stralloc_0(&pool2)) nomem(); |
|
492 |
++ } |
|
493 |
++ |
|
494 |
++ if (!stralloc_copy(&pool,&pool2)) nomem(); |
|
495 |
++ |
|
496 |
++ poolbytes = pool.len; /* redundant, but doesn't hurt */ |
|
497 |
++} |
|
498 |
++ |
|
499 |
++/* turn TAI date into old fashioned date */ |
|
500 |
++/* dates without @ are left alone */ |
|
501 |
++ |
|
502 |
++static char datebuf[FMT_ULONG+FMT_ULONG+2]; /* ssssssssss.ffffffffff\n */ |
|
503 |
++ |
|
504 |
++char * |
|
505 |
++datize(s) |
|
506 |
++char *s; |
|
507 |
++{
|
|
508 |
++ int c; |
|
509 |
++ int len; |
|
510 |
++ unsigned long u; |
|
511 |
++ unsigned long seconds = 0; |
|
512 |
++ unsigned long nanoseconds = 0; |
|
513 |
++ |
|
514 |
++ if(*s != '@') return s; |
|
515 |
++ s++; |
|
516 |
++ |
|
517 |
++ while ((c = *s++)) {
|
|
518 |
++ u = c - '0'; |
|
519 |
++ if (u >= 10) {
|
|
520 |
++ u = c - 'a'; |
|
521 |
++ if (u >= 6) break; |
|
522 |
++ u += 10; |
|
523 |
++ } |
|
524 |
++ seconds <<= 4; |
|
525 |
++ seconds += nanoseconds >> 28; |
|
526 |
++ nanoseconds &= 0xfffffff; |
|
527 |
++ nanoseconds <<= 4; |
|
528 |
++ nanoseconds += u; |
|
529 |
++ } |
|
530 |
++ seconds -= 4611686018427387914ULL; |
|
531 |
++ |
|
532 |
++ len = fmt_ulong(datebuf, seconds); |
|
533 |
++ datebuf[len++] = '.'; |
|
534 |
++ len += fmt_uint0(datebuf+len, nanoseconds, 9); |
|
535 |
++ datebuf[len] = 0; |
|
536 |
++ |
|
537 |
++ return datebuf; |
|
538 |
++} |
|
539 |
++ |
|
540 |
++stralloc line = {0};
|
|
541 |
++int match; |
|
542 |
++ |
|
543 |
++#define FIELDS 20 |
|
544 |
++int field[FIELDS]; |
|
545 |
++ |
|
546 |
++void clear() |
|
547 |
++{
|
|
548 |
++ while (numdel > 0) del_kill(0); |
|
549 |
++ garbage(); |
|
550 |
++} |
|
551 |
++ |
|
552 |
++void starting() |
|
553 |
++{
|
|
554 |
++ unsigned long d; |
|
555 |
++ unsigned long m; |
|
556 |
++ int dpos; |
|
557 |
++ |
|
558 |
++ scan_ulong(line.s + field[3],&d); |
|
559 |
++ scan_ulong(line.s + field[5],&m); |
|
560 |
++ |
|
561 |
++ dpos = del_add(d); |
|
562 |
++ |
|
563 |
++ dmsg.u[dpos] = m; |
|
564 |
++ |
|
565 |
++ dstart.u[dpos] = pool.len; |
|
566 |
++ if (!stralloc_cats(&pool,datize(line.s + field[0]))) nomem(); |
|
567 |
++ if (!stralloc_0(&pool)) nomem(); |
|
568 |
++ |
|
569 |
++ dchan.u[dpos] = pool.len; |
|
570 |
++ if (!stralloc_cats(&pool,line.s + field[7])) nomem(); |
|
571 |
++ if (!stralloc_0(&pool)) nomem(); |
|
572 |
++ |
|
573 |
++ drecip.u[dpos] = pool.len; |
|
574 |
++ if (!stralloc_cats(&pool,line.s + field[8])) nomem(); |
|
575 |
++ if (!stralloc_0(&pool)) nomem(); |
|
576 |
++ case_lowers(pool.s + drecip.u[dpos]); |
|
577 |
++ |
|
578 |
++ poolbytes += pool.len - dstart.u[dpos]; |
|
579 |
++} |
|
580 |
++ |
|
581 |
++void delivery() |
|
582 |
++{
|
|
583 |
++ unsigned long d; |
|
584 |
++ unsigned long m; |
|
585 |
++ int dpos; |
|
586 |
++ int mpos; |
|
587 |
++ char *result = "?"; |
|
588 |
++ char *reason = ""; |
|
589 |
++ |
|
590 |
++ scan_ulong(line.s + field[2],&d); |
|
591 |
++ |
|
592 |
++ dpos = del_find(d); |
|
593 |
++ if (dpos == -1) return; |
|
594 |
++ |
|
595 |
++ m = dmsg.u[dpos]; |
|
596 |
++ mpos = msg_find(m); |
|
597 |
++ |
|
598 |
++ if (str_start(line.s + field[3],"succ")) {
|
|
599 |
++ if (mpos != -1) ++numk.u[mpos]; |
|
600 |
++ result = "d k "; |
|
601 |
++ reason = line.s + field[4]; |
|
602 |
++ } |
|
603 |
++ else if (str_start(line.s + field[3],"fail")) {
|
|
604 |
++ if (mpos != -1) ++numd.u[mpos]; |
|
605 |
++ result = "d d "; |
|
606 |
++ reason = line.s + field[4]; |
|
607 |
++ } |
|
608 |
++ else if (str_start(line.s + field[3],"defer")) {
|
|
609 |
++ if (mpos != -1) ++numz.u[mpos]; |
|
610 |
++ result = "d z "; |
|
611 |
++ reason = line.s + field[4]; |
|
612 |
++ } |
|
613 |
++ else if (str_start(line.s + field[3],"report")) {
|
|
614 |
++ if (mpos != -1) ++numz.u[mpos]; |
|
615 |
++ result = "d z "; |
|
616 |
++ reason = "report_mangled"; |
|
617 |
++ } |
|
618 |
++ |
|
619 |
++ outs(result); |
|
620 |
++ |
|
621 |
++ if (mpos != -1) {
|
|
622 |
++ outs(pool.s + birth.u[mpos]); |
|
623 |
++ outs(" "); outs(pool.s + dstart.u[dpos]);
|
|
624 |
++ outs(" "); outs(datize(line.s + field[0]));
|
|
625 |
++ outs(" "); out(strnum,fmt_ulong(strnum,bytes.u[mpos]));
|
|
626 |
++ outs(" "); outs(pool.s + sender.u[mpos]);
|
|
627 |
++ outs(" "); outs(pool.s + dchan.u[dpos]);
|
|
628 |
++ outs("."); outs(pool.s + drecip.u[dpos]);
|
|
629 |
++ outs(" "); out(strnum,fmt_ulong(strnum,qp.u[mpos]));
|
|
630 |
++ outs(" "); out(strnum,fmt_ulong(strnum,uid.u[mpos]));
|
|
631 |
++ outs(" "); outs(reason);
|
|
632 |
++ } |
|
633 |
++ else {
|
|
634 |
++ outs(pool.s + dstart.u[dpos]); |
|
635 |
++ outs(" "); outs(pool.s + dstart.u[dpos]);
|
|
636 |
++ outs(" "); outs(datize(line.s + field[0]));
|
|
637 |
++ outs(" 0 ? "); outs(pool.s + dchan.u[dpos]);
|
|
638 |
++ outs("."); outs(pool.s + drecip.u[dpos]);
|
|
639 |
++ outs(" ? ? "); outs(reason);
|
|
640 |
++ } |
|
641 |
++ |
|
642 |
++ outs("\n");
|
|
643 |
++ |
|
644 |
++ del_kill(dpos); |
|
645 |
++ garbage(); |
|
646 |
++} |
|
647 |
++ |
|
648 |
++void newmsg() |
|
649 |
++{
|
|
650 |
++ unsigned long m; |
|
651 |
++ int mpos; |
|
652 |
++ |
|
653 |
++ scan_ulong(line.s + field[3],&m); |
|
654 |
++ mpos = msg_find(m); |
|
655 |
++ if (mpos == -1) return; |
|
656 |
++ msg_kill(mpos); |
|
657 |
++ garbage(); |
|
658 |
++} |
|
659 |
++ |
|
660 |
++void endmsg() |
|
661 |
++{
|
|
662 |
++ unsigned long m; |
|
663 |
++ int mpos; |
|
664 |
++ |
|
665 |
++ scan_ulong(line.s + field[3],&m); |
|
666 |
++ mpos = msg_find(m); |
|
667 |
++ if (mpos == -1) return; |
|
668 |
++ |
|
669 |
++ outs("m "); outs(pool.s + birth.u[mpos]);
|
|
670 |
++ outs(" "); outs(datize(line.s + field[0]));
|
|
671 |
++ outs(" "); out(strnum,fmt_ulong(strnum,bytes.u[mpos]));
|
|
672 |
++ outs(" "); out(strnum,fmt_ulong(strnum,numk.u[mpos]));
|
|
673 |
++ outs(" "); out(strnum,fmt_ulong(strnum,numd.u[mpos]));
|
|
674 |
++ outs(" "); out(strnum,fmt_ulong(strnum,numz.u[mpos]));
|
|
675 |
++ outs(" "); outs(pool.s + sender.u[mpos]);
|
|
676 |
++ outs(" "); out(strnum,fmt_ulong(strnum,qp.u[mpos]));
|
|
677 |
++ outs(" "); out(strnum,fmt_ulong(strnum,uid.u[mpos]));
|
|
678 |
++ outs("\n");
|
|
679 |
++ |
|
680 |
++ msg_kill(mpos); |
|
681 |
++ garbage(); |
|
682 |
++} |
|
683 |
++ |
|
684 |
++void info() |
|
685 |
++{
|
|
686 |
++ unsigned long m; |
|
687 |
++ int mpos; |
|
688 |
++ |
|
689 |
++ scan_ulong(line.s + field[3],&m); |
|
690 |
++ mpos = msg_add(m); |
|
691 |
++ |
|
692 |
++ scan_ulong(line.s + field[5],&bytes.u[mpos]); |
|
693 |
++ scan_ulong(line.s + field[9],&qp.u[mpos]); |
|
694 |
++ scan_ulong(line.s + field[11],&uid.u[mpos]); |
|
695 |
++ |
|
696 |
++ numk.u[mpos] = 0; |
|
697 |
++ numd.u[mpos] = 0; |
|
698 |
++ numz.u[mpos] = 0; |
|
699 |
++ |
|
700 |
++ birth.u[mpos] = pool.len; |
|
701 |
++ if (!stralloc_cats(&pool,datize(line.s + field[0]))) nomem(); |
|
702 |
++ if (!stralloc_0(&pool)) nomem(); |
|
703 |
++ |
|
704 |
++ sender.u[mpos] = pool.len; |
|
705 |
++ if (!stralloc_cats(&pool,line.s + field[7])) nomem(); |
|
706 |
++ if (!stralloc_0(&pool)) nomem(); |
|
707 |
++ case_lowers(pool.s + sender.u[mpos]); |
|
708 |
++ |
|
709 |
++ poolbytes += pool.len - birth.u[mpos]; |
|
710 |
++} |
|
711 |
++ |
|
712 |
++void extra() |
|
713 |
++{
|
|
714 |
++ unsigned long m; |
|
715 |
++ int mpos; |
|
716 |
++ |
|
717 |
++ scan_ulong(line.s + field[2],&m); |
|
718 |
++ mpos = msg_find(m); |
|
719 |
++ if (mpos == -1) return; |
|
720 |
++ |
|
721 |
++ scan_ulong(line.s + field[3],&numk.u[mpos]); |
|
722 |
++ scan_ulong(line.s + field[4],&numz.u[mpos]); |
|
723 |
++ scan_ulong(line.s + field[5],&numd.u[mpos]); |
|
724 |
++} |
|
725 |
++ |
|
726 |
++void pending() |
|
727 |
++{
|
|
728 |
++ int i; |
|
729 |
++ |
|
730 |
++ for (i = 0;i < nummsg;++i) {
|
|
731 |
++ outs5(pool.s + birth.u[i]); |
|
732 |
++ outs5(" info msg ");
|
|
733 |
++ out5(strnum,fmt_ulong(strnum,msg.u[i])); |
|
734 |
++ outs5(": bytes ");
|
|
735 |
++ out5(strnum,fmt_ulong(strnum,bytes.u[i])); |
|
736 |
++ outs5(" from ");
|
|
737 |
++ outs5(pool.s + sender.u[i]); |
|
738 |
++ outs5(" qp ");
|
|
739 |
++ out5(strnum,fmt_ulong(strnum,qp.u[i])); |
|
740 |
++ outs5(" uid ");
|
|
741 |
++ out5(strnum,fmt_ulong(strnum,uid.u[i])); |
|
742 |
++ outs5("\n");
|
|
743 |
++ outs5(pool.s + birth.u[i]); |
|
744 |
++ outs5(" extra ");
|
|
745 |
++ out5(strnum,fmt_ulong(strnum,msg.u[i])); |
|
746 |
++ outs5(" ");
|
|
747 |
++ out5(strnum,fmt_ulong(strnum,numk.u[i])); |
|
748 |
++ outs5(" ");
|
|
749 |
++ out5(strnum,fmt_ulong(strnum,numz.u[i])); |
|
750 |
++ outs5(" ");
|
|
751 |
++ out5(strnum,fmt_ulong(strnum,numd.u[i])); |
|
752 |
++ outs5("\n");
|
|
753 |
++ } |
|
754 |
++ |
|
755 |
++ for (i = 0;i < numdel;++i) {
|
|
756 |
++ outs5(pool.s + dstart.u[i]); |
|
757 |
++ outs5(" starting delivery ");
|
|
758 |
++ out5(strnum,fmt_ulong(strnum,del.u[i])); |
|
759 |
++ outs5(": msg ");
|
|
760 |
++ out5(strnum,fmt_ulong(strnum,dmsg.u[i])); |
|
761 |
++ outs5(" to ");
|
|
762 |
++ outs5(pool.s + dchan.u[i]); |
|
763 |
++ outs5(" ");
|
|
764 |
++ outs5(pool.s + drecip.u[i]); |
|
765 |
++ outs5("\n");
|
|
766 |
++ } |
|
767 |
++ |
|
768 |
++ out5(line.s,line.len); |
|
769 |
++ if (substdio_flush(&ss5) == -1) die_write5(); |
|
770 |
++} |
|
771 |
++ |
|
772 |
++stralloc outline = {0};
|
|
773 |
++ |
|
774 |
++void matchup(substdio *ssin) |
|
775 |
++{
|
|
776 |
++ int i; |
|
777 |
++ int j; |
|
778 |
++ char ch; |
|
779 |
++ |
|
780 |
++ for (;;) {
|
|
781 |
++ if (getln(ssin,&line,&match,'\n') == -1) die_read(); |
|
782 |
++ if (!match) break; |
|
783 |
++ |
|
784 |
++ if (!stralloc_copy(&outline,&line)) nomem(); |
|
785 |
++ |
|
786 |
++ for (i = 0;i < line.len;++i) {
|
|
787 |
++ ch = line.s[i]; |
|
788 |
++ if ((ch == '\n') || (ch == ' ') || (ch == '\t')) line.s[i] = 0; |
|
789 |
++ } |
|
790 |
++ j = 0; |
|
791 |
++ for (i = 0;i < FIELDS;++i) {
|
|
792 |
++ while (j < line.len) if (line.s[j]) break; else ++j; |
|
793 |
++ field[i] = j; |
|
794 |
++ while (j < line.len) if (!line.s[j]) break; else ++j; |
|
795 |
++ } |
|
796 |
++ if (!stralloc_0(&line)) nomem(); |
|
797 |
++ |
|
798 |
++ if (str_equal(line.s + field[1],"status:")) ; |
|
799 |
++ else if (str_equal(line.s + field[1],"starting")) starting(); |
|
800 |
++ else if (str_equal(line.s + field[1],"delivery")) delivery(); |
|
801 |
++ else if (str_equal(line.s + field[1],"new")) newmsg(); |
|
802 |
++ else if (str_equal(line.s + field[1],"end")) endmsg(); |
|
803 |
++ else if (str_equal(line.s + field[1],"info")) info(); |
|
804 |
++ else if (str_equal(line.s + field[1],"extra")) extra(); |
|
805 |
++ else if (str_equal(line.s + field[1],"running")) clear(); |
|
806 |
++ else if (str_equal(line.s + field[1],"exiting")) clear(); |
|
807 |
++ else if (str_equal(line.s + field[1],"number")) ; |
|
808 |
++ else if (str_equal(line.s + field[1],"local")) ; |
|
809 |
++ else if (str_equal(line.s + field[1],"remote")) ; |
|
810 |
++ else if (str_equal(line.s + field[1],"warning:")) out(outline.s,outline.len); |
|
811 |
++ else if (str_equal(line.s + field[1],"alert:")) out(outline.s,outline.len); |
|
812 |
++ else {
|
|
813 |
++ outs("? ");
|
|
814 |
++ out(outline.s,outline.len); |
|
815 |
++ } |
|
816 |
++ } |
|
817 |
++} |
|
818 |
++ |
|
819 |
++char subfd4_input[SUBSTDIO_INSIZE]; |
|
820 |
++static substdio i4t = SUBSTDIO_FDBUF(subfd_read,4,subfd4_input,sizeof subfd4_input); |
|
821 |
++substdio *subfd4in = &i4t; |
|
822 |
++ |
|
823 |
++void main() |
|
824 |
++{
|
|
825 |
++ int i; |
|
826 |
++ int j; |
|
827 |
++ char ch; |
|
828 |
++ |
|
829 |
++ if (!stralloc_copys(&pool,"")) nomem(); |
|
830 |
++ |
|
831 |
++ if (!ulongalloc_ready(&msg,1)) nomem(); |
|
832 |
++ if (!ulongalloc_ready(&bytes,1)) nomem(); |
|
833 |
++ if (!ulongalloc_ready(&qp,1)) nomem(); |
|
834 |
++ if (!ulongalloc_ready(&uid,1)) nomem(); |
|
835 |
++ if (!ulongalloc_ready(&numk,1)) nomem(); |
|
836 |
++ if (!ulongalloc_ready(&numd,1)) nomem(); |
|
837 |
++ if (!ulongalloc_ready(&numz,1)) nomem(); |
|
838 |
++ if (!ulongalloc_ready(&del,1)) nomem(); |
|
839 |
++ if (!ulongalloc_ready(&dmsg,1)) nomem(); |
|
840 |
++ |
|
841 |
++ matchup(subfd4in); |
|
842 |
++ matchup(subfdin); |
|
843 |
++ |
|
844 |
++ if (substdio_flush(subfdout) == -1) die_write(); |
|
845 |
++ |
|
846 |
++ pending(); |
|
847 |
++ |
|
848 |
++ _exit(0); |
|
849 |
++} |
|
850 |
+diff -x .svn -Naur qmailanalog-0.70/prog.do qmailanalog/prog.do |
|
851 |
+--- qmailanalog-0.70/prog.do 1998-08-30 23:39:27.000000000 +0200 |
|
852 |
++++ qmailanalog/prog.do 2007-04-30 20:57:24.000000000 +0200 |
|
853 |
+@@ -1,5 +1,6 @@ |
|
854 |
+ dependon \ |
|
855 |
+ matchup \ |
|
856 |
++mlmatchup \ |
|
857 |
+ columnt \ |
|
858 |
+ zoverall \ |
|
859 |
+ zsendmail \ |
|
860 |
+diff -x .svn -Naur qmailanalog-0.70/TARGETS qmailanalog/TARGETS |
|
861 |
+--- qmailanalog-0.70/TARGETS 1998-08-30 23:39:26.000000000 +0200 |
|
862 |
++++ qmailanalog/TARGETS 2007-05-03 00:14:59.000000000 +0200 |
|
863 |
+@@ -70,6 +70,9 @@ |
|
864 |
+ case_lowers.o |
|
865 |
+ case.a |
|
866 |
+ matchup |
|
867 |
++mlmatchup |
|
868 |
++mlmatchup.o |
|
869 |
++mlmatchup.0 |
|
870 |
+ columnt.o |
|
871 |
+ slurpclose.o |
|
872 |
+ columnt |
|
873 |
+diff -x .svn -Naur qmailanalog-0.70/zdeferrals.sh qmailanalog/zdeferrals.sh |
|
874 |
+--- qmailanalog-0.70/zdeferrals.sh 1998-08-30 23:39:27.000000000 +0200 |
|
875 |
++++ qmailanalog/zdeferrals.sh 2007-04-30 20:57:24.000000000 +0200 |
|
876 |
+@@ -5,4 +5,4 @@ |
|
877 |
+ * xdelay is the total xdelay on those deliveries. |
|
878 |
+ ' |
|
879 |
+ ( echo del xdelay reason |
|
880 |
+-HOME/bin/deferrals | sort +2 ) | HOME/bin/columnt | tr _ ' ' |
|
881 |
++HOME/bin/deferrals | sort -k2 ) | HOME/bin/columnt | tr _ ' ' |
|
882 |
+diff -x .svn -Naur qmailanalog-0.70/zfailures.sh qmailanalog/zfailures.sh |
|
883 |
+--- qmailanalog-0.70/zfailures.sh 1998-08-30 23:39:27.000000000 +0200 |
|
884 |
++++ qmailanalog/zfailures.sh 2007-04-30 20:57:24.000000000 +0200 |
|
885 |
+@@ -5,4 +5,4 @@ |
|
886 |
+ * xdelay is the total xdelay on those deliveries. |
|
887 |
+ ' |
|
888 |
+ ( echo del xdelay reason |
|
889 |
+-HOME/bin/failures | sort +2 ) | HOME/bin/columnt | tr _ ' ' |
|
890 |
++HOME/bin/failures | sort -k2 ) | HOME/bin/columnt | tr _ ' ' |
|
891 |
+diff -x .svn -Naur qmailanalog-0.70/zrecipients.sh qmailanalog/zrecipients.sh |
|
892 |
+--- qmailanalog-0.70/zrecipients.sh 1998-08-30 23:39:27.000000000 +0200 |
|
893 |
++++ qmailanalog/zrecipients.sh 2007-04-30 20:57:24.000000000 +0200 |
|
894 |
+@@ -7,4 +7,4 @@ |
|
895 |
+ * xdelay is the total xdelay incurred by this recipient. |
|
896 |
+ ' |
|
897 |
+ ( echo sbytes mess tries xdelay recipient |
|
898 |
+-HOME/bin/recipients | sort +4 ) | HOME/bin/columnt |
|
899 |
++HOME/bin/recipients | sort -k4 ) | HOME/bin/columnt |
|
900 |
+diff -x .svn -Naur qmailanalog-0.70/zrhosts.sh qmailanalog/zrhosts.sh |
|
901 |
+--- qmailanalog-0.70/zrhosts.sh 1998-08-30 23:39:27.000000000 +0200 |
|
902 |
++++ qmailanalog/zrhosts.sh 2007-04-30 20:57:24.000000000 +0200 |
|
903 |
+@@ -7,4 +7,4 @@ |
|
904 |
+ * xdelay is the total xdelay incurred by this host. |
|
905 |
+ ' |
|
906 |
+ ( echo sbytes mess tries xdelay host |
|
907 |
+-HOME/bin/rhosts | sort +4 ) | HOME/bin/columnt |
|
908 |
++HOME/bin/rhosts | sort -k4 ) | HOME/bin/columnt |
|
909 |
+diff -x .svn -Naur qmailanalog-0.70/zsenders.sh qmailanalog/zsenders.sh |
|
910 |
+--- qmailanalog-0.70/zsenders.sh 1998-08-30 23:39:27.000000000 +0200 |
|
911 |
++++ qmailanalog/zsenders.sh 2007-04-30 20:57:24.000000000 +0200 |
|
912 |
+@@ -10,4 +10,4 @@ |
|
913 |
+ * xdelay is the total xdelay incurred by this sender. |
|
914 |
+ ' |
|
915 |
+ ( echo mess bytes sbytes rbytes recips tries xdelay sender |
|
916 |
+-HOME/bin/senders | sort -n +7 ) | HOME/bin/columnt |
|
917 |
++HOME/bin/senders | sort -k7,7n ) | HOME/bin/columnt |
|
918 |
+diff -x .svn -Naur qmailanalog-0.70/zsuccesses.sh qmailanalog/zsuccesses.sh |
|
919 |
+--- qmailanalog-0.70/zsuccesses.sh 1998-08-30 23:39:27.000000000 +0200 |
|
920 |
++++ qmailanalog/zsuccesses.sh 2007-04-30 20:57:24.000000000 +0200 |
|
921 |
+@@ -5,4 +5,4 @@ |
|
922 |
+ * xdelay is the total xdelay on those deliveries. |
|
923 |
+ ' |
|
924 |
+ ( echo del xdelay reason |
|
925 |
+-HOME/bin/successes | sort +2 ) | HOME/bin/columnt | tr _ ' ' |
|
926 |
++HOME/bin/successes | sort -k2 ) | HOME/bin/columnt | tr _ ' ' |
|
927 |
+diff -x .svn -Naur qmailanalog-0.70/zsuids.sh qmailanalog/zsuids.sh |
|
928 |
+--- qmailanalog-0.70/zsuids.sh 1998-08-30 23:39:27.000000000 +0200 |
|
929 |
++++ qmailanalog/zsuids.sh 2007-04-30 20:57:24.000000000 +0200 |
|
930 |
+@@ -10,4 +10,4 @@ |
|
931 |
+ * xdelay is the total xdelay incurred by this uid. |
|
932 |
+ ' |
|
933 |
+ ( echo mess bytes sbytes rbytes recips tries xdelay uid |
|
934 |
+-HOME/bin/suids | sort -n +7 ) | HOME/bin/columnt |
|
935 |
++HOME/bin/suids | sort -k7,7n ) | HOME/bin/columnt |