Skip to content
Snippets Groups Projects
Commit 5fe445b2 authored by Maksim Kaitmazian's avatar Maksim Kaitmazian Committed by Dmitry Ivanov
Browse files

build: add exports for a simple query flow

PG protocol run queries by calling dispatch_query, which stores the
response in port_c contained in box_function_ctx structure.

NO_DOC=exports
NO_CHANGELOG=exports
NO_TEST=exports
parent 2680f19a
No related branches found
No related tags found
No related merge requests found
......@@ -647,3 +647,4 @@ coio_write_timeout
fiber_set_name_n
authenticate
user_auth_method_name
port_c_create
......@@ -279,6 +279,9 @@ set(api_headers
${PROJECT_SOURCE_DIR}/src/box/decimal.h
${PROJECT_SOURCE_DIR}/src/lua/decimal.h
${PROJECT_SOURCE_DIR}/src/lib/core/random.h
${PROJECT_SOURCE_DIR}/src/lib/core/port.h
${PROJECT_SOURCE_DIR}/src/box/port.h
${PROJECT_SOURCE_DIR}/src/box/module_cache.h
${EXTRA_API_HEADERS}
)
rebuild_module_api(${api_headers})
......
......@@ -18,12 +18,16 @@ extern "C" {
* API of C stored function.
*/
/** \cond public */
struct port;
struct box_function_ctx {
struct port *port;
};
/** \endcond public */
typedef struct box_function_ctx box_function_ctx_t;
typedef int (*box_function_t)(box_function_ctx_t *ctx,
const char *args,
......
......@@ -107,6 +107,8 @@ void
port_vdbemem_create(struct port *base, struct sql_value *mem,
uint32_t mem_count);
/** \cond public */
struct port_c_entry {
struct port_c_entry *next;
union {
......@@ -148,6 +150,8 @@ static_assert(sizeof(struct port_c) <= sizeof(struct port),
void
port_c_create(struct port *base);
/** \endcond public */
/** Append a tuple to the port. Tuple is referenced. */
int
port_c_add_tuple(struct port *port, struct tuple *tuple);
......
......@@ -37,6 +37,8 @@
extern "C" {
#endif /* defined(__cplusplus) */
/** \cond public */
struct obuf;
struct lua_State;
struct port;
......@@ -131,6 +133,8 @@ struct port {
void
port_destroy(struct port *port);
/** \endcond public */
static inline int
port_dump_msgpack(struct port *port, struct obuf *out)
{
......@@ -155,12 +159,16 @@ port_dump_plain(struct port *port, uint32_t *size)
return port->vtab->dump_plain(port, size);
}
/** \cond public */
static inline const char *
port_get_msgpack(struct port *port, uint32_t *size)
{
return port->vtab->get_msgpack(port, size);
}
/** \endcond public */
static inline struct sql_value *
port_get_vdbemem(struct port *port, uint32_t *size)
{
......
......@@ -734,10 +734,14 @@ strtolower(char *s);
char *
strtolowerdup(const char *s);
/** \cond public */
#if !defined(__cplusplus) && !defined(static_assert)
# define static_assert _Static_assert
#endif
/** \endcond public */
/** Asserts that a global variable has a given type. */
#define STATIC_ASSERT_VAR_TYPE(var, type) \
MAYBE_UNUSED static inline void \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment