aboutsummaryrefslogtreecommitdiffstats
path: root/src/passphrase.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-12-05 00:53:23 +0100
committerMattias Andrée <maandree@operamail.com>2015-12-05 00:53:23 +0100
commit5aa11b712a9cf6279c41e6de93ee4d1355a0930b (patch)
treecd9fae9a0212f125637b1dbb9a9ebf8e0d90e94d /src/passphrase.h
parentaccept input from any fd (diff)
downloadlibpassphrase-5aa11b712a9cf6279c41e6de93ee4d1355a0930b.tar.gz
libpassphrase-5aa11b712a9cf6279c41e6de93ee4d1355a0930b.tar.bz2
libpassphrase-5aa11b712a9cf6279c41e6de93ee4d1355a0930b.tar.xz
accept flags
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/passphrase.h')
-rw-r--r--src/passphrase.h50
1 files changed, 49 insertions, 1 deletions
diff --git a/src/passphrase.h b/src/passphrase.h
index 24d4aa4..d24e66e 100644
--- a/src/passphrase.h
+++ b/src/passphrase.h
@@ -19,6 +19,8 @@
#ifndef PASSPHRASE_H
#define PASSPHRASE_H
+#include <stddef.h>
+
#if defined(__GNUC__) && !defined(PASSPHRASE_USE_DEPRECATED)
# define PASSPHRASE_DEPRECATED(MSG) __attribute__((__deprecated__(MSG)))
#else
@@ -28,6 +30,46 @@
/**
+ * `passphrase_read2` shall not do any thing
+ * special, just accept the passphrase. This should
+ * be used when getting authentication.
+ * Should not be combined with `PASSPHRASE_READ_NEW`.
+ */
+#define PASSPHRASE_READ_EXISTING 0
+
+/**
+ * `passphrase_read2` shall draw a pasphrase
+ * strenght meter if such capability is
+ * available. This should be used when create
+ * a new passphrase.
+ * Should not be combined with `PASSPHRASE_READ_EXISTING`.
+ */
+#define PASSPHRASE_READ_NEW 1
+
+/**
+ * `passphrase_read2` may do as it please with the
+ * the screen. This is only used if combined with
+ * `PASSPHRASE_READ_NEW` and not with
+ * `PASSPHRASE_READ_BELOW_FREE`. `passphrase_read2`
+ * will create make a line below the new current
+ * line and use that line to draw the passphrase
+ * strength meter if such capability is available.
+ */
+#define PASSPHRASE_READ_SCREEN_FREE 2
+
+/**
+ * `passphrase_read2` may do as it please with the
+ * line below the current line. This is only used
+ * if combined with `PASSPHRASE_READ_NEW`.
+ * `passphrase_read2` will draw the passphrase
+ * strength meter on the line below if such
+ * capability is available.
+ */
+#define PASSPHRASE_READ_BELOW_FREE 4
+
+
+
+/**
* Reads the passphrase from stdin
*
* @return The passphrase, should be wiped and `free`:ed, `NULL` on error
@@ -39,7 +81,13 @@ char* passphrase_read(void);
* Reads the passphrase
*
* @param fdin File descriptor for input
- * @param flags Settings
+ * @param flags Settings, a combination of the constants:
+ * * PASSPHRASE_READ_EXISTING
+ * * PASSPHRASE_READ_NEW
+ * * PASSPHRASE_READ_SCREEN_FREE
+ * * PASSPHRASE_READ_BELOW_FREE
+ * Invalid input is ignored, to make use the
+ * application will work.
* @return The passphrase, should be wiped and `free`:ed, `NULL` on error
*/
char* passphrase_read2(int, int);