#include "Python.h"
#include <curses.h>

/* Addition by Teemu Kalvas <chery@s2.org> */
static PyObject *PyCurses_Resizeterm(PyObject *self, PyObject *arg)
{
  int nlines, ncols;

#if 0
  if (!PyCursesInitialised())
    return NULL;
#endif
  if (!PyArg_Parse(arg,"(ii);nlines,ncols",&nlines,&ncols))
    return NULL;
  return Py_BuildValue("i", resizeterm(nlines, ncols));
}

/* List of functions defined in the module */

static PyMethodDef PyCurses_methods[] = {
  {"resizeterm", (PyCFunction)PyCurses_Resizeterm},
  {NULL, NULL}
};

/* Initialization function for the module */

void initresizeterm(void)
{
  PyObject *m;

  /* Create the module and add the functions */
  m = Py_InitModule("resizeterm", PyCurses_methods);

  /* Check for errors */
  if (PyErr_Occurred())
    Py_FatalError("can't initialize module curses");
}
