r1470@localhost: muntyan | 2005-12-22 21:30:27 -0600

Added version argument to moo_python_init()
master
Yevgen Muntyan 2005-12-23 14:32:32 +00:00
parent cf40c4d6d0
commit 5856c7342e
6 changed files with 23 additions and 12 deletions

View File

@ -23,7 +23,7 @@
#include "mooedit/mooeditor.h"
#include "mooedit/mooplugin.h"
#include "mooedit/plugins/mooeditplugins.h"
#include "moopython/moopython.h"
#include "mooutils/moopython.h"
#include "mooutils/moomarshals.h"
#include "mooutils/moocompat.h"
#include "mooutils/moodialogs.h"

View File

@ -11,10 +11,6 @@ moopython_sources = \
$(moopython)/mooplugin-python.c \
$(moopython)/mooplugin-python.h
moo_sources += \
$(moopython)/moopython.c \
$(moopython)/moopython.h
if MOO_USE_PYGTK
moo_sources += $(moopython_sources)
endif

View File

@ -22,7 +22,7 @@
#include "moopython/mooplugin-python.h"
#include "moopython/moopython-utils.h"
#include "moopython/moopython.h"
#include "mooutils/moopython.h"
#include "moopython/pygtk/moo-pygtk.h"
#include "mooedit/mooplugin-macro.h"
@ -98,7 +98,9 @@ moo_python_api_init (void)
};
g_return_val_if_fail (!moo_python_running(), FALSE);
moo_python_init (&moo_py_api);
if (!moo_python_init (MOO_PY_API_VERSION, &moo_py_api))
return FALSE;
Py_Initialize ();

View File

@ -70,6 +70,8 @@ mooutils_sources = \
$(mooutils)/mooprefs.c \
$(mooutils)/mooprefsdialog.c \
$(mooutils)/mooprefsdialogpage.c \
$(mooutils)/moopython.c \
$(mooutils)/moopython.h \
$(mooutils)/moostock.c \
$(mooutils)/mootoggleaction.c \
$(mooutils)/moouixml.c \

View File

@ -1,5 +1,5 @@
/*
* mooapp/moopython.c
* mooutils/moopython.c
*
* Copyright (C) 2004-2005 by Yevgen Muntyan <muntyan@math.tamu.edu>
*
@ -11,12 +11,20 @@
* See COPYING file that comes with this distribution.
*/
#include "moopython/moopython.h"
#include "mooutils/moopython.h"
MooPyAPI *_moo_py_api = NULL;
void moo_python_init (MooPyAPI *api)
gboolean
moo_python_init (guint version,
MooPyAPI *api)
{
if (version != MOO_PY_API_VERSION)
return FALSE;
g_return_val_if_fail (!_moo_py_api || !api, FALSE);
_moo_py_api = api;
return TRUE;
}

View File

@ -1,5 +1,5 @@
/*
* moopython/moopython.h
* mooutils/moopython.h
*
* Copyright (C) 2004-2005 by Yevgen Muntyan <muntyan@math.tamu.edu>
*
@ -18,6 +18,8 @@
G_BEGIN_DECLS
#define MOO_PY_API_VERSION 87
typedef struct _MooPyAPI MooPyAPI;
typedef struct _MooPyObject MooPyObject;
@ -34,7 +36,8 @@ struct _MooPyAPI {
extern MooPyAPI *_moo_py_api;
void moo_python_init (MooPyAPI *api);
gboolean moo_python_init (guint version,
MooPyAPI *api);
#define moo_python_running() (_moo_py_api != NULL)