aboutsummaryrefslogtreecommitdiffstats
path: root/src/notify.c
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2010-03-20 10:54:41 +0000
committerFrederic Culot <calcurse@culot.org>2010-03-20 10:54:41 +0000
commita8cb1c92eff88acc685d7d876647844bacb71e8e (patch)
treed5aead8428a5da50e05aa137bfd909aa117793aa /src/notify.c
parent689be2947439e896b61fde0f84a7707dc367cd4a (diff)
downloadcalcurse-a8cb1c92eff88acc685d7d876647844bacb71e8e.tar.gz
calcurse-a8cb1c92eff88acc685d7d876647844bacb71e8e.zip
All headers gathered into a single one. Typedefs suppressed.
Diffstat (limited to 'src/notify.c')
-rwxr-xr-xsrc/notify.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/src/notify.c b/src/notify.c
index 364b4d2..1695faf 100755
--- a/src/notify.c
+++ b/src/notify.c
@@ -1,9 +1,9 @@
-/* $calcurse: notify.c,v 1.48 2010/02/14 17:29:16 culot Exp $ */
+/* $calcurse: notify.c,v 1.49 2010/03/20 10:54:47 culot Exp $ */
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2009 Frederic Culot <frederic@culot.org>
+ * Copyright (c) 2004-2010 Frederic Culot <frederic@culot.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,19 +41,20 @@
#include <string.h>
#include <unistd.h>
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
+#include "calcurse.h"
-#include "i18n.h"
-#include "utils.h"
-#include "custom.h"
-#include "keys.h"
-#include "mem.h"
-#include "notify.h"
+#define NOTIFY_FIELD_LENGTH 25
-static struct notify_vars_s notify;
-static struct notify_app_s notify_app;
+struct notify_vars {
+ WINDOW *win;
+ char *apts_file;
+ char time[NOTIFY_FIELD_LENGTH];
+ char date[NOTIFY_FIELD_LENGTH];
+ pthread_mutex_t mutex;
+};
+
+static struct notify_vars notify;
+static struct notify_app notify_app;
static pthread_attr_t detached_thread_attr;
static pthread_t notify_t_main;
@@ -364,7 +365,7 @@ notify_main_thread (void *arg)
/* Fill the given structure with information about next appointment. */
unsigned
-notify_get_next (struct notify_app_s *a)
+notify_get_next (struct notify_app *a)
{
time_t current_time;
@@ -390,7 +391,7 @@ notify_get_next (struct notify_app_s *a)
unsigned
notify_get_next_bkgd (void)
{
- struct notify_app_s a;
+ struct notify_app a;
a.txt = (char *)0;
if (!notify_get_next (&a))
@@ -429,7 +430,7 @@ notify_app_txt (void)
static void *
notify_thread_app (void *arg)
{
- struct notify_app_s tmp_app;
+ struct notify_app tmp_app;
if (!notify_get_next (&tmp_app))
pthread_exit ((void *)0);
@@ -501,7 +502,7 @@ notify_check_added (char *mesg, long start, char state)
/* Check if the newly repeated appointment is to be notified. */
void
-notify_check_repeated (recur_apoint_llist_node_t *i)
+notify_check_repeated (struct recur_apoint *i)
{
long real_app_time;
int update_notify = 0;
@@ -549,7 +550,7 @@ notify_same_item (long time)
}
int
-notify_same_recur_item (recur_apoint_llist_node_t *i)
+notify_same_recur_item (struct recur_apoint *i)
{
int same = 0;
long item_start = 0;
@@ -684,7 +685,7 @@ print_config_options (WINDOW *optwin)
}
static void
-reinit_conf_win (scrollwin_t *win)
+reinit_conf_win (struct scrollwin *win)
{
unsigned first_line;
@@ -700,7 +701,7 @@ reinit_conf_win (scrollwin_t *win)
void
notify_config_bar (void)
{
- scrollwin_t cwin;
+ struct scrollwin cwin;
char *buf;
char *number_str =
_("Enter an option number to change its value");