[Numpy-svn] r4008 - branches/py3k/Modules
numpy-svn at scipy.org
numpy-svn at scipy.org
Fri Aug 24 16:35:59 EDT 2007
Author: chris.burns
Date: 2007-08-24 15:35:55 -0500 (Fri, 24 Aug 2007)
New Revision: 4008
Modified:
branches/py3k/Modules/_struct.c
Log:
Finished adding function stubs for new format descriptors. Included PyExc_NotImplementedError error strings for each stub.
Modified: branches/py3k/Modules/_struct.c
===================================================================
--- branches/py3k/Modules/_struct.c 2007-08-24 20:32:57 UTC (rev 4007)
+++ branches/py3k/Modules/_struct.c 2007-08-24 20:35:55 UTC (rev 4008)
@@ -484,14 +484,18 @@
static PyObject *
unpack_bit(const char *p, const formatdef *f, const formatcode *c)
{
- return NULL;
+ PyErr_SetString(PyExc_NotImplementedError,
+ "unpack_bit is not implemented.");
+ return NULL;
}
static int
pack_bit(char *p, PyObject *obj, const struct _formatdef *f,
const struct _formatcode *c)
{
- return 0;
+ PyErr_SetString(PyExc_NotImplementedError,
+ "pack_bit is not implemented.");
+ return -1;
}
@@ -562,6 +566,8 @@
static PyObject *
unpack_ucs2(const char *p, const formatdef *f, const formatcode *c)
{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "unpack_uc2 is not implemented.");
return NULL;
}
@@ -569,13 +575,17 @@
static int
pack_ucs2(char *p, PyObject *obj, const formatdef *f, const formatcode *c)
{
- return 0;
+ PyErr_SetString(PyExc_NotImplementedError,
+ "pack_uc2 is not implemented.");
+ return -1;
}
/* XXX Function Stub */
static PyObject *
unpack_ucs4(const char *p, const formatdef *f, const formatcode *c)
{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "unpack_ucs4 is not implemented.");
return NULL;
}
@@ -583,24 +593,12 @@
static int
pack_ucs4(char *p, PyObject *obj, const formatdef *f, const formatcode *c)
{
- return 0;
+ PyErr_SetString(PyExc_NotImplementedError,
+ "pack_ucs4 is not implemented.");
+ return -1;
}
-/* XXX Function Stub */
-static PyObject *
-unpack_longdouble(const char *p, const formatdef *f, const formatcode *c)
-{
- return NULL;
-}
-/* XXX Function Stub */
-static int
-pack_longdouble(char *p, PyObject *obj, const formatdef *f, const formatcode *c)
-{
- return 0;
-}
-
-
/***************
HELPER ROUTINES for big-endian un-packing
@@ -1478,7 +1476,152 @@
}
}
+/* XXX Function Stub */
+static PyObject *
+unpack_longdouble(const char *p, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "unpack_longdouble is not implemented.");
+ return NULL;
+}
+
+/* XXX Function Stub */
+static int
+pack_longdouble(char *p, PyObject *obj, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "pack_longdouble is not implemented.");
+ return -1;
+}
+
+/* XXX Function Stub */
+static PyObject *
+unpack_cmplx(const char *p, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "unpack_cmplx is not implemented.");
+ return NULL;
+}
+
+/* XXX Function Stub */
+static int
+pack_cmplx(char *p, PyObject *obj, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "pack_cmplx is not implemented.");
+ return -1;
+}
+
+/* XXX Function Stub */
+static PyObject *
+unpack_gptr(const char *p, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "unpack_gptr is not implemented.");
+ return NULL;
+}
+
+/* XXX Function Stub */
+static int
+pack_gptr(char *p, PyObject *obj, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "pack_gptr is not implemented.");
+ return -1;
+}
+
+/* XXX Function Stub */
+static PyObject *
+unpack_array(const char *p, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "unpack_array is not implemented.");
+ return NULL;
+}
+
+/* XXX Function Stub */
+static int
+pack_array(char *p, PyObject *obj, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "pack_array is not implemented.");
+ return -1;
+}
+
+/* XXX Function Stub */
+static PyObject *
+unpack_void_ptr(const char *p, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "unpack_void_ptr is not implemented.");
+ return NULL;
+}
+
+/* XXX Function Stub */
+static int
+pack_void_ptr(char *p, PyObject *obj, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "pack_void_ptr is not implemented.");
+ return -1;
+}
+
+/* XXX Function Stub */
+static PyObject *
+unpack_object_ptr(const char *p, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "unpack_object_ptr is not implemented.");
+ return NULL;
+}
+
+/* XXX Function Stub */
+static int
+pack_object_ptr(char *p, PyObject *obj, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "pack_object_ptr is not implemented.");
+ return -1;
+}
+
+/* XXX Function Stub */
+static PyObject *
+unpack_struct(const char *p, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "unpack_struct is not implemented.");
+ return NULL;
+}
+
+/* XXX Function Stub */
+static int
+pack_struct(char *p, PyObject *obj, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "pack_struct is not implemented.");
+ return -1;
+}
+
+/* XXX Function Stub */
+static PyObject *
+unpack_funcptr(const char *p, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "unpack_funcPtr is not implemented.");
+ return NULL;
+}
+
+/* XXX Function Stub */
+static int
+pack_funcptr(char *p, PyObject *obj, const formatdef *f, const formatcode *c)
+{
+ PyErr_SetString(PyExc_NotImplementedError,
+ "pack_funcptr is not implemented.");
+ return -1;
+}
+
+
/* There is only one un-packing and packing table,
to allow switching of the endian-ness within a struct
native, little-endian, and big-endian packing
More information about the Numpy-svn
mailing list