diff options
author | Christopher Davis <loafier@gmail.com> | 2006-06-19 12:25:06 +0000 |
---|---|---|
committer | Christopher Davis <loafier@gmail.com> | 2006-06-19 12:25:06 +0000 |
commit | bb48c914c6239ed1dbcb29eb62d33d3ab91e7215 (patch) | |
tree | 0b6910959f96f683f3aa11a8e2f53572e42b3305 /objects/pyscript-object.h | |
parent | efef73ae301947875602d67d0979a8ce3bd57dd0 (diff) | |
download | irssi-python-bb48c914c6239ed1dbcb29eb62d33d3ab91e7215.tar.gz irssi-python-bb48c914c6239ed1dbcb29eb62d33d3ab91e7215.tar.xz irssi-python-bb48c914c6239ed1dbcb29eb62d33d3ab91e7215.zip |
initial import
git-svn-id: http://svn.irssi.org/repos/irssi-python@4282 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'objects/pyscript-object.h')
-rw-r--r-- | objects/pyscript-object.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/objects/pyscript-object.h b/objects/pyscript-object.h new file mode 100644 index 0000000..260c6da --- /dev/null +++ b/objects/pyscript-object.h @@ -0,0 +1,25 @@ +#ifndef _PYSCRIPT_OBJECT_H_ +#define _PYSCRIPT_OBJECT_H_ +#include <Python.h> +#include <glib.h> + +typedef struct { + PyObject_HEAD + PyObject *module; /* module object */ + PyObject *argv; /* list of argument strings from the load command */ + PyObject *modules; /* dict of imported modules for script */ + GSList *signals; /* list of bound signals and commands */ +} PyScript; + +extern PyTypeObject PyScriptType; + +int pyscript_init(void); +PyObject *pyscript_new(PyObject *module, char **argv); +void pyscript_remove_signals(PyObject *script); +void pyscript_clear_modules(PyObject *script); +#define pyscript_check(op) PyObject_TypeCheck(op, &PyScriptType) +#define pyscript_get_name(scr) PyModule_GetName(((PyScript*)scr)->module) +#define pyscript_get_filename(scr) PyModule_GetFilename(((PyScript*)scr)->module) +#define pyscript_get_module(scr) ((PyScript*)scr)->module + +#endif |