[Bug 681] Handlers filenames and syntax versions

Kevin P. Fleming kpfleming at linuxfromscratch.org
Thu Sep 25 09:32:26 PDT 2003

Neven Has wrote:

> I want to start by adding a new string member to element_s (sversion).
> That way, each handler will know to what syntax version it belongs.
> Then I'll integrate all handlers/*, removing new-*.c files.  I think
> that's a good start to clean things a bit, solving the handler naming
> part of the bug?

Here's what I've been thinking... instead of having a single set of 
handler definition variables in the handler object, instead it could 
define an array of definitions (each one being a structure), each with 
a name/version/parameters/etc. combination, and a pointer (or 
pointers) to the function that should be called to process that 
specific combination. Then the nALFS core sees it as a series of 
handlers, even though they all come from the same object file. The 
core can then continue to call the correct one and the handler doesn't 
actually have to have any code to check what version is being requested.

> After that, we need to decide whether to keep sversion as a string, or
> create a structure for a version (.x, .y, .z).  For now, I think the
> string is more flexible, allowing even something like version="LSB",
> for example.  Although that flexibility might not be a good thing in
> this case.  And the issue of comparing the version comes to mind.

I think sticking with strings is probably fine, especially if we can 
keep the version comparisons in the core instead of pushing them into 
the handlers.

More information about the alfs-log mailing list