author | Myhailo Danylenko <isbear@ukrpost.net> |
Sat, 30 Jul 2016 05:05:19 +0300 | |
changeset 154 | e63030a181f0 |
parent 151 | 5d90caa7fb2c |
permissions | -rw-r--r-- |
72 | 1 |
|
148
b222f4d111d9
lua: Add support for lua 5.3 (v0.0.4)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
147
diff
changeset
|
2 |
/* Copyright 2009-2016 Myhailo Danylenko |
72 | 3 |
|
4 |
This file is part of mcabber-lua. |
|
5 |
||
6 |
mcabber-lua is free software: you can redistribute it and/or modify |
|
7 |
it under the terms of the GNU General Public License as published by |
|
8 |
the Free Software Foundation, either version 2 of the License, or |
|
9 |
(at your option) any later version. |
|
10 |
||
11 |
This program is distributed in the hope that it will be useful, |
|
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
GNU General Public License for more details. |
|
15 |
||
16 |
You should have received a copy of the GNU General Public License |
|
17 |
along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
|
0 | 18 |
|
3
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
19 |
#ifndef MLUA_CONFIG_H |
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
20 |
#define MLUA_CONFIG_H |
0 | 21 |
|
109
2d2111cb5109
Switch to object-based command handling
Myhailo Danylenko <isbear@ukrpost.net>
parents:
95
diff
changeset
|
22 |
#include <mcabber/config.h> |
2d2111cb5109
Switch to object-based command handling
Myhailo Danylenko <isbear@ukrpost.net>
parents:
95
diff
changeset
|
23 |
|
0 | 24 |
// define this to enable debugging output |
25 |
#cmakedefine DEBUG |
|
26 |
||
151
5d90caa7fb2c
Switch global name from 'main' to 'mcabber' (v0.0.5)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
148
diff
changeset
|
27 |
// define this to enable compatibility with v0.0.4 |
5d90caa7fb2c
Switch global name from 'main' to 'mcabber' (v0.0.5)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
148
diff
changeset
|
28 |
#cmakedefine COMPAT_0_0_4 |
5d90caa7fb2c
Switch global name from 'main' to 'mcabber' (v0.0.5)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
148
diff
changeset
|
29 |
|
144
690b5524b895
v0.0.3 Module and command names include lua version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
143
diff
changeset
|
30 |
// define this if you want lua to create alias to '/lua' at module loading |
690b5524b895
v0.0.3 Module and command names include lua version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
143
diff
changeset
|
31 |
#cmakedefine ENABLE_LUA_ALIAS |
690b5524b895
v0.0.3 Module and command names include lua version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
143
diff
changeset
|
32 |
|
78 | 33 |
// define this to enable exporting mcabber connection for lua-loudmouth |
34 |
#cmakedefine LLM_CONNECTION_ENABLE |
|
35 |
||
3
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
36 |
// define this to enable lua-loudmouth log messages handler |
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
37 |
#cmakedefine LLM_LOG_HANDLER |
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
38 |
|
147
66a63c9609de
[update] Add carbons completion id
Myhailo Danylenko <isbear@ukrpost.net>
parents:
145
diff
changeset
|
39 |
// indicates, whether mcabber have built-in carbons completion |
66a63c9609de
[update] Add carbons completion id
Myhailo Danylenko <isbear@ukrpost.net>
parents:
145
diff
changeset
|
40 |
#cmakedefine HAVE_COMPL_CARBONS |
66a63c9609de
[update] Add carbons completion id
Myhailo Danylenko <isbear@ukrpost.net>
parents:
145
diff
changeset
|
41 |
|
148
b222f4d111d9
lua: Add support for lua 5.3 (v0.0.4)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
147
diff
changeset
|
42 |
// name of module description struct |
b222f4d111d9
lua: Add support for lua 5.3 (v0.0.4)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
147
diff
changeset
|
43 |
#define MODULE_STRUCT info_${LUA_MODULENAME} |
b222f4d111d9
lua: Add support for lua 5.3 (v0.0.4)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
147
diff
changeset
|
44 |
|
30
2cf24aced294
Definitions moved to cmake options
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
45 |
// size of background pipe reading buffer |
2cf24aced294
Definitions moved to cmake options
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
46 |
#define MLUA_BGREAD_BUFFER ( ${ML_BGREAD_BUFFER} ) |
2cf24aced294
Definitions moved to cmake options
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
47 |
|
2cf24aced294
Definitions moved to cmake options
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
48 |
// priority of glib event sources for timeout and bgread |
2cf24aced294
Definitions moved to cmake options
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
49 |
#define MLUA_SOURCE_PRIORITY ( ${ML_SOURCE_PRIORITY} ) |
2cf24aced294
Definitions moved to cmake options
Myhailo Danylenko <isbear@ukrpost.net>
parents:
6
diff
changeset
|
50 |
|
95
f2f4c7810a72
Use new module struct with api version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
92
diff
changeset
|
51 |
#define PROJECT_VERSION ( "${PROJECT_VERSION}" ) |
f2f4c7810a72
Use new module struct with api version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
92
diff
changeset
|
52 |
|
145
9f7bbb768ba8
Remove dot in module/command names
Myhailo Danylenko <isbear@ukrpost.net>
parents:
144
diff
changeset
|
53 |
#define MLUA_COMMAND_NAME "${LUA_MODULENAME}" |
144
690b5524b895
v0.0.3 Module and command names include lua version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
143
diff
changeset
|
54 |
#define OPT_MLUA_RC "${OPT_MLUA_RC}" |
690b5524b895
v0.0.3 Module and command names include lua version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
143
diff
changeset
|
55 |
#define OPT_MLUA_LM_DEBUG "${OPT_MLUA_LM_DEBUG}" |
690b5524b895
v0.0.3 Module and command names include lua version
Myhailo Danylenko <isbear@ukrpost.net>
parents:
143
diff
changeset
|
56 |
|
148
b222f4d111d9
lua: Add support for lua 5.3 (v0.0.4)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
147
diff
changeset
|
57 |
// define if module is building againts lua 5.1 |
b222f4d111d9
lua: Add support for lua 5.3 (v0.0.4)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
147
diff
changeset
|
58 |
#cmakedefine LUA51_COMPATIBILITY |
b222f4d111d9
lua: Add support for lua 5.3 (v0.0.4)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
147
diff
changeset
|
59 |
|
b222f4d111d9
lua: Add support for lua 5.3 (v0.0.4)
Myhailo Danylenko <isbear@ukrpost.net>
parents:
147
diff
changeset
|
60 |
#ifdef LUA51_COMPATIBILITY |
143 | 61 |
# define lua_rawlen lua_objlen |
62 |
# define luaL_setfuncs(STATE, REGTABLE, IGZERO) luaL_register ( STATE, NULL, REGTABLE ) |
|
63 |
#endif |
|
64 |
||
0 | 65 |
#ifdef DEBUG |
66 |
# include <stdio.h> |
|
67 |
||
3
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
68 |
# ifndef MLUA_LOG_PREFIX |
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
69 |
# define MLUA_LOG_PREFIX ( NULL ) |
0 | 70 |
# endif |
71 |
||
3
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
72 |
# define D(FORMAT...) { g_log (MLUA_LOG_PREFIX, G_LOG_LEVEL_DEBUG, FORMAT); } |
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
73 |
# define I(FORMAT...) { g_log (MLUA_LOG_PREFIX, G_LOG_LEVEL_INFO, FORMAT); } |
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
74 |
# define W(FORMAT...) { g_log (MLUA_LOG_PREFIX, G_LOG_LEVEL_WARNING, FORMAT); } |
a5f864d4207f
Fixes for build system
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1
diff
changeset
|
75 |
# define E(FORMAT...) { g_log (MLUA_LOG_PREFIX, G_LOG_LEVEL_ERROR, FORMAT); } |
0 | 76 |
#else |
77 |
# define D(FORMAT...) { /* FORMAT */ } |
|
78 |
# define I(FORMAT...) { /* FORMAT */ } |
|
79 |
# define W(FORMAT...) { /* FORMAT */ } |
|
80 |
# define E(FORMAT...) { /* FORMAT */ } |
|
81 |
#endif |
|
82 |
||
83 |
#endif |
|
84 |