summaryrefslogtreecommitdiff
path: root/mail/faces/patches/patch-ab
blob: 1ad4af42e73ac11c2a68ce9e49ca1fd824f652a6 (plain)
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
$NetBSD: patch-ab,v 1.2 1998/08/07 11:09:35 agc Exp $

*** compface/Makefile.orig	Thu Oct 24 11:28:06 1991
--- compface/Makefile	Sat May 17 23:23:52 1997
***************
*** 19,80 ****
  #
  #SYSV           = -DSYSV32
  #--------------------------------------------------------------------------
! # BINDIR, LIBDIR, and MANDIR are expected to be overridden by the
  # calling Makefile
  
  BINDIR		= /usr/local/bin
  LIBDIR		= /usr/local/lib
! MANDIR		= /usr/manl
  
  NAME		= compface
  UNNAME		= uncompface
  EXECUTABLE	= $(BINDIR)/$(NAME)
  UNEXECUTABLE	= $(BINDIR)/$(UNNAME)
  LIBNAME		= lib$(NAME).a
! LIBRARY		= $(LIBDIR)/$(LIBNAME)
  MAN1DIR		= $(MANDIR)/man1
  MAN3DIR		= $(MANDIR)/man3
  OBJECTS		= arith.o file.o compress.o gen.o uncompface.o
  SOURCES		= compface.c uncompface.o arith.c file.c compress.c gen.c \
  		  cmain.c uncmain.c
  HDRS		= compface.h data.h
  OTHERS		= README $(NAME).1 $(NAME).3 Makefile
  
  CC		= cc
  CDEFS		= $(SYSV)
! CCOMP		= -g
  CFLAGS		= $(CDEFS) $(CCOMP)
  
! all:		$(NAME) $(UNNAME)
  
! $(NAME) :	cmain.o compface.o $(LIBNAME)
! 		$(CC) $(CFLAGS) -o $(NAME) cmain.o compface.o $(LIBNAME)
  
  $(UNNAME) :	uncmain.o $(LIBNAME)
! 		$(CC) $(CFLAGS) -o $(UNNAME) uncmain.o $(LIBNAME)
! 
! $(LIBNAME) :	$(OBJECTS)
! 		ar rc $(LIBNAME) $(OBJECTS)
! 		-ranlib $(LIBNAME)
  
  lint :
  		lint -abchx $(SOURCES)
  
  clean :
! 		rm -f *.o *.a *.sh core a.out $(NAME) $(UNNAME)
  
  install :	$(NAME) $(UNNAME) $(LIBNAME)
! 		-cp $(NAME) $(EXECUTABLE)
! 		strip $(EXECUTABLE)
! 		-cp $(UNNAME) $(UNEXECUTABLE)
! 		strip $(UNEXECUTABLE)
! 		-cp $(NAME).1 $(MAN1DIR)
! 		rm -f $(MAN1DIR)/$(UNNAME).1
! 		-ln $(MAN1DIR)/$(NAME).1 $(MAN1DIR)/$(UNNAME).1
! 		-cp $(LIBNAME) $(LIBRARY)
! 		-cp $(NAME).3 $(MAN3DIR)
! 		rm -f $(MAN3DIR)/$(UNNAME).3
! 		-ln $(MAN3DIR)/$(NAME).3 $(MAN3DIR)/$(UNNAME).3
  
  shar :
  		shar.script $(OTHERS) $(HDRS) $(SOURCES) > $(NAME).sh
--- 19,82 ----
  #
  #SYSV           = -DSYSV32
  #--------------------------------------------------------------------------
! # BINDIR, LIBDIR, INCDIR and MANDIR are expected to be overridden by the
  # calling Makefile
  
  BINDIR		= /usr/local/bin
  LIBDIR		= /usr/local/lib
! INCDIR		= /usr/local/include
! MANDIR		= /usr/local/man
  
  NAME		= compface
  UNNAME		= uncompface
  EXECUTABLE	= $(BINDIR)/$(NAME)
  UNEXECUTABLE	= $(BINDIR)/$(UNNAME)
  LIBNAME		= lib$(NAME).a
