diff pwm.h @ 13:cf81eb0c2d5a

Warn before quitting if there are unsaved changes If there are unsaved changes emit a warning when the quit command is used. Only quit if the quit command is used twice with no other command in between. Add a new Quit command which immediatly quits pwm without a warning.
author Guido Berhoerster <guido+pwm@berhoerster.name>
date Mon, 07 Aug 2017 16:59:47 +0200
parents a7e41e1a79c8
children a07665727c19
line wrap: on
line diff
--- a/pwm.h	Thu Aug 03 10:22:07 2017 +0200
+++ b/pwm.h	Mon Aug 07 16:59:47 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Guido Berhoerster <guido+pwm@berhoerster.name>
+ * Copyright (C) 2017 Guido Berhoerster <guido+pwm@berhoerster.name>
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -27,9 +27,11 @@
 #include <pws.h>
 
 struct pwm_ctx {
+	const char	*prev_cmd;
 	char		*filename;
 	struct pws3_file *file;
 	struct record_id_tree *record_id_tree;
+	int		unsaved_changes;
 	unsigned int	next_id;
 	char		password[PWS3_MAX_PASSWORD_LEN + 1];
 };