Martin Mares [Fri, 28 Apr 2006 22:12:57 +0000 (00:12 +0200)]
Introduced a configuration post-processor sherlock/autoconf.cfg, which
works similarly to lib/autoconf.cfg, but generates settings specific
to Sherlock.
CONFIG_GATHERER and CONFIG_ANALYSER are now automatically decided upon,
but they still can be overridden manually or set by the custom config file.
Robert Spalek [Tue, 25 Apr 2006 20:25:27 +0000 (22:25 +0200)]
conf2: add basic type CT_LOOKUP that maps strings to integers
Since I need to store both type==CT_LOOKUP and a pointer to the lookup
table, I moved the type out the union. However, I have not blown up the
size of struct cf_item, because I have compressed class and type to 16
bits.
Martin Mares [Mon, 24 Apr 2006 21:49:55 +0000 (23:49 +0200)]
bopen_safe() in conf2 was leaking file descriptors. I've replaced it
by a new bopen_try() in the fastbuf library and also cleaned up error
messages on unsuccessful file opens.
Robert Spalek [Sun, 23 Apr 2006 19:41:18 +0000 (21:41 +0200)]
lib: revert unwanted commit
damn, I tried to just delete one unwanted file from the list when
editing the commit-log, but cogito ignored the deletion and committed the
file anyway. rollback then.
Robert Spalek [Sun, 23 Apr 2006 19:13:08 +0000 (21:13 +0200)]
conf2: tested a few more test-cases and fixed/polished the code
- journal blocks are "transactions", don't overload the word "sections" too much
- added 2 long-term TODO's and 1 short-term FIXME
- the include command must be the last one on a line
Robert Spalek [Sun, 23 Apr 2006 00:13:05 +0000 (02:13 +0200)]
conf2: removed handling of dirty pages
2 XXX's and 1 FIXME deleted by just omitting the whole functionality and
commiting _all_ pages after each reload. it should not cost much more than
a bit of memory.
Robert Spalek [Sun, 23 Apr 2006 00:09:32 +0000 (02:09 +0200)]
conf2: debugged a lot
- closing_brace() confused current operation with the one on the stack a lot
- get_word() fix when recognizing = in the parameter name
- split_line() totally rewritten to 2 nice procedures: get_token() and
split_command()
- #include back to include, otherwise it would be a comment
- local fastbufs in parse_fastbuf()
Robert Spalek [Fri, 21 Apr 2006 17:44:13 +0000 (19:44 +0200)]
conf2: bugfix in editing and adding before/after a node of a link list
interpret_add_list() allocates memory himself, hence it is not suitable for
these operations. since the real code is only 2 lines long, I moved the
functionality to closing_brace(). I changed its interface too, hence it
can be used much simpler and interpret_line() can be returned to its
original form.
Robert Spalek [Fri, 21 Apr 2006 16:20:38 +0000 (18:20 +0200)]
conf2: implemented all list operations in the interpreter
- added operations OP_EDIT, OP_AFTER, OP_BEFORE, and flags OP_1ST, OP_2ND
denoting the phase (forming a search query vs. filling in the data)
- add_to_list() extended to support all list operations
- definition of stack moved closer to the interpreter, because many
functions don't need it
- implemented find_list_node(), opening_brace (former increase_stack), and
closing_brace() that fully support all operations
- the top of interpret_line() rewritten too
Robert Spalek [Fri, 21 Apr 2006 12:45:26 +0000 (14:45 +0200)]
conf2: record used selectors when searching in lists
- store number of entries to section flags
- find_item() fixed so that it correctly handles accesses to unknown
top-level sections. also setting an absolute attribute (i.e. not
relative to the current section) starts with a caret now.
- added an u32 mask to the stack and record_selector() that fills it
Robert Spalek [Fri, 21 Apr 2006 10:40:57 +0000 (12:40 +0200)]
conf2: resolve an issue concerning variable numbers of parameters
When a node of a link list is parsed on one line, then the inner section
is checked for dynamic attributes at the end. If they are present, the
outer node is just parsed once and the flag allowing dynamic parsing is
passed inside. If we did not allow this, then an error would have occured
anyway, and this behaviour is actually useful.
Along the way, I unified the headers and semantics of most interpreters and
cleaned up the code.
Robert Spalek [Fri, 21 Apr 2006 09:26:24 +0000 (11:26 +0200)]
conf2: enhanced the interpreter so that it can parse almost anything on 1 line
I cleaned up the subroutines so that they form a nice recursive structure
that allows to parse almost anything (static and dynamic arrays, lists,
parsed value, and sections in all combinations) on 1 line, while detecting
ambiguities.