Commit e9cf8998 authored by Emmanuel Arias's avatar Emmanuel Arias

New upstream version 3.5

parent 5c89a664
Version 3.4 -> 3.5
------------------
- fixed bug PYLUCENE-46
Version 3.3 -> 3.4
------------------
- added NAN to the list of reserved words
Version 3.2 -> 3.3
------------------
- fixed bug PYLUCENE-43
- fixed bug PYLUCENE-41
Version 3.1 -> 3.2
------------------
- added missing 'const' breaking build with Python 3.7 (Aric Coady)
- fixed bug with not skipping META-INF/ entries in .jar files
Version 3.0 -> 3.1
------------------
- fixed bug PYLUCENE-36 (Paulo Villegas)
- reworked type construction to use PyType_FromSpecWithBases (Python 3)
- added 'm' suffix to linux -lpython statement for shared jcc lib
- fixed bug with using split instead of rpartition on path (Petrus Hyvnen)
- fixed bug PYLUCENE-38 (Aric Coady)
- fixed bug PYLUCENE-39
Version 2.23 -> 3.0
-------------------
- added support for Python 3 (3.3+) (with Rdiger Meier and Thomas Koch)
......
Please see doc/jcc/documentation/install.html or
http://lucene.apache.org/pylucene/jcc/install.html
Please see http://lucene.apache.org/pylucene/jcc/install.html
Metadata-Version: 1.1
Name: JCC
Version: 3.0
Version: 3.5
Summary: a C++ code generator for calling Java from C++/Python
Home-page: UNKNOWN
Author: Andi Vajda
......
Metadata-Version: 1.1
Name: JCC
Version: 3.0
Version: 3.5
Summary: a C++ code generator for calling Java from C++/Python
Home-page: UNKNOWN
Author: Andi Vajda
......
......@@ -18,7 +18,7 @@
#include "java/lang/RuntimeException.h"
#include "macros.h"
extern PyTypeObject PY_TYPE(JObject), PY_TYPE(ConstVariableDescriptor);
extern PyTypeObject *PY_TYPE(JObject), *PY_TYPE(ConstVariableDescriptor);
PyObject *initJCC(PyObject *module);
PyObject *initVM(PyObject *self, PyObject *args, PyObject *kwds);
......@@ -70,8 +70,10 @@ static struct PyModuleDef _jccmodule = {
initJCC(m);
INSTALL_TYPE(JObject, m);
INSTALL_TYPE(ConstVariableDescriptor, m);
INSTALL_STATIC_TYPE(JObject, m);
PY_TYPE_DEF(JObject).type = PY_TYPE(JObject);
INSTALL_STATIC_TYPE(ConstVariableDescriptor, m);
java::lang::__install__(m);
java::io::__install__(m);
......
......@@ -67,9 +67,18 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(PrintWriter, t_PrintWriter, Writer,
java::io::PrintWriter, t_PrintWriter_init,
0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(PrintWriter)[] = {
{ Py_tp_methods, t_PrintWriter__methods_ },
{ Py_tp_init, (void *) t_PrintWriter_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(PrintWriter)[] = {
&PY_TYPE_DEF(Writer),
NULL
};
DEFINE_TYPE(PrintWriter, t_PrintWriter, java::io::PrintWriter);
static int t_PrintWriter_init(t_PrintWriter *self,
PyObject *args, PyObject *kwds)
......
......@@ -35,7 +35,7 @@ namespace java {
PrintWriter(const PrintWriter& obj) : Writer(obj) {}
};
extern PyTypeObject PY_TYPE(PrintWriter);
DECLARE_TYPE(PrintWriter);
class t_PrintWriter {
public:
......
......@@ -66,9 +66,18 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(StringWriter, t_StringWriter, Writer,
java::io::StringWriter, t_StringWriter_init,
0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(StringWriter)[] = {
{ Py_tp_methods, t_StringWriter__methods_ },
{ Py_tp_init, (void *) t_StringWriter_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(StringWriter)[] = {
&PY_TYPE_DEF(Writer),
NULL
};
DEFINE_TYPE(StringWriter, t_StringWriter, java::io::StringWriter);
static int t_StringWriter_init(t_StringWriter *self,
PyObject *args, PyObject *kwds)
......@@ -81,7 +90,7 @@ namespace java {
PyErr_SetString(PyExc_ValueError, "invalid args");
return -1;
}
return 0;
}
}
......
......@@ -35,7 +35,7 @@ namespace java {
StringWriter(const StringWriter& obj) : Writer(obj) {}
};
extern PyTypeObject PY_TYPE(StringWriter);
DECLARE_TYPE(StringWriter);
class t_StringWriter {
public:
......
......@@ -57,7 +57,17 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Writer, t_Writer, java::lang::Object, Writer,
abstract_init, 0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(Writer)[] = {
{ Py_tp_methods, t_Writer__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Writer)[] = {
&PY_TYPE_DEF(java::lang::Object),
NULL
};
DEFINE_TYPE(Writer, t_Writer, java::io::Writer);
}
}
......@@ -18,7 +18,6 @@
#include <Python.h>
#include "java/lang/Object.h"
#include "java/lang/Class.h"
#include "JArray.h"
namespace java {
namespace io {
......@@ -34,7 +33,7 @@ namespace java {
}
};
extern PyTypeObject PY_TYPE(Writer);
DECLARE_TYPE(Writer);
class t_Writer {
public:
......
......@@ -15,13 +15,16 @@
#include <Python.h>
#include "macros.h"
void installType(PyTypeObject **type, PyType_Def *def, PyObject *module,
char *name, int isExtension);
namespace java {
namespace io {
extern PyTypeObject PY_TYPE(Writer);
extern PyTypeObject PY_TYPE(StringWriter);
extern PyTypeObject PY_TYPE(PrintWriter);
DECLARE_TYPE(Writer);
DECLARE_TYPE(StringWriter);
DECLARE_TYPE(PrintWriter);
namespace reflect {
void __install__(PyObject *module);
}
......
......@@ -32,7 +32,7 @@ namespace java {
Boolean *Boolean::TRUE = NULL;
Boolean *Boolean::FALSE = NULL;
jclass Boolean::initializeClass(bool getOnly)
{
if (getOnly)
......@@ -77,7 +77,17 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Boolean, t_Boolean, Object, java::lang::Boolean,
abstract_init, 0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(Boolean)[] = {
{ Py_tp_methods, t_Boolean__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Boolean)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Boolean, t_Boolean, java::lang::Boolean);
}
}
......@@ -39,7 +39,7 @@ namespace java {
static Boolean *FALSE;
};
extern PyTypeObject PY_TYPE(Boolean);
DECLARE_TYPE(Boolean);
class t_Boolean {
public:
......
......@@ -71,7 +71,17 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Byte, t_Byte, Object, java::lang::Byte,
abstract_init, 0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(Byte)[] = {
{ Py_tp_methods, t_Byte__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Byte)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Byte, t_Byte, java::lang::Byte);
}
}
......@@ -36,7 +36,7 @@ namespace java {
jbyte byteValue() const;
};
extern PyTypeObject PY_TYPE(Byte);
DECLARE_TYPE(Byte);
class t_Byte {
public:
......
......@@ -71,7 +71,17 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Character, t_Character, Object, java::lang::Character,
abstract_init, 0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(Character)[] = {
{ Py_tp_methods, t_Character__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Character)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Character, t_Character, java::lang::Character);
}
}
......@@ -36,7 +36,7 @@ namespace java {
jchar charValue() const;
};
extern PyTypeObject PY_TYPE(Character);
DECLARE_TYPE(Character);
class t_Character {
public:
......
......@@ -367,8 +367,19 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Class, t_Class, Object, java::lang::Class,
abstract_init, 0, 0, t_Class__fields_, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(Class)[] = {
{ Py_tp_methods, t_Class__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ Py_tp_getset, t_Class__fields_ },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Class)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Class, t_Class, java::lang::Class);
#ifdef _java_generics
PyObject *t_Class::wrap_Object(const Class& object, PyTypeObject *T)
......@@ -511,7 +522,7 @@ namespace java {
static PyObject *t_Class_isAssignableFrom(t_Class *self, PyObject *arg)
{
if (!PyObject_TypeCheck(arg, &PY_TYPE(Class)))
if (!PyObject_TypeCheck(arg, PY_TYPE(Class)))
{
PyErr_SetObject(PyExc_TypeError, arg);
return NULL;
......
......@@ -71,7 +71,7 @@ namespace java {
#endif
};
extern PyTypeObject PY_TYPE(Class);
DECLARE_TYPE(Class);
class t_Class {
public:
......
......@@ -29,7 +29,7 @@ namespace java {
Class *Double::class$ = NULL;
jmethodID *Double::_mids = NULL;
jclass Double::initializeClass(bool getOnly)
{
if (getOnly)
......@@ -71,7 +71,17 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Double, t_Double, Object, java::lang::Double,
abstract_init, 0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(Double)[] = {
{ Py_tp_methods, t_Double__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Double)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Double, t_Double, java::lang::Double);
}
}
......@@ -36,7 +36,7 @@ namespace java {
jdouble doubleValue() const;
};
extern PyTypeObject PY_TYPE(Double);
DECLARE_TYPE(Double);
class t_Double {
public:
......
......@@ -56,7 +56,17 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Exception, t_Exception, Throwable, Exception,
abstract_init, 0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(Exception)[] = {
{ Py_tp_methods, t_Exception__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Exception)[] = {
&PY_TYPE_DEF(Throwable),
NULL
};
DEFINE_TYPE(Exception, t_Exception, java::lang::Exception);
}
}
......@@ -34,7 +34,7 @@ namespace java {
}
};
extern PyTypeObject PY_TYPE(Exception);
DECLARE_TYPE(Exception);
class t_Exception {
public:
......
......@@ -71,7 +71,17 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Float, t_Float, Object, java::lang::Float,
abstract_init, 0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(Float)[] = {
{ Py_tp_methods, t_Float__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Float)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Float, t_Float, java::lang::Float);
}
}
......@@ -36,7 +36,7 @@ namespace java {
jfloat floatValue() const;
};
extern PyTypeObject PY_TYPE(Float);
DECLARE_TYPE(Float);
class t_Float {
public:
......
......@@ -29,7 +29,7 @@ namespace java {
Class *Integer::class$ = NULL;
jmethodID *Integer::_mids = NULL;
jclass Integer::initializeClass(bool getOnly)
{
if (getOnly)
......@@ -71,7 +71,17 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Integer, t_Integer, Object, java::lang::Integer,
abstract_init, 0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(Integer)[] = {
{ Py_tp_methods, t_Integer__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Integer)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Integer, t_Integer, java::lang::Integer);
}
}
......@@ -36,7 +36,7 @@ namespace java {
jint intValue() const;
};
extern PyTypeObject PY_TYPE(Integer);
DECLARE_TYPE(Integer);
class t_Integer {
public:
......
......@@ -29,7 +29,7 @@ namespace java {
Class *Long::class$ = NULL;
jmethodID *Long::_mids = NULL;
jclass Long::initializeClass(bool getOnly)
{
if (getOnly)
......@@ -71,7 +71,17 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Long, t_Long, Object, java::lang::Long,
abstract_init, 0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(Long)[] = {
{ Py_tp_methods, t_Long__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Long)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Long, t_Long, java::lang::Long);
}
}
......@@ -36,7 +36,7 @@ namespace java {
jlong longValue() const;
};
extern PyTypeObject PY_TYPE(Long);
DECLARE_TYPE(Long);
class t_Long {
public:
......
......@@ -103,8 +103,18 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Object, t_Object, JObject, java::lang::Object,
t_Object_init, 0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(Object)[] = {
{ Py_tp_methods, t_Object__methods_ },
{ Py_tp_init, (void *) t_Object_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Object)[] = {
&PY_TYPE_DEF(JObject),
NULL
};
DEFINE_TYPE(Object, t_Object, java::lang::Object);
static int t_Object_init(t_Object *self,
PyObject *args, PyObject *kwds)
......@@ -117,7 +127,7 @@ namespace java {
PyErr_SetString(PyExc_ValueError, "invalid args");
return -1;
}
return 0;
}
......
......@@ -40,7 +40,7 @@ namespace java {
jboolean equals(const Object& obj) const;
};
extern PyTypeObject PY_TYPE(Object);
DECLARE_TYPE(Object);
class t_Object {
public:
......
......@@ -58,8 +58,18 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(RuntimeException, t_RuntimeException, Object,
java::lang::RuntimeException, abstract_init,
0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(RuntimeException)[] = {
{ Py_tp_methods, t_RuntimeException__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(RuntimeException)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(RuntimeException, t_RuntimeException,
java::lang::RuntimeException);
}
}
......@@ -34,7 +34,7 @@ namespace java {
}
};
extern PyTypeObject PY_TYPE(RuntimeException);
DECLARE_TYPE(RuntimeException);
class t_RuntimeException {
public:
......
......@@ -71,7 +71,17 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Short, t_Short, Object, java::lang::Short,
abstract_init, 0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(Short)[] = {
{ Py_tp_methods, t_Short__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Short)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Short, t_Short, java::lang::Short);
}
}
......@@ -36,7 +36,7 @@ namespace java {
jshort shortValue() const;
};
extern PyTypeObject PY_TYPE(Short);
DECLARE_TYPE(Short);
class t_Short {
public:
......
......@@ -84,8 +84,18 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(String, t_String, Object, java::lang::String,
t_String_init, 0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(String)[] = {
{ Py_tp_methods, t_String__methods_ },
{ Py_tp_init, (void *) t_String_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(String)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(String, t_String, java::lang::String);
static int t_String_init(t_String *self,
PyObject *args, PyObject *kwds)
......
......@@ -41,7 +41,7 @@ namespace java {
int length() const;
};
extern PyTypeObject PY_TYPE(String);
DECLARE_TYPE(String);
class t_String {
public:
......
......@@ -68,7 +68,7 @@ namespace java {
env->callVoidMethod(this$, _mids[mid_printStackTrace_1],
writer.this$);
}
String Throwable::getMessage() const
{
return String(env->callObjectMethod(this$, _mids[mid_getMessage]));
......@@ -92,8 +92,18 @@ namespace java {
{ NULL, NULL, 0, NULL }
};
DECLARE_TYPE(Throwable, t_Throwable, Object, Throwable,
abstract_init, 0, 0, 0, 0, 0);
static PyType_Slot PY_TYPE_SLOTS(Throwable)[] = {
{ Py_tp_methods, t_Throwable__methods_ },
{ Py_tp_init, (void *) abstract_init },
{ 0, 0 }
};
static PyType_Def *PY_TYPE_BASES(Throwable)[] = {
&PY_TYPE_DEF(Object),
NULL
};
DEFINE_TYPE(Throwable, t_Throwable, Throwable);
static PyObject *t_Throwable_printStackTrace(t_Throwable *self,
PyObject *args)
......
......@@ -44,7 +44,7 @@ namespace java {
String getMessage() const;
};
extern PyTypeObject PY_TYPE(Throwable);
DECLARE_TYPE(Throwable);
class t_Throwable {
public:
......
......@@ -15,24 +15,27 @@
#include <Python.h>
#include "macros.h"
void installType(PyTypeObject **type, PyType_Def *def, PyObject *module,
char *name, int isExtension);