Miscellaneous constification.
[u/mdw/catacomb] / key-flags.c
index 7840462..d80da4f 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: key-flags.c,v 1.2 2000/02/12 18:21:02 mdw Exp $
+ * $Id: key-flags.c,v 1.4 2004/04/02 01:03:49 mdw Exp $
  *
  * Reading and writing key flag strings
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: key-flags.c,v $
+ * Revision 1.4  2004/04/02 01:03:49  mdw
+ * Miscellaneous constification.
+ *
+ * Revision 1.3  2004/03/28 01:58:47  mdw
+ * Generate, store and retreive elliptic curve keys.
+ *
  * Revision 1.2  2000/02/12 18:21:02  mdw
  * Overhaul of key management (again).
  *
@@ -63,7 +69,7 @@ typedef struct flagent {
   unsigned m;
 } flagent;
 
-static flagent flagtab[] = {
+static const flagent flagtab[] = {
 
   /* --- Encoding types --- */
 
@@ -71,6 +77,8 @@ static flagent flagtab[] = {
   { "integer",         KENC_MP,        KF_ENCMASK },
   { "struct",          KENC_STRUCT,    KF_ENCMASK },
   { "encrypt",         KENC_ENCRYPT,   KF_ENCMASK },
+  { "string",          KENC_STRING,    KF_ENCMASK },
+  { "ec",              KENC_EC,        KF_ENCMASK },
 
   /* --- Classes of keys --- */
 
@@ -111,7 +119,7 @@ int key_readflags(const char *p, char **pp, unsigned *ff, unsigned *mm)
 
   for (;;) {
     size_t sz = strcspn(p, ",:");
-    flagent *e, *ee = 0;
+    const flagent *e, *ee = 0;
 
     /* --- Look up the string in the flags table --- */
 
@@ -165,7 +173,7 @@ int key_readflags(const char *p, char **pp, unsigned *ff, unsigned *mm)
 void key_writeflags(unsigned f, dstr *d)
 {
   int del = 0;
-  flagent *e;
+  const flagent *e;
   unsigned m = 0;
 
   for (e = flagtab; e->name; e++) {