]> pere.pagekite.me Git - homepage.git/blob - linux/html2rtf-1.0-unix.diff
Generated.
[homepage.git] / linux / html2rtf-1.0-unix.diff
1 Only in src-1.0-sgi4irix6: .gdb_history
2 diff -ru src-1.0/codegen.c src-1.0-sgi4irix6/codegen.c
3 --- src-1.0/codegen.c Tue May 28 09:21:20 1996
4 +++ src-1.0-sgi4irix6/codegen.c Thu Apr 3 20:51:21 1997
5 @@ -7,7 +7,11 @@
6
7 #include<string.h>
8 #include<stdio.h>
9 +#ifndef unix
10 #include<dos.h>
11 +#else
12 +#include <stdlib.h>
13 +#endif
14 #include"codegen.h"
15 #include"defs.h"
16 #include"fileio.h"
17 Only in src-1.0-sgi4irix6: codegen.o
18 diff -ru src-1.0/defs.h src-1.0-sgi4irix6/defs.h
19 --- src-1.0/defs.h Tue May 28 09:44:10 1996
20 +++ src-1.0-sgi4irix6/defs.h Thu Apr 3 21:03:22 1997
21 @@ -8,6 +8,8 @@
22 #ifndef _defs_h_
23 #define _defs_h_
24
25 +#define SIZEDEF_FILE "/store/lib/html2rtf/sizes.def"
26 +
27 /*Symbole fuer eine Auswahl von Elementsymbolen aus einem HTML-Text*/
28 enum symbol{ HTML_SYM, /*Anfangs Symbole*/
29 HEAD_SYM,
30 Only in src-1.0-sgi4irix6: defs.o
31 diff -ru src-1.0/error.c src-1.0-sgi4irix6/error.c
32 --- src-1.0/error.c Tue Apr 16 12:31:28 1996
33 +++ src-1.0-sgi4irix6/error.c Thu Apr 3 21:12:18 1997
34 @@ -5,6 +5,7 @@
35 Funktion : Funktionen zur Fehler- und Warnungsbehandlung
36 */
37 #include<stdlib.h>
38 +#include <stdio.h>
39 #include"error.h"
40 #include"fileio.h"
41
42 Only in src-1.0-sgi4irix6: error.o
43 diff -ru src-1.0/fileio.c src-1.0-sgi4irix6/fileio.c
44 --- src-1.0/fileio.c Thu Apr 18 17:09:22 1996
45 +++ src-1.0-sgi4irix6/fileio.c Thu Apr 3 20:47:36 1997
46 @@ -52,7 +52,7 @@
47 }
48 }
49
50 -char lies(void)
51 +int lies(void)
52 /*
53 Rueckgabewert: char-Wert des naechsten Zeichens.
54 Funktion: Aus der Quelldatei FpI wird ein Zeichen gelesen und die
55 @@ -60,7 +60,7 @@
56 Vorbedingungen: Es muss ueber den Pointer FpI auf den Quelltext
57 zugegriffen werden koennen.
58 */
59 -{ char c=getc(FpI);
60 +{ int c=getc(FpI);
61 Spalte++;
62 if(c=='\n'){
63 Zeile++;
64 diff -ru src-1.0/fileio.h src-1.0-sgi4irix6/fileio.h
65 --- src-1.0/fileio.h Thu Apr 18 10:34:56 1996
66 +++ src-1.0-sgi4irix6/fileio.h Thu Apr 3 20:47:44 1997
67 @@ -10,7 +10,7 @@
68
69 void openInput (char *);
70 void closeInput (void);
71 -char lies (void);
72 +int lies (void);
73 void actPos (unsigned *, unsigned *);
74 void openOutput (char *);
75 void closeOutput(void);
76 Only in src-1.0-sgi4irix6: fileio.o
77 diff -ru src-1.0/ftext.c src-1.0-sgi4irix6/ftext.c
78 --- src-1.0/ftext.c Tue Apr 23 09:36:40 1996
79 +++ src-1.0-sgi4irix6/ftext.c Thu Apr 3 20:53:08 1997
80 @@ -8,6 +8,9 @@
81
82 #include<stdio.h>
83 #include<stdlib.h>
84 +#ifdef unix
85 +#include <string.h>
86 +#endif
87 #include"ftext.h"
88 #include"defs.h"
89
90 Only in src-1.0-sgi4irix6: ftext.o
91 diff -ru src-1.0/links.c src-1.0-sgi4irix6/links.c
92 --- src-1.0/links.c Tue Apr 16 12:31:28 1996
93 +++ src-1.0-sgi4irix6/links.c Thu Apr 3 21:09:23 1997
94 @@ -6,7 +6,12 @@
95 */
96
97 #include<string.h>
98 +#ifndef unix
99 #include<io.h>
100 +#else
101 +#include <ctype.h>
102 +#include <unistd.h>
103 +#endif
104 #include"links.h"
105
106 extern char path[256];
107 Only in src-1.0-sgi4irix6: links.o
108 diff -ru src-1.0/main.c src-1.0-sgi4irix6/main.c
109 --- src-1.0/main.c Thu May 30 11:09:00 1996
110 +++ src-1.0-sgi4irix6/main.c Thu Apr 3 21:11:44 1997
111 @@ -5,7 +5,11 @@
112 Funktion : Hauptprogramm
113 */
114
115 +#ifndef unix
116 #include<dos.h>
117 +#else
118 +#include <unistd.h>
119 +#endif
120 #include<stdlib.h>
121 #include<string.h>
122 #include<stdio.h>
123 @@ -37,10 +41,14 @@
124 struct element elementDaten;
125 enum symbol symbol;
126 unsigned int warnings, errors;
127 +#ifndef unix
128 struct time zeit1, zeit2;
129 +#endif
130 int i, printDefaults;
131
132 +#ifndef unix
133 gettime(&zeit1);
134 +#endif
135 elementDaten.parameterPtr=NULL;
136 puts("HTML-to-RTF Compiler 0.9, Robin Gressmann 1996");
137
138 @@ -56,7 +64,7 @@
139 split(nameI, path, name);
140 creat_HPJ_Name(nameHPJ, name);
141 creat_RTF_Name(nameRTF, name);
142 - strcpy(nameDEF, "sizes.def");
143 + strcpy(nameDEF, SIZEDEF_FILE);
144 strcpy(nameWindow, "Manual");
145 strcpy(HeadLabel, "top_of_file_label");
146 printDefaults=0;
147 @@ -105,9 +113,13 @@
148 fileError("found a write-protected HPJ-file");
149 }
150 value_of_WarningsErrors(&warnings, &errors);
151 +#ifndef unix
152 gettime(&zeit2);
153 +#endif
154
155 +#ifndef unix
156 printf("\ntime in use : %.2f sec", diffTime(zeit1, zeit2));
157 +#endif
158 printf("\nWarnings : %u", warnings);
159 printf("\nErrors : %u", errors);
160 printf("\nDEF-File : %s", nameDEF);
161 @@ -116,6 +128,7 @@
162 printf("\nProjekt-File: %s", nameHPJ);
163 printf("\nPath : %s", path);
164 printf("\nName : %s\n\n", name);
165 + return 0;
166 }
167
168 void check(char *nameI)
169 @@ -205,12 +218,14 @@
170 void insert_in_HPJ_file(char *HPJ, char *RTF)
171 { FILE *fp;
172 char zeile[50], zeichen[2];
173 + int tmp = 0;
174 int in=0;
175 zeichen[1]=zeile[0]='\0';
176 if((fp=fopen(HPJ, "r+"))==NULL){
177 fileError("can not create projekt file");
178 }
179 - while((zeichen[0]=getc(fp))!=EOF){
180 + while((tmp = getc(fp))!=EOF){
181 + zeichen[0] = (char)tmp;
182 if(zeichen[0]=='\n'){
183 if(!stricmp(zeile,RTF)){
184 in=1;
185 Only in src-1.0-sgi4irix6: main.o
186 diff -ru src-1.0/makefile src-1.0-sgi4irix6/makefile
187 --- src-1.0/makefile Thu May 30 11:09:36 1996
188 +++ src-1.0-sgi4irix6/makefile Thu Apr 3 21:29:42 1997
189 @@ -1,42 +1,43 @@
190 -para=-O2 -fomit-frame-pointer -funroll-all-loops
191 +CC=gcc
192 +CFLAGS=-Wall -O2 -fomit-frame-pointer -funroll-all-loops
193
194 html2rtf.exe : main.o scanner.o error.o codegen.o parser.o sizes.o utils.o links.o fileio.o defs.o ftext.o
195 - gcc *.o -lm
196 + $(CC) *.o -lm
197 mkexe.bat html2rtf
198 copy html2rtf.exe c:\a\bin
199
200 main.o : main.c main.h utils.h parser.h defs.h sizes.h fileio.h
201 - gcc $(para) -c main.c
202 + $(CC) $(CFLAGS) -c main.c
203
204 scanner.o : scanner.c scanner.h defs.h error.h fileio.h ftext.h
205 - gcc $(para) -c scanner.c
206 + $(CC) $(CFLAGS) -c scanner.c
207
208 defs.o : defs.c defs.h error.h
209 - gcc $(para) -c defs.c
210 + $(CC) $(CFLAGS) -c defs.c
211
212 fileio.o : fileio.c fileio.h defs.h error.h
213 - gcc $(para) -c fileio.c
214 + $(CC) $(CFLAGS) -c fileio.c
215
216 parser.o : parser.c parser.h defs.h error.h scanner.h codegen.h ftext.h
217 - gcc $(para) -c parser.c
218 + $(CC) $(CFLAGS) -c parser.c
219
220 codegen.o : codegen.c codegen.h defs.h links.h fileio.h error.h ftext.h
221 - gcc $(para) -c codegen.c
222 + $(CC) $(CFLAGS) -c codegen.c
223
224 sizes.o : sizes.c sizes.h error.h utils.h
225 - gcc $(para) -c sizes.c
226 + $(CC) $(CFLAGS) -c sizes.c
227
228 error.o : error.c error.h
229 - gcc $(para) -c error.c
230 + $(CC) $(CFLAGS) -c error.c
231
232 utils.o : utils.c utils.h error.h
233 - gcc $(para) -c utils.c
234 + $(CC) $(CFLAGS) -c utils.c
235
236 links.o : links.c links.h
237 - gcc $(para) -c links.c
238 + $(CC) $(CFLAGS) -c links.c
239
240 ftext.o : ftext.c ftext.h defs.h
241 - gcc $(para) -c ftext.c
242 + $(CC) $(CFLAGS) -c ftext.c
243
244 clear :
245 del *.o
246 diff -ru src-1.0/parser.c src-1.0-sgi4irix6/parser.c
247 --- src-1.0/parser.c Tue Apr 30 10:30:24 1996
248 +++ src-1.0-sgi4irix6/parser.c Thu Apr 3 21:12:48 1997
249 @@ -6,8 +6,10 @@
250 HTML-Befehle
251 */
252 #include<stdio.h>
253 +#include <stdlib.h>
254 #include<setjmp.h>
255 #include"parser.h"
256 +#include "fileio.h"
257 #include"defs.h"
258 #include"scanner.h"
259 #include"codegen.h"
260 Only in src-1.0-sgi4irix6: parser.o
261 diff -ru src-1.0/scanner.c src-1.0-sgi4irix6/scanner.c
262 --- src-1.0/scanner.c Thu Apr 18 16:09:58 1996
263 +++ src-1.0-sgi4irix6/scanner.c Thu Apr 3 21:06:35 1997
264 @@ -8,7 +8,11 @@
265 #include<stdio.h>
266 #include<string.h>
267 #include<stdlib.h>
268 +#ifndef unix
269 #include<dos.h>
270 +#else
271 +#include <ctype.h>
272 +#endif
273 #include"defs.h"
274 #include"scanner.h"
275 #include"error.h"
276 @@ -28,7 +32,7 @@
277 Anfangssymbol '--'.
278 Nachbedingingen: FpI zeigt genau hinter das Kommentarendesymbol --'.
279 */
280 -{ char c;
281 +{ int c;
282 while ((c=lies())!=EOF){
283 if(c=='-'){
284 if(lies()=='-'){
285 @@ -48,7 +52,7 @@
286 Anfangssymbol '<!'.
287 Nachbedingingen: FpI zeigt genau hinter das Definitionssymbol '>'.
288 */
289 -{ char c;
290 +{ int c;
291 while ((c=lies())!=EOF){
292 if(c=='>'){
293 return;
294 @@ -64,7 +68,7 @@
295 Datei dann wieder vor dieses Zeichen.
296 Vorbedingungen: FpI muss auf eine Datei mit Lesezugriff zeigen.
297 */
298 -{ char c;
299 +{ int c;
300 long pos;
301 do{
302 pos=ftell(FpI);
303 @@ -298,8 +302,8 @@
304 Funktion: Scanner des Quellcodes (endlicher Automat)
305 */
306 { static unsigned status=1;
307 - char nextc, temp,
308 - elementText[ELEMENT_TYP_MAX],
309 + int nextc, temp;
310 + char elementText[ELEMENT_TYP_MAX],
311 attributNameText[ATTRIBUT_NAME_MAX],
312 attributWertText[ATTRIBUT_WERT_MAX];
313 int textFlag=0, entityFlag=0, symbolFlag=0, gleichFlag=0;
314 Only in src-1.0-sgi4irix6: scanner.o
315 diff -ru src-1.0/sizes.c src-1.0-sgi4irix6/sizes.c
316 --- src-1.0/sizes.c Thu Apr 25 13:03:46 1996
317 +++ src-1.0-sgi4irix6/sizes.c Thu Apr 3 20:52:17 1997
318 @@ -6,7 +6,9 @@
319 */
320 #include<stdio.h>
321 #include<string.h>
322 +#ifndef unix
323 #include<dos.h>
324 +#endif
325 #include"sizes.h"
326 #include"error.h"
327 #include"utils.h"
328 @@ -246,7 +248,7 @@
329 }
330
331 int newLine(char *line)
332 -{ char c;
333 +{ int c;
334 int i=0;
335 while((c=getc(fp))!='\n'&&c!=EOF&&i<MAX_LINE){
336 line[i++]=c;
337 Only in src-1.0-sgi4irix6: sizes.o
338 diff -ru src-1.0/utils.c src-1.0-sgi4irix6/utils.c
339 --- src-1.0/utils.c Tue Apr 16 12:31:28 1996
340 +++ src-1.0-sgi4irix6/utils.c Thu Apr 3 21:26:08 1997
341 @@ -6,7 +6,11 @@
342 */
343 #include<math.h>
344 #include<string.h>
345 +#ifndef unix
346 #include<dos.h>
347 +#else
348 +#include <ctype.h>
349 +#endif
350 #include"utils.h"
351 #include"error.h"
352
353 @@ -54,12 +58,15 @@
354 return 0;
355 }
356
357 +#ifndef unix
358 double diffTime(struct time z1, struct time z2)
359 -{ return fabs(3600*(z2.ti_hour-z1.ti_hour)+
360 +{
361 + return fabs(3600*(z2.ti_hour-z1.ti_hour)+
362 60*(z2.ti_min-z1.ti_min)+
363 (z2.ti_sec-z1.ti_sec)+
364 (double)(z2.ti_hund-z1.ti_hund)/100);
365 }
366 +#endif
367
368 void appendString(char *string, char zeichen, unsigned max)
369 /*
370 @@ -78,4 +85,18 @@
371 }else{
372 fatalError("String buffer overflow!");
373 }
374 +}
375 +
376 +void strlwr(char *str)
377 +{
378 + if (NULL == str)
379 + return;
380 + while (*str != '\0') {
381 + *str=tolower(*str);
382 + str++;
383 + }
384 +}
385 +int stricmp(char *s1, char *s2)
386 +{
387 + return strcasecmp(s1,s2);
388 }
389 diff -ru src-1.0/utils.h src-1.0-sgi4irix6/utils.h
390 --- src-1.0/utils.h Tue Apr 16 12:31:28 1996
391 +++ src-1.0-sgi4irix6/utils.h Thu Apr 3 20:45:27 1997
392 @@ -11,7 +11,14 @@
393
394 void my_itoa(int, char *);
395 int whichValue(char *, char *, struct attribut *);
396 +#ifndef unix
397 double diffTime(struct time, struct time);
398 +#endif
399 void appendString(char *, char, unsigned);
400 +
401 +#ifdef unix
402 +int stricmp(char *, char *);
403 +void strlwr(char *);
404 +#endif
405
406 #endif
407 Only in src-1.0-sgi4irix6: utils.o