summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2006-09-11 13:34:48 +0000
committerFrederic Culot <calcurse@culot.org>2006-09-11 13:34:48 +0000
commitd04b0151ba090855ecc162568706a1a30a52a009 (patch)
tree6c4461e093626e2e1644ad498049a6004549ba3d /src
parentc7cba561269cc4ef0fc5434056140ad948dc34ea (diff)
downloadcalcurse-d04b0151ba090855ecc162568706a1a30a52a009.tar.gz
calcurse-d04b0151ba090855ecc162568706a1a30a52a009.zip
recur_apoint_check_next() created
Diffstat (limited to 'src')
-rwxr-xr-xsrc/recur.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/recur.c b/src/recur.c
index 9aa994e..4c82279 100755
--- a/src/recur.c
+++ b/src/recur.c
@@ -1,4 +1,4 @@
-/* $calcurse: recur.c,v 1.9 2006/09/11 13:16:39 culot Exp $ */
+/* $calcurse: recur.c,v 1.10 2006/09/11 13:34:48 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -36,6 +36,7 @@
#include "apoint.h"
#include "event.h"
#include "recur.h"
+#include "notify.h"
#include "args.h"
#include "day.h"
#include "vars.h"
@@ -638,3 +639,34 @@ struct days_s *recur_exc_scan(FILE *data_file)
}
return exc_head;
}
+
+/*
+ * Look in the appointment list if we have an item which starts before the item
+ * stored in the notify_app structure (which is the next item to be notified).
+ */
+struct notify_app_s *recur_apoint_check_next(
+ struct notify_app_s *app, long start)
+{
+ struct recur_apoint_s *i;
+
+ if (!recur_alist)
+ return app;
+ for (i = recur_alist; i != 0; i = i->next) {
+ if (i->start > app->time) {
+ return app;
+ } else {
+ if (i->start > start) {
+ app->time = i->start;
+ if (strlen(i->mesg) < NOTIFY_FIELD_LENGTH) {
+ strncpy(app->txt, i->mesg,
+ strlen(i->mesg) + 1);
+ } else {
+ strncpy(app->txt, i->mesg,
+ NOTIFY_FIELD_LENGTH-3);
+ strncat(app->txt, "..", 2);
+ }
+ }
+ }
+ }
+ return app;
+}