summaryrefslogtreecommitdiff
path: root/src/lib/elua
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2015-04-09 14:21:18 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-06 15:05:19 +0100
commit51a5d09018b554530031c8ee0556aef7e289e260 (patch)
tree6ec1d504c002849b25bd1df42b4d2743eb99408d /src/lib/elua
parent19bb7eb4608c30733f92a655d758dbfa525cf1f8 (diff)
elua lib: const correctness
Diffstat (limited to 'src/lib/elua')
-rw-r--r--src/lib/elua/Elua.h17
-rw-r--r--src/lib/elua/cache.c4
-rw-r--r--src/lib/elua/elua.c10
3 files changed, 16 insertions, 15 deletions
diff --git a/src/lib/elua/Elua.h b/src/lib/elua/Elua.h
index 702a3f0f07..5c960fd39f 100644
--- a/src/lib/elua/Elua.h
+++ b/src/lib/elua/Elua.h
@@ -72,24 +72,25 @@ EAPI int elua_init(void);
72EAPI int elua_shutdown(void); 72EAPI int elua_shutdown(void);
73 73
74EAPI Elua_State *elua_state_new(void); 74EAPI Elua_State *elua_state_new(void);
75EAPI Elua_State *elua_state_from_lua_get(lua_State *L);
76
75EAPI void elua_state_free(Elua_State *es); 77EAPI void elua_state_free(Elua_State *es);
76 78
77EAPI void elua_state_dirs_set(Elua_State *es, const char *core, 79EAPI void elua_state_dirs_set(Elua_State *es, const char *core,
78 const char *mods, const char *apps); 80 const char *mods, const char *apps);
79 81
80EAPI Eina_Stringshare *elua_state_core_dir_get(Elua_State *es); 82EAPI Eina_Stringshare *elua_state_core_dir_get(const Elua_State *es);
81EAPI Eina_Stringshare *elua_state_mod_dir_get(Elua_State *es); 83EAPI Eina_Stringshare *elua_state_mod_dir_get(const Elua_State *es);
82EAPI Eina_Stringshare *elua_state_apps_dir_get(Elua_State *es); 84EAPI Eina_Stringshare *elua_state_apps_dir_get(const Elua_State *es);
83 85
84EAPI Elua_State *elua_state_from_lua_get(lua_State *L); 86EAPI int elua_report_error(const Elua_State *es, const char *pname, int status);
85 87
86EAPI int elua_report_error(Elua_State *es, const char *pname, int status); 88EAPI void elua_state_setup_i18n(const Elua_State *es);
87 89
88EAPI void elua_state_setup_i18n(Elua_State *es); 90EAPI int elua_io_loadfile(const Elua_State *es, const char *fname);
91EAPI void elua_io_register(const Elua_State *es);
89 92
90EAPI int elua_io_popen(lua_State *L); 93EAPI int elua_io_popen(lua_State *L);
91EAPI int elua_io_loadfile(Elua_State *es, const char *fname);
92EAPI void elua_io_register(Elua_State *es);
93 94
94#endif 95#endif
95 96
diff --git a/src/lib/elua/cache.c b/src/lib/elua/cache.c
index 26ce948ead..8cd1617f61 100644
--- a/src/lib/elua/cache.c
+++ b/src/lib/elua/cache.c
@@ -150,7 +150,7 @@ getf_map(lua_State *L EINA_UNUSED, void *ud, size_t *size)
150} 150}
151 151
152EAPI int 152EAPI int
153elua_io_loadfile(Elua_State *es, const char *fname) 153elua_io_loadfile(const Elua_State *es, const char *fname)
154{ 154{
155 Map_Stream s; 155 Map_Stream s;
156 int status; 156 int status;
@@ -209,7 +209,7 @@ loadfile(lua_State *L)
209} 209}
210 210
211EAPI void 211EAPI void
212elua_io_register(Elua_State *es) 212elua_io_register(const Elua_State *es)
213{ 213{
214 EINA_SAFETY_ON_FALSE_RETURN(es && es->luastate); 214 EINA_SAFETY_ON_FALSE_RETURN(es && es->luastate);
215 lua_pushcfunction(es->luastate, loadfile); 215 lua_pushcfunction(es->luastate, loadfile);
diff --git a/src/lib/elua/elua.c b/src/lib/elua/elua.c
index 7382bdeff5..2a31eae647 100644
--- a/src/lib/elua/elua.c
+++ b/src/lib/elua/elua.c
@@ -99,21 +99,21 @@ elua_state_dirs_set(Elua_State *es, const char *core, const char *mods,
99} 99}
100 100
101EAPI Eina_Stringshare * 101EAPI Eina_Stringshare *
102elua_state_core_dir_get(Elua_State *es) 102elua_state_core_dir_get(const Elua_State *es)
103{ 103{
104 EINA_SAFETY_ON_NULL_RETURN_VAL(es, NULL); 104 EINA_SAFETY_ON_NULL_RETURN_VAL(es, NULL);
105 return es->coredir; 105 return es->coredir;
106} 106}
107 107
108EAPI Eina_Stringshare * 108EAPI Eina_Stringshare *
109elua_state_mod_dir_get(Elua_State *es) 109elua_state_mod_dir_get(const Elua_State *es)
110{ 110{
111 EINA_SAFETY_ON_NULL_RETURN_VAL(es, NULL); 111 EINA_SAFETY_ON_NULL_RETURN_VAL(es, NULL);
112 return es->moddir; 112 return es->moddir;
113} 113}
114 114
115EAPI Eina_Stringshare * 115EAPI Eina_Stringshare *
116elua_state_apps_dir_get(Elua_State *es) 116elua_state_apps_dir_get(const Elua_State *es)
117{ 117{
118 EINA_SAFETY_ON_NULL_RETURN_VAL(es, NULL); 118 EINA_SAFETY_ON_NULL_RETURN_VAL(es, NULL);
119 return es->moddir; 119 return es->moddir;
@@ -141,7 +141,7 @@ _elua_errmsg(const char *pname, const char *msg)
141} 141}
142 142
143EAPI int 143EAPI int
144elua_report_error(Elua_State *es, const char *pname, int status) 144elua_report_error(const Elua_State *es, const char *pname, int status)
145{ 145{
146 EINA_SAFETY_ON_FALSE_RETURN_VAL(es && es->luastate, status); 146 EINA_SAFETY_ON_FALSE_RETURN_VAL(es && es->luastate, status);
147 if (status && !lua_isnil(es->luastate, -1)) 147 if (status && !lua_isnil(es->luastate, -1))
@@ -188,7 +188,7 @@ const luaL_reg gettextlib[] =
188}; 188};
189 189
190EAPI void 190EAPI void
191elua_state_setup_i18n(Elua_State *es) 191elua_state_setup_i18n(const Elua_State *es)
192{ 192{
193#ifdef ENABLE_NLS 193#ifdef ENABLE_NLS
194 char *(*dgettextp)(const char*, const char*) = dgettext; 194 char *(*dgettextp)(const char*, const char*) = dgettext;