summaryrefslogtreecommitdiffstats
path: root/Modules/cryptmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-05-06 14:25:39 (GMT)
committerGuido van Rossum <guido@python.org>1994-05-06 14:25:39 (GMT)
commite4c6131baab4d09d31d280fa7dbca76cbe319dbb (patch)
tree496de5f4b88bc71b9326573a1e76438526cc2483 /Modules/cryptmodule.c
parent7a325c385bb547b481abfee8301e9d9f2e58990a (diff)
downloadcpython-e4c6131baab4d09d31d280fa7dbca76cbe319dbb.zip
cpython-e4c6131baab4d09d31d280fa7dbca76cbe319dbb.tar.gz
cpython-e4c6131baab4d09d31d280fa7dbca76cbe319dbb.tar.bz2
crypt module (Steve M's)
Diffstat (limited to 'Modules/cryptmodule.c')
-rw-r--r--Modules/cryptmodule.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/Modules/cryptmodule.c b/Modules/cryptmodule.c
new file mode 100644
index 0000000..9cdcac8
--- /dev/null
+++ b/Modules/cryptmodule.c
@@ -0,0 +1,36 @@
+/* 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);
+}