View | Details | Raw Unified | Return to bug 7944
Collapse All | Expand All

(-)o3read-0.0.4.old/Makefile (-11 / +9 lines)
Lines 4-35 Link Here
4
4
5
CC = gcc
5
CC = gcc
6
CFLAGS = -Wall -ansi -pedantic -O -g
6
CFLAGS = -Wall -ansi -pedantic -O -g
7
LDFLAGS = -lnatspec
7
PREFIX = /usr/local
8
PREFIX = /usr/local
8
BINDIR = $(PREFIX)/bin
9
BINDIR = $(PREFIX)/bin
9
MANDIR = $(PREFIX)/man/man1
10
MANDIR = $(PREFIX)/share/man/man1
10
DOCS = COPYING INSTALL README TODO ChangeLog filformat.sxw
11
DOCS = COPYING INSTALL README TODO ChangeLog filformat.sxw
11
BINS = o3read o3totxt o3tohtml utf8tolatin1
12
BINS = o3read o3totxt o3tohtml
12
SRCS = o3read.h main.c o3read.c o3totxt.c o3tohtml.c utf8tolatin1.c
13
SRCS = o3read.h main.c o3read.c o3totxt.c o3tohtml.c
13
MANS = o3read.1 o3tohtml.1 o3totxt.1 utf8tolatin1.1
14
MANS = o3read.1 o3tohtml.1 o3totxt.1
14
ARCH=`uname -s`-`uname -m`
15
ARCH=`uname -s`-`uname -m`
15
BINDISTDIR=/usr/local
16
BINDISTDIR=/usr/local
16
17
17
all: $(BINS)
18
all: $(BINS)
18
19
19
utf8tolatin1: utf8tolatin1.o
20
	$(CC) -o utf8tolatin1 utf8tolatin1.o
21
22
o3totxt: o3totxt.o o3read.o
20
o3totxt: o3totxt.o o3read.o
23
	$(CC) -o o3totxt o3totxt.o o3read.o
21
	$(CC) $(LDFLAGS) -o o3totxt o3totxt.o o3read.o
24
22
25
o3tohtml: o3tohtml.o o3read.o
23
o3tohtml: o3tohtml.o o3read.o
26
	$(CC) -o o3tohtml o3tohtml.o o3read.o
24
	$(CC) $(LDFLAGS) -o o3tohtml o3tohtml.o o3read.o
27
25
28
o3tosiag: o3tosiag.o o3read.o
26
o3tosiag: o3tosiag.o o3read.o
29
	$(CC) -o o3tosiag o3tosiag.o o3read.o
27
	$(CC) $(LDFLAGS) -o o3tosiag o3tosiag.o o3read.o
30
28
31
o3read: main.o o3read.o
29
o3read: main.o o3read.o
32
	$(CC) -o o3read main.o o3read.o
30
	$(CC) $(LDFLAGS) -o o3read main.o o3read.o
33
31
34
dist:
32
dist:
35
	rm -rf $(PACKAGE)-$(VERSION)
33
	rm -rf $(PACKAGE)-$(VERSION)
(-)o3read-0.0.4.old/o3read.c (+8 lines)
Lines 21-26 Link Here
21
#include <stdlib.h>
21
#include <stdlib.h>
22
#include <string.h>
22
#include <string.h>
23
#include <ctype.h>
23
#include <ctype.h>
24
#include <natspec.h>
24
25
25
#include "o3read.h"
26
#include "o3read.h"
26
27
Lines 91-96 Link Here
91
	return h;
92
	return h;
92
}
93
}
93
94
95
void putstring(const char *str)
96
{
97
	char *newstr = natspec_convert_with_translit(str, NULL, "UTF-8");
98
	printf(newstr);
99
	free(newstr);
100
}
101
94
static void indent(int i)
102
static void indent(int i)
95
{
103
{
96
	int j;
104
	int j;
(-)o3read-0.0.4.old/o3read.h (+1 lines)
Lines 34-36 Link Here
34
extern void *cmalloc(size_t);
34
extern void *cmalloc(size_t);
35
extern char *cstrdup(const char *);
35
extern char *cstrdup(const char *);
36
extern int cstrncasecmp(const char *, const char *, size_t);
36
extern int cstrncasecmp(const char *, const char *, size_t);
37
extern void putstring(const char *str);
(-)o3read-0.0.4.old/o3tohtml.c (-2 / +6 lines)
Lines 21-26 Link Here
21
#include <stdlib.h>
21
#include <stdlib.h>
22
#include <string.h>
22
#include <string.h>
23
#include <ctype.h>
23
#include <ctype.h>
24
#include <locale.h>
24
25
25
#include "o3read.h"
26
#include "o3read.h"
26
27
Lines 302-307 Link Here
302
*/
303
*/
303
static void text(hnode *h, hstate *s)
304
static void text(hnode *h, hstate *s)
304
{
305
{
306
	putstring(h->text);
307
	/* TODO: Lav: fix later
305
	int i;
308
	int i;
306
	for (i = 0; h->text[i]; i++) {
309
	for (i = 0; h->text[i]; i++) {
307
		switch (h->text[i]) {
310
		switch (h->text[i]) {
Lines 312-320 Link Here
312
			printf("&gt;");
315
			printf("&gt;");
313
			break;
316
			break;
314
		default:
317
		default:
315
			putchar(h->text[i]);
318
			putchar_locale(h->text[i]);
316
		}
319
		}
317
	}
320
	}
321
	*/
318
	/* can't have children */
322
	/* can't have children */
319
	tree(h->next, s);
323
	tree(h->next, s);
320
}
324
}
Lines 340-346 Link Here
340
344
341
	href = 0;
345
	href = 0;
342
	hrefs = NULL;
346
	hrefs = NULL;
343
347
	setlocale(LC_ALL, "");
344
	h = parse_html(nextc, stdin);
348
	h = parse_html(nextc, stdin);
345
	if (h == NULL) usage();
349
	if (h == NULL) usage();
346
350
(-)o3read-0.0.4.old/o3totxt.c (-2 / +6 lines)
Lines 21-26 Link Here
21
#include <stdlib.h>
21
#include <stdlib.h>
22
#include <string.h>
22
#include <string.h>
23
#include <ctype.h>
23
#include <ctype.h>
24
#include <locale.h>
24
25
25
#include "o3read.h"
26
#include "o3read.h"
26
27
Lines 113-121 Link Here
113
static void text(hnode *h, hstate *s)
114
static void text(hnode *h, hstate *s)
114
{
115
{
115
	int i;
116
	int i;
117
	putstring(h->text);
118
	/*
116
	for (i = 0; h->text[i]; i++) {
119
	for (i = 0; h->text[i]; i++) {
117
		putchar(h->text[i]);
120
		putchar_locale(h->text[i]);
118
	}
121
	}
122
	*/
119
	/* can't have children */
123
	/* can't have children */
120
	tree(h->next, s);
124
	tree(h->next, s);
121
}
125
}
Lines 141-147 Link Here
141
145
142
	href = 0;
146
	href = 0;
143
	hrefs = NULL;
147
	hrefs = NULL;
144
148
	setlocale(LC_ALL, "");
145
	h = parse_html(nextc, stdin);
149
	h = parse_html(nextc, stdin);
146
	if (h == NULL) usage();
150
	if (h == NULL) usage();
147
151

Return to bug 7944