-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathml_pgsql.h
More file actions
33 lines (24 loc) · 966 Bytes
/
ml_pgsql.h
File metadata and controls
33 lines (24 loc) · 966 Bytes
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
#pragma once
#ifdef __linux__
#include <cstring>
#endif
/* Module basic configuration */
#define MODULE_NAME "PostgreSQL"
#define MODULE_AUTHOR "Disi and xLuxy"
#define MODULE_VERSION 0.6f
/* MTA-SA Module SDK */
#include "Common.h"
#include "ILuaModuleManager.h"
/* Function-related defines for easier working with API */
#define LUA_FUNCTION_DECLARE(function) static int function(lua_State* luaVM)
#define LUA_FUNCTION_ASSERT(function, expression) { if(!(expression)) { lua_pushboolean(luaVM, 0); lua_pushstring(luaVM, "Assertation failed in function " function ": " #expression); return 2; } }
#define SAFE_DELETE(ptr) { delete ptr; ptr = nullptr; }
/* LUA imports */
#include "lua/luaimports.h"
/* Standard Library useful includes */
#include <memory> // smart pointers
#include <string> // std::string
/* libpq SDK */
#include <libpq/libpq-fe.h>
/* Define types here in case we need to change them in the future */
typedef std::string libpq_query_t;