home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / Languages / Python / python-14-src / Modules / cryptmodule.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-17  |  500 b   |  35 lines

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