[tables] Incorporate table data type information into table definition

Eliminate the potential for mismatches between table names and the
table entry data type by incorporating the data type into the
definition of the table, rather than specifying it explicitly in each
table accessor method.
This commit is contained in:
Michael Brown
2009-03-13 02:10:21 +00:00
parent 1266d7902b
commit 3c68ff99ea
26 changed files with 185 additions and 130 deletions
+4 -4
View File
@@ -59,10 +59,10 @@ struct uri_opener {
};
/** URI opener table */
#define URI_OPENERS "uri_openers"
#define URI_OPENERS __table ( struct uri_opener, "uri_openers" )
/** Register a URI opener */
#define __uri_opener __table ( struct uri_opener, URI_OPENERS, 01 )
#define __uri_opener __table_entry ( URI_OPENERS, 01 )
/** A socket opener */
struct socket_opener {
@@ -82,10 +82,10 @@ struct socket_opener {
};
/** Socket opener table */
#define SOCKET_OPENERS "socket_openers"
#define SOCKET_OPENERS __table ( struct socket_opener, "socket_openers" )
/** Register a socket opener */
#define __socket_opener __table ( struct socket_opener, SOCKET_OPENERS, 01 )
#define __socket_opener __table_entry ( SOCKET_OPENERS, 01 )
extern int xfer_open_uri ( struct xfer_interface *xfer, struct uri *uri );
extern int xfer_open_uri_string ( struct xfer_interface *xfer,