[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: backend functions declaration



Pierangelo Masarati wrote:

Exactly.  The proto-<backend>.h is logically local to the backend; the
external.h needs only know the <backend>_initialize() function.  If a
backend were so compact to fit into a single file, all the functions could
be declared static.

Elaborating from Hallvard's idea, I think we could safely speculate on the
backend's availability of a function <backend>_initialize() (this could be
a coding style requirement) and define/use it locally even without
including any backend-specific header.  Then, the function's name and so
could be built from a macro.  But this is secondary, as it may obfuscate
the code.

That all sounds good to me. I'm fine with assuming/requiring a strictly named _initialize() function and eliminating the need for any backend-specific header file. If we can automatically generate the other symbol references, that's even better. E.g., replace the current "static BackendInfo binfo[]" table in backend.c with an array that's generated directly from the configure script and #include'd there.

--
 -- Howard Chu
 Chief Architect, Symas Corp.       Director, Highland Sun
 http://www.symas.com               http://highlandsun.com/hyc
 Symas: Premier OpenSource Development and Support