improve treatment of multi-line replies, ignore empty lines
[python/dscho.git] / Modules / cryptmodule.c
blob13c79ba527bee83e9cad9bfee2141d405cb0dea5
1 /* cryptmodule.c - by Steve Majewski
2 */
4 #include "allobjects.h"
6 #include <sys/types.h>
9 /* Module crypt */
12 static object *crypt_crypt(self, args)
13 object *self, *args;
15 char *word, *salt;
16 extern char * crypt();
18 struct passwd *p;
19 if (!getargs(args, "(ss)", &word, &salt)) {
20 return NULL;
22 return newstringobject( crypt( word, salt ) );
26 static struct methodlist crypt_methods[] = {
27 {"crypt", crypt_crypt},
28 {NULL, NULL} /* sentinel */
31 void
32 initcrypt()
34 initmodule("crypt", crypt_methods);