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.
Robert Spalek [Thu, 20 Apr 2006 22:56:54 +0000 (00:56 +0200)]
implemented parser of a single line and top-level sections unified
- we store registered sections in the same format as subsections so that we
can search/process them in a uniform way
- implemented find_item() that can parse both absolute and relative paths
- all parsers of basic types simplified to take care of only 1 value;
arrays are handled by the caller
- implemented a part of the interpretter: it gets parsed line (attribute
name, desired operations, and parameters) and loads the values into
memory. since declarations can be nested and they can span over multiple
lines, the interpretter operates on a stack
Robert Spalek [Thu, 20 Apr 2006 10:50:44 +0000 (12:50 +0200)]
substantially changed the interface again
I realised that in the last interface I couldn't distinguish between static
and dynamic arrays of length exactly 1. thinking about how to resolve the
problem led me to a different solution that is as easy to use as before,
but easier to implement, easier to extend by new basic types, and as a
bonus I get a natural interface for static arrays.
I then immediately scratched a duplicate code for parsing dynamic arrays,
because it can be easily unified now. also, CF_ITEMS does not expect a
parameter now, because they the compiler messes up line numbers when an
error occurs.
Robert Spalek [Wed, 19 Apr 2006 10:02:37 +0000 (12:02 +0200)]
implemented a few functions of the new configuration mechanism:
- memory allocation
- skeleton of future journal functions
- parsers of all basic types and arrays of these types
Robert Spalek [Tue, 18 Apr 2006 12:37:31 +0000 (14:37 +0200)]
significant simplifications of the interface
- instead of letting the user to set cf_section.{size,init,commit}
directly, macros CF_{TYPE,INIT,COMMIT} should be used
- another macro CF_ITEMS creates a CT_END-delimited list of cf_items
- all these macros automatically add commas so that declaring a list of
cf_items behaves similarly to other preprocessor-made lists
- removed parameter name from parser hooks, because either the parser
doesn't care and only uses *ptr, or it does and then it should be set up
to pass the name in ptr
- no need to define hooks using _void_ *ptr; one can use any pointers
according to his taste and the hook-function is automatically retyped
- renamed (to make it shorter) some enumerations and macros
- CHECK_VAR_TYPE and CF_FIELD renamed to CHECK_PTR_TYPE and PTR_TO, and
moved to lib/lib.h
Robert Spalek [Tue, 18 Apr 2006 09:57:57 +0000 (11:57 +0200)]
interface simplified and a few bugs removed
- array macros renamed and extended
- CF_FUNCTION renamed to CF_PARSER, and a number of parameters and a
pointer to the target variable are passed into the parser function
- init-, commit-, and parser-hooks only get parameters that they need and
they get it in a nice way so that they don't have to work much
- fixed CHECK_VAR_TYPE and a few other thingies
Robert Spalek [Mon, 17 Apr 2006 18:15:39 +0000 (20:15 +0200)]
designed the interface of the new configuration reader. no code has been
written yet, because I better wait for an opinion first. a tester app that
currently just checks compilability of all messy cf-declaration macros is
included. don't worry about filenames; they will be eventually renamed.
Martin Mares [Wed, 12 Apr 2006 10:44:51 +0000 (12:44 +0200)]
Cleaned up CONFIG_CENTRUM_xxx switches:
o Everything related to the catalog is controlled by
CONFIG_CENTRUM_CATALOG.
o Paid weights are implied by the catalog and the PL customization,
which doesn't use them, just defines empty {get,set}_paid_weight().
o Nothing depends on CONFIG_CENTRUM_{CZ,SK,PL} now, but I am keeping
them, because it's likely that it will be needed for some exceptions
or experiments again soon.
All customizations compile except for centrum/* with shared libraries,
but the dependencies for that are already fixed in the dev-analyser branch.
Martin Mares [Tue, 11 Apr 2006 08:57:37 +0000 (10:57 +0200)]
Merge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git#v3.8
The image weighting backports in v3.8 have created some conflicts due to
formatting changes, so I have kept the mainline versions everywhere.
Weights were inherited from v3.8 except for IP and CK[WP]A.