! SHLIB_MAJOR	= 1
! SHLIB_MINOR	= 0
! LIB		= $(NAME)
! NOPROFILE	= ''
! LIBRARY		= $(LIBDIR)
  MAN1DIR		= $(MANDIR)/man1
  MAN3DIR		= $(MANDIR)/man3
  OBJECTS		= arith.o file.o compress.o gen.o uncompface.o
  SOURCES		= compface.c uncompface.o arith.c file.c compress.c gen.c \
  		  cmain.c uncmain.c
+ SRCS		= arith.c file.c compress.c gen.c uncompface.c
  HDRS		= compface.h data.h
  OTHERS		= README $(NAME).1 $(NAME).3 Makefile
  
  CC		= cc
  CDEFS		= $(SYSV)
! CCOMP		= -pipe -O2
  CFLAGS		= $(CDEFS) $(CCOMP)
  
! all:		lib$(NAME).a lib$(NAME).so.$(SHLIB_MAJOR).$(SHLIB_MINOR) $(NAME) $(UNNAME) 
  
! $(NAME) :	cmain.o compface.o
! 		$(CC) $(CFLAGS) -o $(NAME) cmain.o compface.o -L./ -lcompface
  
  $(UNNAME) :	uncmain.o $(LIBNAME)
! 		$(CC) $(CFLAGS) -o $(UNNAME) uncmain.o -L./ -lcompface
  
  lint :
  		lint -abchx $(SOURCES)
  
  clean :
! 		rm -f *.o *po *so *.a *.so.* *.sh core a.out $(NAME) $(UNNAME)
  
  install :	$(NAME) $(UNNAME) $(LIBNAME)
! 		install -c -s -o bin -m 755 $(NAME) $(EXECUTABLE)
! 		install -c -s -o bin -m 755 $(UNNAME) $(UNEXECUTABLE)
! 		install -c -g bin -o bin -m 444 $(NAME).1 $(MAN1DIR)
! 		-rm -f $(MAN1DIR)/$(UNNAME).1*
! 		ln -fs $(MAN1DIR)/$(NAME).1 $(MAN1DIR)/$(UNNAME).1
! 		install -c -o bin -m 444 $(LIBNAME) $(LIBRARY)
! 		install -c -o bin -m 444 lib$(NAME).so.$(SHLIB_MAJOR).$(SHLIB_MINOR) $(LIBRARY)
! 		install -c -g bin -o bin -m 444 $(NAME).3 $(MAN3DIR)
! 		rm -f $(MAN3DIR)/$(UNNAME).3*
! 		ln -fs $(MAN3DIR)/$(NAME).3 $(MAN3DIR)/$(UNNAME).3
! 		install -m 444 -o bin -g bin -c compface.h $(INCDIR)
  
  shar :
  		shar.script $(OTHERS) $(HDRS) $(SOURCES) > $(NAME).sh
***************
*** 88,90 ****
--- 90,94 ----
  gen.o:		gen.c compface.h data.h
  uncmain.o:	uncmain.c compface.h data.h
  uncompface.o:	uncompface.c compface.h data.h
