]> git.sesse.net Git - vlc/blob - modules/misc/lua/vlclua.h
1137b0cbe4b731d8c30a87ec736a3d9884242feb
[vlc] / modules / misc / lua / vlclua.h
1 /*****************************************************************************
2  * luameta.c: Get meta/artwork using lua scripts
3  *****************************************************************************
4  * Copyright (C) 2007 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Antoine Cellerier <dionoea at videolan tod org>
8  *          Pierre d'Herbemont <pdherbemont # videolan.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifndef VLCLUA_H
26 #define VLC_LUA_H
27 /*****************************************************************************
28  * Preamble
29  *****************************************************************************/
30 #ifndef  _GNU_SOURCE
31 #   define  _GNU_SOURCE
32 #endif
33
34 #include <vlc/vlc.h>
35 #include <vlc_input.h>
36 #include <vlc_playlist.h>
37 #include <vlc_meta.h>
38 #include <vlc_url.h>
39 #include <vlc_strings.h>
40 #include <vlc_stream.h>
41 #include <vlc_charset.h>
42
43 #ifdef HAVE_SYS_STAT_H
44 #   include <sys/stat.h>
45 #endif
46
47 #include <lua.h>        /* Low level lua C API */
48 #include <lauxlib.h>    /* Higher level C API */
49 #include <lualib.h>     /* Lua libs */
50
51 /*****************************************************************************
52  * Module entry points
53  *****************************************************************************/
54 int E_(FindArt)( vlc_object_t * );
55 int E_(FindMeta)( vlc_object_t * );
56
57 int E_(Import_LuaPlaylist)( vlc_object_t * );
58 void E_(Close_LuaPlaylist)( vlc_object_t * );
59
60 /*****************************************************************************
61  * Lua function bridge
62  *****************************************************************************/
63 vlc_object_t * vlclua_get_this( lua_State *p_state );
64 int vlclua_stream_new( lua_State *p_state );
65 int vlclua_stream_read( lua_State *p_state );
66 int vlclua_stream_readline( lua_State *p_state );
67 int vlclua_stream_delete( lua_State *p_state );
68 int vlclua_decode_uri( lua_State *p_state );
69 int vlclua_resolve_xml_special_chars( lua_State *p_state );
70 int vlclua_msg_dbg( lua_State *p_state );
71 int vlclua_msg_warn( lua_State *p_state );
72 int vlclua_msg_err( lua_State *p_state );
73 int vlclua_msg_info( lua_State *p_state );
74
75
76 /*****************************************************************************
77  * Will execute func on all scripts in luadirname, and stop if func returns
78  * success.
79  *****************************************************************************/
80 int vlclua_scripts_batch_execute( vlc_object_t *p_this, const char * luadirname,
81         int (*func)(vlc_object_t *, const char *, lua_State *, void *),
82         lua_State * p_state, void * user_data);
83
84
85
86 /*****************************************************************************
87  * Meta data setters utility.
88  *****************************************************************************/
89 void vlclua_read_meta_data( vlc_object_t *p_this,
90         lua_State *p_state, int o, int t, input_item_t *p_input );
91
92
93 void vlclua_read_custom_meta_data( vlc_object_t *p_this,
94         lua_State *p_state, int o, int t, input_item_t *p_input );
95
96 #endif /* VLC_LUA_H */
97