* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-#if !defined( __LIBVLC__ )
-# error You are not libvlc or one of its plugins. You cannot include this file
-#endif
-
#ifndef VLC_SQL_H
# define VLC_SQL_H
/** 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 );
};
/*****************************************************************************
* @param psz_pass Password for the database
* @return The VLC SQL object, type sql_t.
**/
-VLC_EXPORT( sql_t*, sql_Create, ( vlc_object_t *p_this, const char *psz_name,
+VLC_API sql_t *sql_Create( vlc_object_t *p_this, const char *psz_name,
const char* psz_host, int i_port,
- const char* psz_user, const char* psz_pass ) );
+ const char* psz_user, const char* psz_pass );
#define sql_Create( a, b, c, d, e, f ) sql_Create( VLC_OBJECT(a), b, c, d, e, f )
* @param obj This p_sql object
* @return Nothing
*/
-VLC_EXPORT( void, sql_Destroy, ( vlc_object_t *obj ) );
+VLC_API void sql_Destroy( vlc_object_t *obj );
#define sql_Destroy( a ) sql_Destroy( VLC_OBJECT( a ) )
**/
static inline void sql_RollbackTransaction( sql_t *p_sql )
{
- return p_sql->pf_rollback( p_sql );
+ p_sql->pf_rollback( p_sql );
}
/**
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" */