Mark the bulb module as internal
This commit is contained in:
parent
da0032b531
commit
017983d672
@ -1,8 +1,8 @@
|
|||||||
use bulb;
|
|
||||||
use errors;
|
use errors;
|
||||||
use fmt;
|
use fmt;
|
||||||
use fs;
|
use fs;
|
||||||
use getopt;
|
use getopt;
|
||||||
|
use internal::bulb;
|
||||||
use io;
|
use io;
|
||||||
use os;
|
use os;
|
||||||
use path;
|
use path;
|
||||||
|
@ -6,6 +6,17 @@ use os;
|
|||||||
use path;
|
use path;
|
||||||
use strings;
|
use strings;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
// two issues:
|
||||||
|
// A: posts are stored exactly as they are formatted
|
||||||
|
// B: posts need to be sanitized from control chars going in and going out
|
||||||
|
// C: specifying a number of posts to read only works with lines because it
|
||||||
|
// cant separate out the individual posts
|
||||||
|
//
|
||||||
|
// all of these can be fixed by escaping line breaks as the post is written to
|
||||||
|
// the board, and then rendering them once they get to the reading stage.
|
||||||
|
// sanitize the text at both stages.
|
||||||
|
|
||||||
let bulb_path: []str = [];
|
let bulb_path: []str = [];
|
||||||
@init fn bulb_path() void = bulb_path = strings::split(os::tryenv("BULBPATH", "/var/bulb"), ":");
|
@init fn bulb_path() void = bulb_path = strings::split(os::tryenv("BULBPATH", "/var/bulb"), ":");
|
||||||
@fini fn bulb_path() void = free(bulb_path);
|
@fini fn bulb_path() void = free(bulb_path);
|
||||||
@ -29,6 +40,7 @@ export fn read(output: io::handle, board: str, number: int) (void | error) = {
|
|||||||
// we add 1 to account for the blank line that will always be at the
|
// we add 1 to account for the blank line that will always be at the
|
||||||
// bottom
|
// bottom
|
||||||
seek_to_nth_last_line(file, number + 1)?;
|
seek_to_nth_last_line(file, number + 1)?;
|
||||||
|
// TODO don't copy control characters!
|
||||||
io::copy(output, file)?;
|
io::copy(output, file)?;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user