summaryrefslogtreecommitdiff
path: root/module/man.m
blob: 9d12fe885c0fc8cab41a754f8e881887f8e61b87 (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
Parseman: module {
	PATH: con "/dis/lib/parseman.dis";

	Metrics: adt {
		pagew: int;
		dpi: int;
		em: int;	# size in dots
		en: int;	# size in dots
		V: int;	# font height in dots
		indent: int;
		ssindent: int;
	};

	Text: adt {
		font: int;
		attr: int;
		text: string;
		heading: int;	# heading level
		link: string;
	};

	# Text fonts and attributes
	FONT_ROMAN,
	FONT_ITALIC,
	FONT_BOLD: con iota;
	ATTR_SMALL, ATTR_LAST: con 1 << iota;

	init: fn(): string;
	parseman: fn[T](fd: ref Sys->FD, metrics: Metrics, ql: int, t: T, setline: chan of list of (int, Text))
		for{
		T =>
			textwidth: fn(t: self T, text: Text): int;
		};
};

Man: module {
	PATH: con "/dis/lib/man.dis";

	loadsections: fn(sections: list of string): string;
	getfiles: fn(sections: list of string , keys: list of string): list of (int, string, string);
};