/usr/include/libpreludedb/preludedb-plugin-sql.h is in libpreludedb-dev 4.1.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | /*****
*
* Copyright (C) 2005-2017 CS-SI. All Rights Reserved.
* Author: Yoann Vandoorselaere <yoann.v@prelude-ids.com>
*
* This file is part of the PreludeDB library.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*****/
#ifndef _LIBPRELUDEDB_PLUGIN_SQL_H
#define _LIBPRELUDEDB_PLUGIN_SQL_H
#include <libprelude/prelude-plugin.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct preludedb_plugin_sql preludedb_plugin_sql_t;
typedef int (*preludedb_plugin_sql_open_func_t)(preludedb_sql_settings_t *settings, void **session);
typedef void (*preludedb_plugin_sql_close_func_t)(void *session);
typedef int (*preludedb_plugin_sql_escape_func_t)(void *session, const char *input, size_t input_size, char **output);
typedef int (*preludedb_plugin_sql_escape_binary_func_t)(void *session, const unsigned char *input, size_t input_size, char **output);
typedef int (*preludedb_plugin_sql_unescape_binary_func_t)(void *session, const char *input, unsigned char **output, size_t *output_size);
typedef int (*preludedb_plugin_sql_query_func_t)(void *session, const char *query, preludedb_sql_table_t **res);
typedef unsigned int (*preludedb_plugin_sql_get_column_count_func_t)(void *session, preludedb_sql_table_t *table);
typedef unsigned int (*preludedb_plugin_sql_get_row_count_func_t)(void *session, preludedb_sql_table_t *table);
typedef const char *(*preludedb_plugin_sql_get_column_name_func_t)(void *session, preludedb_sql_table_t *table, unsigned int column_num);
typedef int (*preludedb_plugin_sql_get_column_num_func_t)(void *session, preludedb_sql_table_t *table, const char *column_name);
typedef void (*preludedb_plugin_sql_field_destroy_func_t)(void *session, preludedb_sql_table_t *table, preludedb_sql_row_t *row, preludedb_sql_field_t *field);
typedef void (*preludedb_plugin_sql_row_destroy_func_t)(void *session, preludedb_sql_table_t *table, preludedb_sql_row_t *row);
typedef void (*preludedb_plugin_sql_table_destroy_func_t)(void *session, preludedb_sql_table_t *table);
typedef int (*preludedb_plugin_sql_fetch_row_func_t)(void *session, preludedb_sql_table_t *table, unsigned int row_index, preludedb_sql_row_t **row);
typedef int (*preludedb_plugin_sql_fetch_field_func_t)(void *session, preludedb_sql_table_t *table, preludedb_sql_row_t *row,
unsigned int column_num, preludedb_sql_field_t **field);
typedef int (*preludedb_plugin_sql_build_time_extract_string_func_t)(void *session, prelude_string_t *output, const char *field,
preludedb_sql_time_constraint_type_t type, int gmt_offset);
typedef int (*preludedb_plugin_sql_build_time_timezone_string_func_t)(void *session, prelude_string_t *output, const char *field, const char *tzvalue);
typedef int (*preludedb_plugin_sql_build_time_constraint_string_func_t)(void *session, prelude_string_t *output, const char *field,
preludedb_sql_time_constraint_type_t type,
idmef_criterion_operator_t operator, int value, int gmt_offset);
typedef int (*preludedb_plugin_sql_build_time_interval_string_func_t)(void *session, prelude_string_t *output, const char *field, const char *value, preludedb_selected_object_interval_t unit);
typedef int (*preludedb_plugin_sql_build_limit_offset_string_func_t)(void *session, int limit, int offset, prelude_string_t *output);
typedef int (*preludedb_plugin_sql_build_constraint_string_func_t)(void *session, prelude_string_t *out, const char *field,
idmef_criterion_operator_t operator, const char *value);
typedef const char *(*preludedb_plugin_sql_get_operator_string_func_t)(idmef_criterion_operator_t operator);
typedef int (*preludedb_plugin_sql_build_timestamp_string_func_t)(void *session, const struct tm *t, char *out, size_t size);
typedef long (*preludedb_plugin_sql_get_server_version_func_t)(void *session);
typedef int (*preludedb_plugin_sql_get_last_insert_ident_func_t)(void *session, uint64_t *ident);
void preludedb_plugin_sql_set_open_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_open_func_t func);
int _preludedb_plugin_sql_open(preludedb_plugin_sql_t *plugin,
preludedb_sql_settings_t *settings, void **session);
void preludedb_plugin_sql_set_close_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_close_func_t func);
void _preludedb_plugin_sql_close(preludedb_plugin_sql_t *plugin, void *session);
void preludedb_plugin_sql_set_escape_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_escape_func_t func);
int _preludedb_plugin_sql_escape(preludedb_plugin_sql_t *plugin, void *session, const char *input, size_t input_size, char **output);
void preludedb_plugin_sql_set_escape_binary_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_escape_binary_func_t func);
int _preludedb_plugin_sql_escape_binary(preludedb_plugin_sql_t *plugin, void *session,
const unsigned char *input, size_t input_size, char **output);
void preludedb_plugin_sql_set_unescape_binary_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_unescape_binary_func_t func);
int _preludedb_plugin_sql_unescape_binary(preludedb_plugin_sql_t *plugin, void *session, const char *input,
size_t input_size, unsigned char **output, size_t *output_size);
void preludedb_plugin_sql_set_query_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_query_func_t func);
int _preludedb_plugin_sql_query(preludedb_plugin_sql_t *plugin, void *session, const char *query, preludedb_sql_table_t **res);
void preludedb_plugin_sql_set_get_column_count_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_get_column_count_func_t func);
unsigned int _preludedb_plugin_sql_get_column_count(preludedb_plugin_sql_t *plugin, void *session, preludedb_sql_table_t *table);
void preludedb_plugin_sql_set_get_row_count_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_get_row_count_func_t func);
unsigned int _preludedb_plugin_sql_get_row_count(preludedb_plugin_sql_t *plugin, void *session, preludedb_sql_table_t *table);
void preludedb_plugin_sql_set_get_column_name_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_get_column_name_func_t func);
const char *_preludedb_plugin_sql_get_column_name(preludedb_plugin_sql_t *plugin, void *session, preludedb_sql_table_t *table, unsigned int column_num);
void preludedb_plugin_sql_set_get_column_num_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_get_column_num_func_t func);
int _preludedb_plugin_sql_get_column_num(preludedb_plugin_sql_t *plugin, void *session, preludedb_sql_table_t *table, const char *column_name);
void preludedb_plugin_sql_set_field_destroy_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_field_destroy_func_t func);
void preludedb_plugin_sql_set_row_destroy_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_row_destroy_func_t func);
void preludedb_plugin_sql_set_table_destroy_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_table_destroy_func_t func);
void _preludedb_plugin_sql_field_destroy(preludedb_plugin_sql_t *plugin, void *session, preludedb_sql_table_t *table, preludedb_sql_row_t *row, preludedb_sql_field_t *field);
void _preludedb_plugin_sql_row_destroy(preludedb_plugin_sql_t *plugin, void *session, preludedb_sql_table_t *table, preludedb_sql_row_t *row);
void _preludedb_plugin_sql_table_destroy(preludedb_plugin_sql_t *plugin, void *session, preludedb_sql_table_t *table);
void preludedb_plugin_sql_set_fetch_row_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_fetch_row_func_t func);
int _preludedb_plugin_sql_fetch_row(preludedb_plugin_sql_t *plugin, void *session, preludedb_sql_table_t *table, unsigned int row_index, preludedb_sql_row_t **row);
void preludedb_plugin_sql_set_fetch_field_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_fetch_field_func_t func);
int _preludedb_plugin_sql_fetch_field(preludedb_plugin_sql_t *plugin,
void *session, preludedb_sql_table_t *table, void *row,
unsigned int column_num, preludedb_sql_field_t **field);
void preludedb_plugin_sql_set_build_time_extract_string_func(preludedb_plugin_sql_t *plugin,
preludedb_plugin_sql_build_time_extract_string_func_t func);
int _preludedb_plugin_sql_build_time_extract_string(preludedb_plugin_sql_t *plugin, void *session,
prelude_string_t *output, const char *field,
preludedb_sql_time_constraint_type_t type, int gmt_offset);
void preludedb_plugin_sql_set_build_time_timezone_string_func(preludedb_plugin_sql_t *plugin,
preludedb_plugin_sql_build_time_timezone_string_func_t func);
int _preludedb_plugin_sql_build_time_timezone_string(preludedb_plugin_sql_t *plugin, void *session,
prelude_string_t *output, const char *field, const char *tzvalue);
void preludedb_plugin_sql_set_build_time_constraint_string_func(preludedb_plugin_sql_t *plugin,
preludedb_plugin_sql_build_time_constraint_string_func_t func);
int _preludedb_plugin_sql_build_time_constraint_string(preludedb_plugin_sql_t *plugin, void *session,
prelude_string_t *output, const char *field,
preludedb_sql_time_constraint_type_t type,
idmef_criterion_operator_t operator, int value, int gmt_offset);
void preludedb_plugin_sql_set_build_time_interval_string_func(preludedb_plugin_sql_t *plugin,
preludedb_plugin_sql_build_time_interval_string_func_t func);
int _preludedb_plugin_sql_build_time_interval_string(preludedb_plugin_sql_t *plugin, void *session, prelude_string_t *output,
const char *field, const char *value, preludedb_selected_object_interval_t unit);
void preludedb_plugin_sql_set_build_limit_offset_string_func(preludedb_plugin_sql_t *plugin,
preludedb_plugin_sql_build_limit_offset_string_func_t func);
int _preludedb_plugin_sql_build_limit_offset_string(preludedb_plugin_sql_t *plugin,
void *session, int limit, int offset, prelude_string_t *output);
void preludedb_plugin_sql_set_build_constraint_string_func(preludedb_plugin_sql_t *plugin,
preludedb_plugin_sql_build_constraint_string_func_t func);
int _preludedb_plugin_sql_build_constraint_string(preludedb_plugin_sql_t *plugin, void *session,
prelude_string_t *out, const char *field,
idmef_criterion_operator_t operator, const char *value);
void preludedb_plugin_sql_set_get_operator_string_func(preludedb_plugin_sql_t *plugin,
preludedb_plugin_sql_get_operator_string_func_t func);
const char *_preludedb_plugin_sql_get_operator_string(preludedb_plugin_sql_t *plugin, idmef_criterion_operator_t operator);
void preludedb_plugin_sql_set_build_timestamp_string_func(preludedb_plugin_sql_t *plugin,
preludedb_plugin_sql_build_timestamp_string_func_t func);
int _preludedb_plugin_sql_build_timestamp_string(preludedb_plugin_sql_t *plugin, void *session, const struct tm *t, char *out, size_t size);
void preludedb_plugin_sql_set_get_server_version_func(preludedb_plugin_sql_t *plugin,
preludedb_plugin_sql_get_server_version_func_t func);
long _preludedb_plugin_sql_get_server_version(preludedb_plugin_sql_t *plugin, void *session);
void preludedb_plugin_sql_set_get_last_insert_ident_func(preludedb_plugin_sql_t *plugin, preludedb_plugin_sql_get_last_insert_ident_func_t func);
int _preludedb_plugin_sql_get_last_insert_ident(preludedb_plugin_sql_t *plugin, void *session, uint64_t *ident);
int preludedb_plugin_sql_new(preludedb_plugin_sql_t **plugin);
#ifdef __cplusplus
}
#endif
#endif /* _LIBPRELUDEDB_PLUGIN_SQL_H */
|