#include <stdarg.h>
#include <stdio.h>
#include <strings.h>
#include <unistd.h>
#include <stdlib.h>
#include <glib.h>
#include "UP_util.h"

extern int tracing;
extern int reading_from_mail;
/* global config variables */
extern char *tmpdir;
extern char *notitxt;
extern char *fwtxt;
extern char *humailbox;
extern char *notimailtxt;
extern char *fwmailtxt;

char * NT_ntfy_filename_generate( const char * tmpdir, const char * e_mail);

char * NT_forwd_filename_generate( const char * tmpdir, const char * e_mail);

char * NT_crossntfy_filename_generate( const char * tmpdir, const char * e_mail);

void NT_add_to_ntfy( char * filename, char * fmt, ... );

void NT_send_ntfy( const char * filename, const char * to_address, const char * mailercommand);

void NT_log_ntfy( const char * filename, const char * logfilename);

void NT_delete_ntfy( const char * filename);

void NT_send_ntfy_list( GHashTable * filehash, char * mailercommand);

void NT_log_ntfy_list( GHashTable * filehash, char * log_file);

void NT_delete_ntfy_list( GHashTable * filehash);

GSList * NT_gather_ntfy_addresses( const char * old_object, const char * new_object);

void NT_write_all_ntfs(char * old_object, char * new_object, /*const char * notif_log,
                       const char * forw_log,    const char * cross_log,*/ const char * tempdir,
                       GHashTable * ntfy_hash,  GHashTable * forwd_hash, GHashTable * cross_hash, 
                       const char * from_address);

void NT_write_all_frwds(char * old_object, char * new_object, /*const char * notif_log,
                       const char * forw_log,    const char * cross_log,*/ const char * tempdir,
                       GHashTable * ntfy_hash,  GHashTable * forwd_hash, GHashTable * cross_hash, 
                       const char * from_address); 