+ 
+ .include <bsd.lib.mk>
diff -c -N ../faces/compface/compface.1 ./compface/compface.1
*** ../faces/compface/compface.1	Fri Mar 15 06:10:29 1991
--- ./compface/compface.1	Tue Dec 10 17:28:10 1996
***************
*** 12,17 ****
--- 12,19 ----
  .LP
  .B uncompface
  [
+ .B \-X
+ ] [
  .I infile
  [
  .I outfile
***************
*** 25,31 ****
  face image files.
  .I uncompface
  is an inverse filter which performs an inverse transformation with no
! loss of data.
  The algorithm used is highly tuned for its purpose and achieves better
  than a five to one compression ratio on average.
  Arguments operate identically for both programmes.
--- 27,33 ----
  face image files.
  .I uncompface
  is an inverse filter which performs an inverse transformation with no
! loss of data. 
  The algorithm used is highly tuned for its purpose and achieves better
  than a five to one compression ratio on average.
  Arguments operate identically for both programmes.
***************
*** 56,61 ****
--- 58,69 ----
  .I compface
  averages less than 200 characters.
  The average number of output lines is three.
+ .SH OPTIONS
+ .TP 12
+ .B \-X
+ The same as
+ .I uncompface
+ | ikon2xbm. Usefull for exmh!
  .SH DIAGNOSTICS
  Exit status is normally 0.
  Possible errors include IO errors when opening, reading or writing
diff -c -N ../faces/compface/file.c ./compface/file.c
*** ../faces/compface/file.c	Wed Jun 19 08:29:13 1991
--- ./compface/file.c	Wed Dec 11 09:25:17 1996
***************
*** 15,20 ****
--- 15,22 ----
  
  #include "compface.h"
  
+ int xbitmap=0;
+ 
  void
  BigRead(fbuf)
  register char *fbuf;
***************
*** 127,136 ****
--- 129,147 ----
  {
  	register char *s, *t;
  	register int i, bits, digits, words;
+ 	extern int xbitmap;
+ 	int digsperword = DIGSPERWORD;
+ 	int wordsperline = WORDSPERLINE;
  
  	s = F;
  	t = fbuf;
  	bits = digits = words = i = 0;
+ 	if (xbitmap) {
+ 		sprintf(t,"#define noname_width 48\n#define noname_height 48\nstatic char noname_bits[] = {\n ");
+ 		while (*t) t++;
+ 		digsperword = 2;
+ 		wordsperline = 15;
+ 	}
  	while (s < F + PIXELS)
  	{
  		if ((bits == 0) && (digits == 0))
***************
*** 138,162 ****
  			*(t++) = '0';
  			*(t++) = 'x';
  		}
! 		if (*(s++))
! 			i = i * 2 + 1;
! 		else
! 			i *= 2;
  		if (++bits == BITSPERDIG)
  		{
! 			*(t++) = *(i + HexDigits);
  			bits = i = 0;
! 			if (++digits == DIGSPERWORD)
  			{
  				*(t++) = ',';
  				digits = 0;
! 				if (++words == WORDSPERLINE)
  				{
  					*(t++) = '\n';
  					words = 0;
  				}
  			}
  		}
  	}
  	*(t++) = '\0';
  }
--- 149,191 ----
  			*(t++) = '0';
  			*(t++) = 'x';
  		}
! 		if (xbitmap) {
! 			if (*(s++))
! 				i = (i >> 1) | 0x8;
! 			else
! 				i >>= 1;
! 		}
! 		else {
! 			if (*(s++))
! 				i = i * 2 + 1;
! 			else
! 				i *= 2;
! 		}
  		if (++bits == BITSPERDIG)
  		{
! 			if (xbitmap) {
! 				t++;
! 				t[-(digits & 1) * 2] = *(i + HexDigits);
! 			}
! 			else *(t++) = *(i + HexDigits);
  			bits = i = 0;
! 			if (++digits == digsperword)
  			{
+ 				if (xbitmap && (s >= F + PIXELS)) break;
  				*(t++) = ',';
  				digits = 0;
! 				if (++words == wordsperline)
  				{
  					*(t++) = '\n';
+ 					if (xbitmap) *(t++) = ' ';
  					words = 0;
  				}
  			}
  		}
+ 	}
+ 	if (xbitmap) {
+ 		sprintf(t, "}\n");
+ 		while (*t) t++;
  	}
  	*(t++) = '\0';
  }
diff -c -N ../faces/compface/uncmain.c ./compface/uncmain.c
*** ../faces/compface/uncmain.c	Thu Oct 24 03:28:07 1991
--- ./compface/uncmain.c	Wed Dec 11 09:27:47 1996
***************
*** 18,23 ****
--- 18,25 ----
  #include <fcntl.h>
  #include "compface.h"
  
+ extern int xbitmap;
+ 
  /* the buffer is longer than needed to handle sparse input formats */
  #define FACEBUFLEN 2048
  char fbuf[FACEBUFLEN];
***************
*** 59,64 ****
--- 61,73 ----
    while (**argv)
      if (*((*argv)++) == '/')
        cmdname = *argv;               /* find the command's basename */
+ 
+   if (argc > 1 && !strcmp(argv[1], "-X"))
+     {
+       xbitmap++;
+       argc--;
+       argv++;
+     }
  
    if (argc > 3)
      {