config.h.in
author Myhailo Danylenko <isbear@ukrpost.net>
Wed, 28 Nov 2012 20:17:53 +0200
changeset 146 04d19c9c1196
parent 145 9f7bbb768ba8
child 147 66a63c9609de
permissions -rw-r--r--
Fix module loading problem


/* Copyright 2009-2012 Myhailo Danylenko

This file is part of mcabber-lua.

mcabber-lua 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 of the License, 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, see <http://www.gnu.org/licenses/>. */

#ifndef MLUA_CONFIG_H
#define MLUA_CONFIG_H

#include <mcabber/config.h>

// define this to enable debugging output
#cmakedefine DEBUG

// define this if you are building with lua 5.2
#cmakedefine HAVE_LUA52

// define this if you want lua to create alias to '/lua' at module loading
#cmakedefine ENABLE_LUA_ALIAS

// define this to enable exporting mcabber connection for lua-loudmouth
#cmakedefine LLM_CONNECTION_ENABLE

// define this to enable lua-loudmouth log messages handler
#cmakedefine LLM_LOG_HANDLER

// size of background pipe reading buffer
#define MLUA_BGREAD_BUFFER   ( ${ML_BGREAD_BUFFER} )

// priority of glib event sources for timeout and bgread
#define MLUA_SOURCE_PRIORITY ( ${ML_SOURCE_PRIORITY} )

#define PROJECT_VERSION ( "${PROJECT_VERSION}" )

#define MLUA_COMMAND_NAME "${LUA_MODULENAME}"
#define OPT_MLUA_RC       "${OPT_MLUA_RC}"
#define OPT_MLUA_LM_DEBUG "${OPT_MLUA_LM_DEBUG}"

#ifndef HAVE_LUA52
#  define lua_rawlen lua_objlen
#  define luaL_setfuncs(STATE, REGTABLE, IGZERO) luaL_register ( STATE, NULL, REGTABLE )
#  define info_lua52 info_lua51
#endif

#ifdef DEBUG
#  include <stdio.h>

#  ifndef MLUA_LOG_PREFIX
#    define MLUA_LOG_PREFIX ( NULL )
#  endif

#  define D(FORMAT...) { g_log (MLUA_LOG_PREFIX, G_LOG_LEVEL_DEBUG, FORMAT); }
#  define I(FORMAT...) { g_log (MLUA_LOG_PREFIX, G_LOG_LEVEL_INFO, FORMAT); }
#  define W(FORMAT...) { g_log (MLUA_LOG_PREFIX, G_LOG_LEVEL_WARNING, FORMAT); }
#  define E(FORMAT...) { g_log (MLUA_LOG_PREFIX, G_LOG_LEVEL_ERROR, FORMAT); }
#else
#  define D(FORMAT...) { /* FORMAT */ }
#  define I(FORMAT...) { /* FORMAT */ }
#  define W(FORMAT...) { /* FORMAT */ }
#  define E(FORMAT...) { /* FORMAT */ }
#endif

#endif