Uprating of the passphrase pixie.
[u/mdw/catacomb] / key.h
diff --git a/key.h b/key.h
index ada6260..aad448b 100644 (file)
--- a/key.h
+++ b/key.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: key.h,v 1.11 2004/04/08 01:36:15 mdw Exp $
+ * $Id$
  *
  * Simple key management
  *
 #include <mLib/hash.h>
 #include <mLib/sym.h>
 
+#ifndef CATACOMB_KEY_ERROR_H
+#  include "key-error.h"
+#endif
+
 #ifndef CATACOMB_KEY_DATA_H
 #  include "key-data.h"
 #endif
@@ -155,26 +159,6 @@ typedef struct key_fetchdef {
 #define KEXP_FOREVER ((time_t)-1)      /* Never expire this key */
 #define KEXP_EXPIRE ((time_t)-2)       /* Expire this key when unused */
 
-/* --- Key error codes --- */
-
-enum {
-  KERR_OK = 0,                         /* No error */
-  KERR_BADTAG = -1,                    /* Malformed tag string */
-  KERR_BADTYPE = -2,                   /* Malformed type string */
-  KERR_BADCOMMENT = -3,                        /* Malformed comment string */
-  KERR_DUPID = -4,                     /* Duplicate keyid */
-  KERR_DUPTAG = -5,                    /* Duplicate key tag string */
-  KERR_READONLY = -6,                  /* Key file is read-only */
-  KERR_WILLEXPIRE = -7,                        /* Key will eventually expire */
-  KERR_EXPIRED = -8,                   /* Key has already expired */
-  KERR_BADFLAGS = -9,                  /* Error in flags string */
-  KERR_BADPASS = -10,                  /* Error decrypting locked key */
-  KERR_WRONGTYPE = -11,                        /* Key has incorrect type */
-  KERR_NOTFOUND = -12,                 /* Key couldn't be found */
-  KERR_BADATTR = -13,                  /* Malformed attribute name */
-  KERR_MAX                             /* Largest possible error */
-};
-
 /* --- Write error codes --- */
 
 enum {
@@ -247,6 +231,17 @@ extern int key_extract(key_file */*f*/, key */*k*/, FILE */*fp*/,
 extern int key_open(key_file */*f*/, const char */*file*/, unsigned /*how*/,
                    key_reporter */*rep*/, void */*arg*/);
 
+/* --- @key_discard@ --- *
+ *
+ * Arguments:  @key_file *f@ = pointer to key file block
+ *
+ * Returns:    ---
+ *
+ * Use:                Frees all the key data, without writing changes.
+ */
+
+extern int key_discard(key_file */*f*/);
+
 /* --- @key_close@ --- *
  *
  * Arguments:  @key_file *f@ = pointer to key file block
@@ -686,17 +681,6 @@ extern void key_fetchdone(key_packdef */*kp*/);
 extern void key_moan(const char */*file*/, int /*line*/,
                     const char */*msg*/, void */*p*/);
 
-/* --- @key_strerror@ --- *
- *
- * Arguments:  @int err@ = error code from @key_new@
- *
- * Returns:    Pointer to error string.
- *
- * Use:                Translates a @KERR@ error code into a human-readable string.
- */
-
-extern const char *key_strerror(int /*err*/);
-
 /*----- That's all, folks -------------------------------------------------*/
 
 #ifdef __cplusplus