X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_sql.h;h=0fe4f4bcca3442cf5f5f8f5347c86448af17c32c;hb=12ade3e3bc975d5426ba4af155b7372c31093b31;hp=ad325f5d14810fb12823a4af2acb3c4ad8ac212e;hpb=2aa8e5b6df96c9cd40dece76fb1774b16409e1d8;p=vlc diff --git a/include/vlc_sql.h b/include/vlc_sql.h index ad325f5d14..0fe4f4bcca 100644 --- a/include/vlc_sql.h +++ b/include/vlc_sql.h @@ -136,6 +136,9 @@ struct sql_t /** Get the data from a specified column */ int (*pf_getcolumn) ( sql_t* p_sql, sql_stmt_t* p_stmt, int i_col, int type, sql_value_t *p_res ); + + /** Get column size of a specified column */ + int (*pf_getcolumnsize) ( sql_t* p_sql, sql_stmt_t* p_stmt, int i_col ); }; /***************************************************************************** @@ -297,7 +300,7 @@ static inline int sql_CommitTransaction( sql_t *p_sql ) **/ static inline void sql_RollbackTransaction( sql_t *p_sql ) { - return p_sql->pf_rollback( p_sql ); + p_sql->pf_rollback( p_sql ); } /** @@ -557,6 +560,19 @@ static inline int sql_GetColumnBlob( sql_t* p_sql, sql_stmt_t* p_stmt, return i_ret; } +/** + * @brief Get the size of the column in bytes + * @param p_sql The SQL object + * @param p_stmt The sql statement object + * @param i_col The column + * @return Size of the column in bytes, excluding the zero terminator + */ +static inline int sql_GetColumnSize( sql_t* p_sql, sql_stmt_t* p_stmt, + int i_col ) +{ + return p_sql->pf_getcolumnsize( p_sql, p_stmt, i_col ); +} + # ifdef __cplusplus } # endif /* C++ extern "C" */