| 1 |
--[[ |
| 2 |
Copyright (c) 2022, Vsevolod Stakhov <[email protected]> |
| 3 |
|
| 4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
you may not use this file except in compliance with the License. |
| 6 |
You may obtain a copy of the License at |
| 7 |
|
| 8 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
|
| 10 |
Unless required by applicable law or agreed to in writing, software |
| 11 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
See the License for the specific language governing permissions and |
| 14 |
limitations under the License. |
| 15 |
]]-- |
| 16 |
|
| 17 |
--[[[ |
| 18 |
-- @module lua_ffi/common |
| 19 |
-- Common ffi definitions |
| 20 |
--]] |
| 21 |
|
| 22 |
local ffi = require 'ffi' |
| 23 |
|
| 24 |
ffi.cdef [[ |
| 25 |
struct GString { |
| 26 |
char *str; |
| 27 |
size_t len; |
| 28 |
size_t allocated_len; |
| 29 |
}; |
| 30 |
struct GArray { |
| 31 |
char *data; |
| 32 |
unsigned len; |
| 33 |
}; |
| 34 |
typedef void (*ref_dtor_cb_t)(void *data); |
| 35 |
struct ref_entry_s { |
| 36 |
unsigned int refcount; |
| 37 |
ref_dtor_cb_t dtor; |
| 38 |
}; |
| 39 |
|
| 40 |
void g_string_free (struct GString *st, int free_data); |
| 41 |
void g_free (void *p); |
| 42 |
long rspamd_snprintf (char *buf, long max, const char *fmt, ...); |
| 43 |
]] |
| 44 |
|
| 45 |
return {} |