| 1974 | |
| 1975 | |
| 1976 | NPY_NO_EXPORT PyObject * |
| 1977 | io_pack(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds) |
| 1978 | { |
| 1979 | PyObject *obj; |
| 1980 | int axis = NPY_MAXDIMS; |
| 1981 | static char *kwlist[] = {"in", "axis", "bitorder", NULL}; |
| 1982 | char c = 'b'; |
| 1983 | const char * order_str = NULL; |
| 1984 | |
| 1985 | if (!PyArg_ParseTupleAndKeywords( args, kwds, "O|O&s:pack" , kwlist, |
| 1986 | &obj, PyArray_AxisConverter, &axis, &order_str)) { |
| 1987 | return NULL; |
| 1988 | } |
| 1989 | if (order_str != NULL) { |
| 1990 | if (strncmp(order_str, "little", 6) == 0) |
| 1991 | c = 'l'; |
| 1992 | else if (strncmp(order_str, "big", 3) == 0) |
| 1993 | c = 'b'; |
| 1994 | else { |
| 1995 | PyErr_SetString(PyExc_ValueError, |
| 1996 | "'order' must be either 'little' or 'big'"); |
| 1997 | return NULL; |
| 1998 | } |
| 1999 | } |
| 2000 | return pack_bits(obj, axis, c); |
| 2001 | } |
| 2002 | |
| 2003 | |
| 2004 | NPY_NO_EXPORT PyObject * |
nothing calls this directly
no test coverage detected