Staging
v0.5.1
https://github.com/python/cpython
Revision 79b5bb488e0d7579c5755cdb78d130a5f2b60330 authored by Jack Jansen on 13 May 1997, 11:28:03 UTC, committed by Jack Jansen on 13 May 1997, 11:28:03 UTC
1 parent 141f9a0
Raw File
Tip revision: 79b5bb488e0d7579c5755cdb78d130a5f2b60330 authored by Jack Jansen on 13 May 1997, 11:28:03 UTC
Export a few more New/Convert routines, on Just's request
Tip revision: 79b5bb4
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 */
};

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