xref: /inferno-os/module/man.m (revision 56f3d04553e7fac260932ac4ac7fc826ee0b6b58)
1Parseman: module {
2	PATH: con "/dis/lib/parseman.dis";
3
4	Metrics: adt {
5		pagew: int;
6		dpi: int;
7		em: int;	# size in dots
8		en: int;	# size in dots
9		V: int;	# font height in dots
10		indent: int;
11		ssindent: int;
12	};
13
14	Text: adt {
15		font: int;
16		attr: int;
17		text: string;
18		heading: int;	# heading level
19		link: string;
20	};
21
22	# Text fonts and attributes
23	FONT_ROMAN,
24	FONT_ITALIC,
25	FONT_BOLD: con iota;
26	ATTR_SMALL, ATTR_LAST: con 1 << iota;
27
28	init: fn(): string;
29	parseman: fn[T](fd: ref Sys->FD, metrics: Metrics, ql: int, t: T, setline: chan of list of (int, Text))
30		for{
31		T =>
32			textwidth: fn(t: self T, text: Text): int;
33		};
34};
35
36Man: module {
37	PATH: con "/dis/lib/man.dis";
38
39	loadsections: fn(sections: list of string): string;
40	getfiles: fn(sections: list of string , keys: list of string): list of (int, string, string);
41};
42