common.c 500 B

12345678910111213141516171819
  1. /* Miscellaneous common routines
  2. * See http://www.python-ldap.org/ for details.
  3. * $Id: common.c,v 1.3 2009/04/17 12:19:09 stroeder Exp $ */
  4. #include "common.h"
  5. /* dynamically add the methods into the module dictionary d */
  6. void
  7. LDAPadd_methods( PyObject* d, PyMethodDef* methods )
  8. {
  9. PyMethodDef *meth;
  10. for( meth = methods; meth->ml_meth; meth++ ) {
  11. PyObject *f = PyCFunction_New( meth, NULL );
  12. PyDict_SetItemString( d, meth->ml_name, f );
  13. Py_DECREF(f);
  14. }
  15. }