2010-09-25 16:03:48 +02:00
|
|
|
/*
|
|
|
|
* ld-lua.h
|
|
|
|
*
|
|
|
|
* This file is a part of logdiag.
|
|
|
|
* Copyright Přemysl Janouch 2010. All rights reserved.
|
|
|
|
*
|
|
|
|
* See the file LICENSE for licensing information.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LD_LUA_H__
|
|
|
|
#define __LD_LUA_H__
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
2010-09-25 16:55:07 +02:00
|
|
|
#define LD_TYPE_LUA (ld_lua_get_type ())
|
|
|
|
#define LD_LUA(obj) (G_TYPE_CHECK_INSTANCE_CAST \
|
|
|
|
((obj), LD_TYPE_LUA, LdLua))
|
|
|
|
#define LD_LUA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \
|
|
|
|
((klass), LD_TYPE_LUA, LdLuaClass))
|
|
|
|
#define LD_IS_LUA(obj) (G_TYPE_CHECK_INSTANCE_TYPE \
|
|
|
|
((obj), LD_TYPE_LUA))
|
|
|
|
#define LD_IS_LUA_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE \
|
|
|
|
((klass), LD_TYPE_LUA))
|
|
|
|
#define LD_LUA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \
|
|
|
|
((obj), LD_LUA, LdLuaClass))
|
|
|
|
|
|
|
|
typedef struct _LdLua LdLua;
|
|
|
|
typedef struct _LdLuaPrivate LdLuaPrivate;
|
|
|
|
typedef struct _LdLuaClass LdLuaClass;
|
|
|
|
|
|
|
|
|
|
|
|
struct _LdLua
|
|
|
|
{
|
|
|
|
/*< private >*/
|
|
|
|
GObject parent_instance;
|
|
|
|
LdLuaPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* TODO: A virtual superclass, so other engines can be used. */
|
|
|
|
struct _LdLuaClass
|
|
|
|
{
|
2010-10-27 18:18:37 +02:00
|
|
|
/*< private >*/
|
2010-09-25 16:55:07 +02:00
|
|
|
GObjectClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-10-27 20:49:21 +02:00
|
|
|
/**
|
|
|
|
* LdLuaLoadCallback:
|
2011-01-28 17:39:40 +01:00
|
|
|
* @symbol: the symbol that has been created.
|
|
|
|
* @user_data: user data passed to ld_lua_load_file().
|
2010-10-27 20:49:21 +02:00
|
|
|
*
|
|
|
|
* A callback function that is called when a symbol is created.
|
|
|
|
*/
|
|
|
|
typedef void (*LdLuaLoadCallback) (LdSymbol *symbol, gpointer user_data);
|
|
|
|
|
|
|
|
|
2010-09-25 16:55:07 +02:00
|
|
|
GType ld_lua_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
LdLua *ld_lua_new (void);
|
2010-09-25 21:00:24 +02:00
|
|
|
gboolean ld_lua_check_file (LdLua *self, const gchar *filename);
|
2010-10-27 20:49:21 +02:00
|
|
|
gboolean ld_lua_load_file (LdLua *self, const gchar *filename,
|
|
|
|
LdLuaLoadCallback callback, gpointer user_data);
|
2010-09-25 16:03:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* ! __LD_LUA_H__ */
|
|
|
|
|