0
0
mirror of https://github.com/python/cpython.git synced 2024-11-28 16:45:42 +01:00
cpython/Modules/cryptmodule.c

37 lines
543 B
C
Raw Normal View History

1994-05-06 16:25:39 +02:00
/* cryptmodule.c - by Steve Majewski
*/
#include "allobjects.h"
#include "modsupport.h"
#include <sys/types.h>
/* Module crypt */
static object *crypt_crypt(self, args)
object *self, *args;
{
char *word, *salt;
extern char * crypt();
struct passwd *p;
if (!getargs(args, "(ss)", &word, &salt)) {
return NULL;
}
return newstringobject( crypt( word, salt ) );
}
static struct methodlist crypt_methods[] = {
{"crypt", crypt_crypt},
{NULL, NULL} /* sentinel */
};
void
initcrypt()
{
initmodule("crypt", crypt_methods);
}