[Registry] Portability of localkdb
Brought to you by:
aviram
|
From: Markus R. <mai...@gm...> - 2004-10-21 15:27:29
|
There are some ways to make it easy to reimpliment localkdb.
1.) The nicest way would be:
The calls of kdb* do not really do something, they are only wrappers around
pointers to functions. A very intelligent method has to bend the pointer to
the function which should be taken.
Examples: When using the Linuxkernel, you can have different Filesystem types.
There is something I described which map to the systemcalls of the
Filesystem-specific calls.
But, while its clear in Linux what function to be taken (a write on ext2 will
lead to ext2_write), its very very difficult to map this within elektra.
2.) #defines
There are simply #ifndef around all the functions which might be redefined.
When reimplementing a function, you have just to #define the value, and your
function will be taken.
e.g.:
localkdb.c:
#ifndef GENERIC_KDBGETKEYS
kdbGetKeys (...) {...}
#endif
reimpliment_localkdb.c:
#define GENERIC_KDBGETKEYS
kdbGetKeys (...) {...}
This would be quite easy (only #ifndef have before and after all the
functions), but also very flexible. The disadvantage would be, that it would
only work on compile time.
3.) We extract the abstract functions out of localkdb.c and reduce it to the
max. For every port the complete localkdb.c has to be rewritten. Which
localkdb to be included is decided with ./configure.
4.) Maybe you have also an idea :-) ?
Markus
|