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.
Pavel Charvat [Thu, 20 Apr 2006 06:58:00 +0000 (08:58 +0200)]
Removed previously added parameter {KMP,HASH}_PARAM_POOL from
hashtable and KMP... it is not really necessary.
Added full support for non-integer character types and custom
allocation routines to KMP.
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.
Martin Mares [Fri, 20 Jan 2006 19:47:21 +0000 (19:47 +0000)]
It seems that signal safety of time-related functions is even more subtle
than I thought -- strftime() and localtime_r() can deadlock each other,
probably due to access to time zone information. Replaced strftime() by
a mere sprintf.
Martin Mares [Mon, 16 Jan 2006 20:02:42 +0000 (20:02 +0000)]
xfree() macro has been turned into a regular function. This is much cleaner,
allows for easy memory allocation tracking and also avoids including
<stdlib.h> at random places.