boost_sqlite
1
A sqlite C++ library
Loading...
Searching...
No Matches
extension.hpp
1
//
2
// Copyright (c) 2022 Klemens Morgenstern (klemens.morgenstern@gmx.net)
3
//
4
// Distributed under the Boost Software License, Version 1.0. (See accompanying
5
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
//
7
8
#ifndef BOOST_SQLITE_EXTENSION_HPP
9
#define BOOST_SQLITE_EXTENSION_HPP
10
11
#define BOOST_SQLITE_COMPILE_EXTENSION 1
12
#include <boost/sqlite/detail/config.hpp>
13
#include <boost/sqlite/connection.hpp>
14
#include <boost/sqlite/detail/catch.hpp>
15
#include <boost/config.hpp>
16
17
47
#define BOOST_SQLITE_EXTENSION(Name, Conn) \
48
void sqlite_##Name##_impl (boost::sqlite::connection Conn); \
49
extern "C" BOOST_SYMBOL_EXPORT \
50
int sqlite3_##Name##_init( \
51
sqlite3 *db, \
52
char **pzErrMsg, \
53
const sqlite3_api_routines *pApi) \
54
{ \
55
using boost::sqlite::sqlite3_api; \
56
SQLITE_EXTENSION_INIT2(pApi); \
57
\
58
BOOST_SQLITE_TRY \
59
{ \
60
sqlite_##Name##_impl(boost::sqlite::connection{db, false}); \
61
return SQLITE_OK; \
62
} \
63
BOOST_SQLITE_CATCH_ASSIGN_STR_AND_RETURN(*pzErrMsg); \
64
} \
65
void sqlite_##Name##_impl(boost::sqlite::connection Conn)
66
67
#endif
//BOOST_SQLITE_EXTENSION_HPP
boost
sqlite
extension.hpp
Generated on Thu Nov 14 2024 00:50:54 for boost_sqlite by
1.10.0