aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/res_odbc.h
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-19 21:42:46 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-19 21:42:46 +0000
commita343f7a275dd6cf3762cb42bdb7108fd7b0cfa07 (patch)
tree3d2b6ec3c7b9411ab8529c172387a75dfdd2d053 /include/asterisk/res_odbc.h
parent1bd2376769465415348ca59d9995dd2250f852a7 (diff)
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: http://svn.digium.com/svn/asterisk/trunk@169438 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/res_odbc.h')
-rw-r--r--include/asterisk/res_odbc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asterisk/res_odbc.h b/include/asterisk/res_odbc.h
index ad22045db..005cf29cb 100644
--- a/include/asterisk/res_odbc.h
+++ b/include/asterisk/res_odbc.h
@@ -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 */