diff -r f5037572c326 -r 0d6e07f4c9a1 src/evsql.h --- a/src/evsql.h Sat Dec 13 18:55:01 2008 +0200 +++ b/src/evsql.h Sat Dec 13 19:55:50 2008 +0200 @@ -65,6 +65,8 @@ /** * Various transaction isolation levels for conveniance + * + * @see evsql_trans */ enum evsql_trans_type { EVSQL_TRANS_DEFAULT, @@ -147,6 +149,8 @@ /** * An union to provide storage for the values of small types + * + * @see evsql_item */ union evsql_item_value { /** 16-bit unsigned integer */ @@ -161,6 +165,10 @@ /** * A generic structure containing the type and value of a query parameter or a result field. + * + * @see evsql_query_info + * @see evsql_query_params + * @see evsql_result_info */ struct evsql_item { /** The "header" containing the type and format */ @@ -195,6 +203,8 @@ * Query meta-info, similar to a prepared statement. * * Contains the literal SQL query and the types of the parameters, but no more. + * + * @see evsql_query_exec */ struct evsql_query_info { /** The SQL query itself */ @@ -208,6 +218,8 @@ /** * Contains the query parameter types and their actual values + * + * @see evsql_query_params */ struct evsql_query_params { /** Requested result format for this query. XXX: move elsewhere */ @@ -221,6 +233,8 @@ /** * Result layout metadata. This contains the stucture needed to decode result rows. + * + * @see evsql_result_begin */ struct evsql_result_info { /** XXX: make up something useful to stick here */ @@ -234,6 +248,15 @@ /** * Magic macros for defining param/result info -lists + * + * @code + * static struct evsql_query_params params = EVSQL_PARAMS(EVSQL_FMT_BINARY) { + * EVSQL_PARAM( UINT32 ), + * ..., + * + * EVSQL_PARAMS_END + * }; + * @endcode * * @name EVSQL_TYPE/PARAM_* * @{ @@ -242,6 +265,8 @@ /** * A `struct evsql_item_info` initializer, using FMT_BINARY and the given EVSQL_TYPE_ -suffix. * + * @param typenam the suffix of an evsql_item_type name + * * @see struct evsql_item_info * @see enum evsql_item_type */ @@ -255,18 +280,18 @@ #define EVSQL_TYPE_END { EVSQL_FMT_BINARY, EVSQL_TYPE_INVALID } /** - * Initializer block for a `struct evsql_query_params` struct. EVSQL_PARAMS/EVSQL_PARAMS_END should be used as a - * pseudo-block with the following layout: - * - * static struct evsql_query_params params = EVSQL_PARAMS(EVSQL_FMT_BINARY) { - * EVSQL_PARAM(...), - * ..., - * - * EVSQL_PARAMS_END - * }; + * Initializer block for an evsql_query_params struct */ #define EVSQL_PARAMS(result_fmt) { result_fmt, + +/** + * An evsql_item initializer + */ #define EVSQL_PARAM(typenam) { EVSQL_TYPE(typenam) } + +/** + * Include the ending item and terminate the pseudo-block started using #EVSQL_PARAMS + */ #define EVSQL_PARAMS_END { EVSQL_TYPE_END } \ } // <<< @@ -343,6 +368,13 @@ // @} /** + * Session functions + * + * @name evsql_* + * @{ + */ + +/** * Create a new PostgreSQL/libpq (evpq) -based evsql using the given conninfo. * * The given conninfo must stay valid for the duration of the evsql's lifetime. @@ -361,6 +393,18 @@ ); /** + * Close a connection. Callbacks for waiting queries will not be run. + * + * XXX: not implemented yet. + * + * @ingroup evsql_* + * @param evsql the context handle from evsql_new_* + */ +void evsql_close (struct evsql *evsql); + +// @} + +/** * Query API * * @name evsql_query_* @@ -700,14 +744,4 @@ // @} -/** - * Close a connection. Callbacks for waiting queries will not be run. - * - * XXX: not implemented yet. - * - * @ingroup evsql_* - * @param evsql the context handle from evsql_new_* - */ -void evsql_close (struct evsql *evsql); - #endif /* EVSQL_H */