Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: fa38b3ee749388386914a6584b4c7d97aa474abe authored by cvs2svn on 22 December 1998, 21:43:35 UTC
This commit was manufactured by cvs2svn to create tag 'r152b1'.
Tip revision: fa38b3e
cryptmodule.c
/* cryptmodule.c - by Steve Majewski
 */

#include "Python.h"

#include <sys/types.h>


/* Module crypt */


static PyObject *crypt_crypt(self, args)
	PyObject *self, *args;
{
	char *word, *salt; 
	extern char * crypt();

	if (!PyArg_Parse(args, "(ss)", &word, &salt)) {
		return NULL;
	}
	return PyString_FromString( crypt( word, salt ) );

}

static PyMethodDef crypt_methods[] = {
	{"crypt",	crypt_crypt},
	{NULL,		NULL}		/* sentinel */
};

DL_EXPORT(void)
initcrypt()
{
	Py_InitModule("crypt", crypt_methods);
}
back to top