Staging
v0.5.1
https://github.com/python/cpython
Revision 0b56a3e9a78f3e49a6c4c17842e18c59bcf75cb4 authored by Guido van Rossum on 21 December 1998, 18:23:38 UTC, committed by Guido van Rossum on 21 December 1998, 18:23:38 UTC
yours, please let me know for propoer acknowledgement.)

This avoids recompiling files that haven't changed; it adds a -f
option to force recompilation.
1 parent 91c8f59
Raw File
Tip revision: 0b56a3e9a78f3e49a6c4c17842e18c59bcf75cb4 authored by Guido van Rossum on 21 December 1998, 18:23:38 UTC
A mod whose author I forget. (I must've mislaid the email. If it's
Tip revision: 0b56a3e
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