ast_str_SQLGetData is *not* part of the ast_str API, it's part of the ast_odbc API and just happens to use an ast_str as the buffer; move all of it to res_odbc.c and res_odbc.h, renaming appropriately

along the way fix some minor coding style issues in strings.h and add some attribute_pure annotations to functions in the ast_str API



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169438 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2009-01-19 21:42:46 +00:00
parent fae3ba7421
commit 1c2911f5a1
4 changed files with 46 additions and 51 deletions

View File

@@ -31,6 +31,7 @@
#include <sqlext.h>
#include <sqltypes.h>
#include "asterisk/linkedlists.h"
#include "asterisk/strings.h"
typedef enum { ODBC_SUCCESS=0, ODBC_FAIL=-1} odbc_status;
@@ -183,4 +184,14 @@ int ast_odbc_clear_cache(const char *database, const char *tablename);
*/
#define ast_odbc_release_table(ptr) if (ptr) { AST_RWLIST_UNLOCK(&(ptr)->columns); }
/*!\brief Wrapper for SQLGetData to use with dynamic strings
* \param buf Address of the pointer to the ast_str structure.
* \param maxlen The maximum size of the resulting string, or 0 for no limit.
* \param StatementHandle The statement handle from which to retrieve data.
* \param ColumnNumber Column number (1-based offset) for which to retrieve data.
* \param TargetType The SQL constant indicating what kind of data is to be retrieved (usually SQL_CHAR)
* \param StrLen_or_Ind A pointer to a length indicator, specifying the total length of data.
*/
SQLRETURN ast_odbc_ast_str_SQLGetData(struct ast_str **buf, int pmaxlen, SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, SQLLEN *StrLen_or_Ind);
#endif /* _ASTERISK_RES_ODBC_H */