* please see the file GPL in the top level source directory.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include <lib-lib/lib-lib.h>
-#include <unistd.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
#include <libgen.h>
-#include <sys/stat.h>
-
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/debug.h>
#include <lib-mime/mime.h>
-
#include <lib-ui/curses.h>
+#include <lib-mx/mx.h>
#include "mutt.h"
#include "sort.h"
-#include "mx.h"
#include "nntp.h"
-#include "rfc1524.h"
void nntp_add_to_list (NNTP_SERVER * s, NNTP_DATA * d)
{
data->lastMessage = data->entries[x - 1].last;
data->num = x;
mutt_newsgroup_stat (data);
- debug_print (2, ("Newsgroup %s\n", data->group));
return 0;
}
data = (NNTP_DATA *) hash_find (data->nserv->newsgroups, group);
if (!data) {
-#ifdef DEBUG
- if (group)
- debug_print (3, ("newsgroup %s not found\n", group));
-#endif
return;
}
/* if file not exist, create it */
if ((ifp = safe_fopen (filename, "a")))
fclose (ifp);
- debug_print (1, ("Opening %s\n", filename));
if (!(ifp = safe_fopen (filename, "r"))) {
mutt_error (_("Unable to open %s for reading"), filename);
return -1;
m_strcpy(buf, sizeof(buf), filename);
m_strcpy(tmpfile, sizeof(tmpfile), basename(filename));
mutt_adv_mktemp ((const char*) dirname (buf), tmpfile, sizeof (tmpfile));
- debug_print (1, ("Opening %s\n", tmpfile));
if (!(ofp = fopen (tmpfile, "w"))) {
fclose (ifp);
mutt_error (_("Unable to open %s for writing"), tmpfile);
link[0] = '\0';
if ((l = readlink (filename, link, sizeof (link)-1)) > 0)
link[l] = '\0';
- debug_print (1, ("Renaming %s to %s\n",tmpfile, l > 0 ? link : filename));
if (rename (tmpfile, l > 0 ? link : filename) < 0) {
unlink (tmpfile);
mutt_error (_("Can't rename %s to %s"), tmpfile, l > 0 ? link : filename);
if (!data || !data->rc)
continue;
nntp_create_newsrc_line (data, &buf, &line, &llen);
- debug_print (2, ("Added to newsrc: %s\n", line));
line += m_strlen(line);
}
/* newrc being fully rewritten */
if (!data || data->subscribed || !data->cache)
continue;
nntp_delete_cache (data);
- debug_print (2, ("Removed from .index: %s\n", data->group));
}
return;
}