blob: 9cdcac8b56fc180b5c1a4e8dcf228b09b7161559 [file] [log] [blame]
Guido van Rossume4c61311994-05-06 14:25:39 +00001/* cryptmodule.c - by Steve Majewski
2 */
3
4#include "allobjects.h"
5#include "modsupport.h"
6
7#include <sys/types.h>
8
9
10/* Module crypt */
11
12
13static object *crypt_crypt(self, args)
14 object *self, *args;
15{
16 char *word, *salt;
17 extern char * crypt();
18
19 struct passwd *p;
20 if (!getargs(args, "(ss)", &word, &salt)) {
21 return NULL;
22 }
23 return newstringobject( crypt( word, salt ) );
24
25}
26
27static struct methodlist crypt_methods[] = {
28 {"crypt", crypt_crypt},
29 {NULL, NULL} /* sentinel */
30};
31
32void
33initcrypt()
34{
35 initmodule("crypt", crypt_methods);
36}