diff pwfile.c @ 22:ec01c579024a

Add fully interactive mode
author Guido Berhoerster <guido+pwm@berhoerster.name>
date Thu, 07 Sep 2017 12:40:50 +0200
parents efef93e54c5f
children
line wrap: on
line diff
--- a/pwfile.c	Wed Sep 06 16:41:58 2017 +0200
+++ b/pwfile.c	Thu Sep 07 12:40:50 2017 +0200
@@ -827,7 +827,7 @@
 }
 
 int
-pwfile_create_record(struct pwm_ctx *ctx, struct record *record)
+pwfile_create_pws_record(struct pwm_ctx *ctx, struct record *record)
 {
 	struct pws3_record *pws3_record;
 	const unsigned char *uuid;
@@ -853,7 +853,7 @@
 }
 
 int
-pwfile_modify_record(struct pwm_ctx *ctx, unsigned int id,
+pwfile_modify_pws_record(struct pwm_ctx *ctx, unsigned int id,
     struct record *record)
 {
 	const unsigned char *uuid;
@@ -871,7 +871,7 @@
 }
 
 int
-pwfile_remove_record(struct pwm_ctx *ctx, unsigned int id)
+pwfile_remove_pws_record(struct pwm_ctx *ctx, unsigned int id)
 {
 	const unsigned char *uuid;
 	struct record_id_entry *entry;
@@ -943,6 +943,24 @@
 }
 
 struct record *
+pwfile_create_record(void)
+{
+	struct record	*record;
+
+	record = xmalloc(sizeof (struct record));
+	record->ctime = (time_t)0;
+	record->mtime = (time_t)0;
+	record->group = NULL;
+	record->title = NULL;
+	record->username = NULL;
+	record->password = NULL;
+	record->notes = NULL;
+	record->url = NULL;
+
+	return (record);
+}
+
+struct record *
 pwfile_get_record(struct pwm_ctx *ctx, unsigned int id)
 {
 	struct record	*record;