Improved some error messages for command line processing.
[python/dscho.git] / Modules / cryptmodule.c
blob1498bb074573289199625156d9992d450fc0aae3
1 /* cryptmodule.c - by Steve Majewski
2 */
4 #include "Python.h"
6 #include <sys/types.h>
9 /* Module crypt */
12 static PyObject *crypt_crypt(self, args)
13 PyObject *self, *args;
15 char *word, *salt;
16 extern char * crypt();
18 if (!PyArg_Parse(args, "(ss)", &word, &salt)) {
19 return NULL;
21 return PyString_FromString( crypt( word, salt ) );
25 static PyMethodDef crypt_methods[] = {
26 {"crypt", crypt_crypt},
27 {NULL, NULL} /* sentinel */
30 void
31 initcrypt()
33 Py_InitModule("crypt", crypt_methods);