25b4fd277dd1d0049ca1aa49076c1695d5a6f7d2
[sgt/agedu] / TODO
1 TODO list for agedu
2 ===================
3
4 Before it's non-embarrassingly releasable:
5
6 - work out what to do about atimes on directories in the absence of
7 the Linux syscall magic
8 * one option is to read them during the scan and reinstate them
9 after each recursion pop. Race-condition prone.
10 * marking them in a distinctive colour in the reports is another
11 option.
12 * a third option is simply to ignore space taken up by
13 directories in the first place; inaccurate but terribly simple.
14 * incidentally, sometimes open(...,O_NOATIME) will fail, and
15 then we have to fall back to ordinary open. Be prepared to do
16 this, which probably means getting rid of the icky macro
17 hackery in du.c and turning it into a more sensible run-time
18 abstraction layer.
19
20 - cross-Unix portability:
21 + use autoconf
22 * configure use of stat64
23 * configure use of /proc/net/tcp
24 * configure use of /dev/random
25 * configure use of Linux syscall magic replacing readdir
26 + later glibcs have fdopendir, hooray! So we can use that
27 too, if it's available and O_NOATIME is too.
28 * what do we do elsewhere about _GNU_SOURCE?
29
30 - man page, --version.
31
32 Future possibilities:
33
34 - IPv6 support in the HTTP server
35 * of course, Linux magic auth can still work in this context; we
36 merely have to be prepared to open one of /proc/net/tcp or
37 /proc/net/tcp6 as appropriate.
38
39 - run-time configuration in the HTTP server
40 * I think this probably works by having a configuration form, or
41 a link pointing to one, somewhere on the report page. If you
42 want to reconfigure anything, you fill in and submit the form;
43 the web server receives HTTP GET with parameters and a
44 referer, adjusts its internal configuration, and returns an
45 HTTP redirect back to the referring page - which it then
46 re-renders in accordance with the change.
47 * All the same options should have their starting states
48 configurable on the command line too.
49
50 - curses-ish equivalent of the web output
51 + try using xterm 256-colour mode. Can (n)curses handle that? If
52 not, try doing it manually.
53 + I think my current best idea is to bypass ncurses and go
54 straight to terminfo: generate lines of attribute-interleaved
55 text and display them, so we only really need the sequences
56 "go here and display stuff", "scroll up", "scroll down".
57 + I think the attribute-interleaved text might be possible to do
58 cunningly, as well: we autodetect a basically VT-style
59 terminal, and add 256-colour sequences on the end. So, for
60 instance, we might set ANSI-yellow foreground, set ANSI-red
61 background, _then_ set both foreground and background to the
62 appropriate xterm 256-colour, and then display some
63 appropriate character which would have given the right blend
64 of the ANSI-16 fore and background colours. Then the same
65 display code should gracefully degrade in the face of a
66 terminal which doesn't support xterm-256.
67 * current best plan is to simulate the xterm-256 shading from
68 0/5 to 5/5 by doing space, colon and hash in colour A on
69 colour B background, then hash, colon and space in B on A
70 background.
71 + Infrastructure work before doing any of this would be to split
72 html.c into two: one part to prepare an abstract data
73 structure describing an HTML-like report (in particular, all
74 the index lookups, percentage calculation, vector arithmetic
75 and line sorting), and another part to generate the literal
76 HTML. Then the former can be reused to produce very similar
77 reports in coloured plain text.
78
79 - http://msdn.microsoft.com/en-us/library/ms724290.aspx suggest
80 modern Windowses support atime-equivalents, so a Windows port is
81 possible in principle.
82 + For a full Windows port, would need to modify the current
83 structure a lot, to abstract away (at least) memory-mapping of
84 files, details of disk scan procedure, networking for httpd.
85 Unclear what the right UI would be on Windows, too;
86 command-line exactly as now might be considered just a
87 _little_ unfriendly. Or perhaps not.
88 + Alternatively, a much easier approach would be to write a
89 Windows version of just the --scan-dump mode, which does a
90 filesystem scan via the Windows API and generates a valid
91 agedu dump file on standard output. Then one would simply feed
92 that over the network connection of one's choice to the rest
93 of agedu running on Unix as usual.