summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-12-12 13:43:39 +0000
committerDaniel Kolesa <d.kolesa@samsung.com>2014-12-12 13:43:39 +0000
commitec78c23761ac3cfea0f69a52d262d161326b3255 (patch)
treeeabf72870b264dd24e79a0dc7d8b2fb1514b1672 /src/bin
parent09869589c9528afef7544753b7229d2cd944cbec (diff)
elua: remove main.h (launcher is only 1 C file now)
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/elua/main.c37
-rw-r--r--src/bin/elua/main.h40
2 files changed, 29 insertions, 48 deletions
diff --git a/src/bin/elua/main.c b/src/bin/elua/main.c
index 1eb2a7508a..94beacf241 100644
--- a/src/bin/elua/main.c
+++ b/src/bin/elua/main.c
@@ -1,10 +1,25 @@
1#include "config.h" 1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
2 4
3/* The Lua runtime component of the EFL */ 5/* The Lua runtime component of the EFL */
4 6
7#include <stdio.h>
8#include <stdlib.h>
5#include <getopt.h> 9#include <getopt.h>
6 10
7#include "main.h" 11#ifdef ENABLE_NLS
12# include <locale.h>
13# include <libintl.h>
14# define _(x) dgettext(PACKAGE, x)
15#else
16# define _(x) (x)
17#endif
18
19#include <Eina.h>
20#include <Ecore.h>
21
22#include "Elua.h"
8 23
9typedef struct Arg_Data 24typedef struct Arg_Data
10{ 25{
@@ -25,7 +40,13 @@ static int elua_appload_ref = LUA_REFNIL;
25static const char *elua_progname = NULL; 40static const char *elua_progname = NULL;
26static Eina_Prefix *elua_prefix = NULL; 41static Eina_Prefix *elua_prefix = NULL;
27 42
28int el_log_domain = -1; 43static int _el_log_domain = -1;
44
45#define DBG(...) EINA_LOG_DOM_DBG(_el_log_domain, __VA_ARGS__)
46#define INF(...) EINA_LOG_DOM_INFO(_el_log_domain, __VA_ARGS__)
47#define WRN(...) EINA_LOG_DOM_WARN(_el_log_domain, __VA_ARGS__)
48#define ERR(...) EINA_LOG_DOM_ERR(_el_log_domain, __VA_ARGS__)
49#define CRT(...) EINA_LOG_DOM_CRITICAL(_el_log_domain, __VA_ARGS__)
29 50
30static void 51static void
31elua_errmsg(const char *pname, const char *msg) 52elua_errmsg(const char *pname, const char *msg)
@@ -279,8 +300,8 @@ elua_bin_shutdown(lua_State *L, int c)
279 if (elua_prefix) eina_prefix_free(elua_prefix); 300 if (elua_prefix) eina_prefix_free(elua_prefix);
280 301
281 if (L) lua_close(L); 302 if (L) lua_close(L);
282 if (el_log_domain != EINA_LOG_DOMAIN_GLOBAL) 303 if (_el_log_domain != EINA_LOG_DOMAIN_GLOBAL)
283 eina_log_domain_unregister(el_log_domain); 304 eina_log_domain_unregister(_el_log_domain);
284 elua_shutdown(); 305 elua_shutdown();
285 exit(c); 306 exit(c);
286} 307}
@@ -537,14 +558,14 @@ main(int argc, char **argv)
537 558
538 elua_init(); 559 elua_init();
539 560
540 if (!(el_log_domain = eina_log_domain_register("elua", EINA_COLOR_ORANGE))) 561 if (!(_el_log_domain = eina_log_domain_register("elua", EINA_COLOR_ORANGE)))
541 { 562 {
542 printf("cannot set elua log domain\n"); 563 printf("cannot set elua log domain\n");
543 ERR("could not set elua log domain."); 564 ERR("could not set elua log domain.");
544 el_log_domain = EINA_LOG_DOMAIN_GLOBAL; 565 _el_log_domain = EINA_LOG_DOMAIN_GLOBAL;
545 } 566 }
546 567
547 INF("elua logging initialized: %d", el_log_domain); 568 INF("elua logging initialized: %d", _el_log_domain);
548 569
549 if (!(L = luaL_newstate())) 570 if (!(L = luaL_newstate()))
550 { 571 {
diff --git a/src/bin/elua/main.h b/src/bin/elua/main.h
deleted file mode 100644
index 29f7a4249d..0000000000
--- a/src/bin/elua/main.h
+++ /dev/null
@@ -1,40 +0,0 @@
1#ifndef LUAR_MAIN_H
2#define LUAR_MAIN_H
3
4#ifdef HAVE_CONFIG_H
5# include <config.h>
6#endif
7
8#ifdef ENABLE_NLS
9# include <locale.h>
10# include <libintl.h>
11# define _(x) dgettext(PACKAGE, x)
12#else
13# define _(x) (x)
14#endif
15
16#include <stdio.h>
17#include <stdlib.h>
18
19#include <Eina.h>
20#include <Ecore.h>
21
22#ifdef HAVE_EVIL
23#include <Evil.h>
24#endif
25
26#include "Elua.h"
27
28#include <lua.h>
29#include <lualib.h>
30#include <lauxlib.h>
31
32extern int el_log_domain;
33
34#define DBG(...) EINA_LOG_DOM_DBG(el_log_domain, __VA_ARGS__)
35#define INF(...) EINA_LOG_DOM_INFO(el_log_domain, __VA_ARGS__)
36#define WRN(...) EINA_LOG_DOM_WARN(el_log_domain, __VA_ARGS__)
37#define ERR(...) EINA_LOG_DOM_ERR(el_log_domain, __VA_ARGS__)
38#define CRT(...) EINA_LOG_DOM_CRITICAL(el_log_domain, __VA_ARGS__)
39
40#endif