Much wider support for Catacomb in all its glory.
[catacomb-perl] / catacomb.xs
index fb4db58..5bcc441 100644 (file)
@@ -1,6 +1,6 @@
 /* ---?---
  *
- * $Id: catacomb.xs,v 1.1 2004/04/02 18:04:01 mdw Exp $
+ * $Id$
  *
  * Main interface to Catacomb functionality
  *
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------* 
- *
- * $Log: catacomb.xs,v $
- * Revision 1.1  2004/04/02 18:04:01  mdw
- * Initial checkin.
- *
- */
-
 #include "catacomb-perl.h"
 
+const struct consttab ct[] = {
+#define C(x) { #x, x }
+  C(GRAND_CRYPTO),
+  C(PGEN_BEGIN), C(PGEN_TRY), C(PGEN_FAIL), C(PGEN_PASS),
+    C(PGEN_DONE), C(PGEN_ABORT),
+  C(DH_SUBGROUP),
+  C(KF_ENCMASK), C(KENC_BINARY), C(KENC_MP), C(KENC_STRUCT), 
+    C(KENC_ENCRYPT), C(KENC_STRING), C(KENC_EC),
+  C(KF_CATMASK), C(KCAT_SYMM), C(KCAT_PRIV), C(KCAT_PUB),
+    C(KCAT_SHARE), C(KF_NONSECRET),
+  C(KF_BURN), C(KF_TEMP), C(KF_OPT),
+  C(KOPEN_READ), C(KOPEN_WRITE), C(KOPEN_MASK), C(KOPEN_NOFILE),
+  C(KEXP_FOREVER), C(KEXP_EXPIRE),
+  C(KERR_OK), C(KERR_BADTAG), C(KERR_BADTYPE), C(KERR_BADCOMMENT),
+    C(KERR_DUPID), C(KERR_DUPTAG), C(KERR_READONLY), 
+    C(KERR_WILLEXPIRE), C(KERR_EXPIRED), C(KERR_BADFLAGS),
+    C(KERR_BADPASS), C(KERR_WRONGTYPE), C(KERR_NOTFOUND),
+    C(KERR_NOTFOUND), C(KERR_BADATTR), C(KERR_MALFORMED),
+    C(KERR_IO),
+  C(KWRITE_OK), C(KWRITE_FAIL), C(KWRITE_BROKEN),
+  C(FTY_PRIME), C(FTY_BINARY),
+#undef C
+  { 0,                         0 },
+};
+
 MODULE = Catacomb PACKAGE = Catacomb
 
 U32
-const(name)
+_const(name)
        char *name
        PREINIT:
-       const struct consttab ct[] = {
-#define C(x) { #x, x }
-         C(GRAND_CRYPTO),
-         C(PGEN_BEGIN), C(PGEN_TRY), C(PGEN_FAIL), C(PGEN_PASS),
-         C(PGEN_DONE), C(PGEN_ABORT),
-#undef C
-         { 0,                          0 },
-       };
        CODE:
        RETVAL = findconst(ct, "Catacomb", name);
        OUTPUT:
        RETVAL
 
+void
+_constants()
+       PREINIT:
+       int i;
+       PPCODE:
+       for (i = 0; ct[i].name; i++)
+         XPUSHs(sv_2mortal(newSVpv(ct[i].name, 0)));
+
+void
+list(name)
+       const char *name
+       PPCODE:
+       PUTBACK;
+       names(name);
+       SPAGAIN;
+
 PROTOTYPES: DISABLE
 
 INCLUDE: algorithms.xs
 INCLUDE: mp.xs
+INCLUDE: gf.xs
+INCLUDE: field.xs
+INCLUDE: ec.xs
+INCLUDE: group.xs
+INCLUDE: pubkey.xs
 INCLUDE: misc.xs
 INCLUDE: pgen.xs
+INCLUDE: key.xs