strfcpy (group, line, len);
if ((data = (NNTP_DATA *) hash_find (news->newsgroups, group)) == NULL) {
data =
strfcpy (group, line, len);
if ((data = (NNTP_DATA *) hash_find (news->newsgroups, group)) == NULL) {
data =
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, group);
data->nserv = news;
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, group);
data->nserv = news;
- dprint (2, (debugfile, "parse_line: Newsgroup %s\n", data->group));
+ debug_print (2, ("Newsgroup %s\n", data->group));
while (fgets (buf, sb.st_size + 1, fp))
nntp_parse_newsrc_line (news, buf);
while (fgets (buf, sb.st_size + 1, fp))
nntp_parse_newsrc_line (news, buf);
snprintf (buf, sizeof (buf), "%s/.index", dir);
if (!(index = safe_fopen (buf, "a+")))
return 0;
rewind (index);
while (fgets (buf, sizeof (buf), index)) {
snprintf (buf, sizeof (buf), "%s/.index", dir);
if (!(index = safe_fopen (buf, "a+")))
return 0;
rewind (index);
while (fgets (buf, sizeof (buf), index)) {
- buf[mutt_strlen (buf) - 1] = 0; /* strip ending '\n' */
- if (!mutt_strncmp (buf, "#: ", 3) &&
- !mutt_strcasecmp (buf + 3, news->conn->account.host))
+ buf[str_len (buf) - 1] = 0; /* strip ending '\n' */
+ if (!str_ncmp (buf, "#: ", 3) &&
+ !str_casecmp (buf + 3, news->conn->account.host))
break;
sscanf (cp + 1, "%s %d %d", file, &l, &m);
break;
sscanf (cp + 1, "%s %d %d", file, &l, &m);
- if (!mutt_strcmp (buf, "ALL")) {
- news->cache = safe_strdup (file);
+ if (!str_cmp (buf, "ALL")) {
+ news->cache = str_dup (file);
news->newgroups_time = m;
}
else if (news->newsgroups) {
if ((data = (NNTP_DATA *) hash_find (news->newsgroups, buf)) == NULL) {
data =
news->newgroups_time = m;
}
else if (news->newsgroups) {
if ((data = (NNTP_DATA *) hash_find (news->newsgroups, buf)) == NULL) {
data =
- (NNTP_DATA *) safe_calloc (1,
- sizeof (NNTP_DATA) + mutt_strlen (buf) + 1);
+ (NNTP_DATA *) mem_calloc (1,
+ sizeof (NNTP_DATA) + str_len (buf) + 1);
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, buf);
data->nserv = news;
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, buf);
data->nserv = news;
hash_insert (news->newsgroups, data->group, data, 0);
nntp_add_to_list (news, data);
}
hash_insert (news->newsgroups, data->group, data, 0);
nntp_add_to_list (news, data);
}
snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
snprintf (dest, destlen, tmp, fn);
break;
snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
snprintf (dest, destlen, tmp, fn);
break;
url_parse_ciss (&url, c);
if (url.scheme == U_NNTP || url.scheme == U_NNTPS) {
url_parse_ciss (&url, c);
if (url.scheme == U_NNTP || url.scheme == U_NNTPS) {
mutt_account_tourl (acct, &url);
url_ciss_tostring (&url, line, len, 0);
mutt_account_tourl (acct, &url);
url_ciss_tostring (&url, line, len, 0);
strcpy (p, server);
if ((nntp_parse_url (buf, &acct, file, sizeof (file))) < 0 || *file) {
strcpy (p, server);
if ((nntp_parse_url (buf, &acct, file, sizeof (file))) < 0 || *file) {
serv->newsgroups = hash_create (1009);
slurp_newsrc (serv); /* load .newsrc */
nntp_parse_cacheindex (serv); /* load .index */
serv->newsgroups = hash_create (1009);
slurp_newsrc (serv); /* load .newsrc */
nntp_parse_cacheindex (serv); /* load .index */
- dprint (3, (debugfile, "newsgroup %s not found\n", group));
+ debug_print (3, ("newsgroup %s not found\n", group));
line = *buf + (*pline - line);
}
strcpy (line, data->group);
line = *buf + (*pline - line);
}
strcpy (line, data->group);
if (series && first <= data->lastLoaded) {
if (data->num >= data->max) {
data->max = data->max * 2;
if (series && first <= data->lastLoaded) {
if (data->num >= data->max) {
data->max = data->max * 2;
/* we will generate full newsrc here */
for (tmp = news->list; tmp; tmp = tmp->next) {
data = (NNTP_DATA *) tmp->data;
if (!data || !data->rc)
continue;
nntp_create_newsrc_line (data, &buf, &line, &llen);
/* we will generate full newsrc here */
for (tmp = news->list; tmp; tmp = tmp->next) {
data = (NNTP_DATA *) tmp->data;
if (!data || !data->rc)
continue;
nntp_create_newsrc_line (data, &buf, &line, &llen);
- dprint (2, (debugfile, "Added to newsrc: %s", line));
- line += mutt_strlen (line);
+ debug_print (2, ("Added to newsrc: %s\n", line));
+ line += str_len (line);
if ((fd = mkstemp (buf)) == -1)
return NULL;
strcpy (s, pc); /* generated name */
if ((fd = mkstemp (buf)) == -1)
return NULL;
strcpy (s, pc); /* generated name */
- dprint (2, (debugfile, "Removed from .index: %s\n", data->group));
+ debug_print (2, ("Removed from .index: %s\n", data->group));
((NNTP_DATA *) ctx->data)->nserv->conn->account.host,
((NNTP_DATA *) ctx->data)->group);
f = mutt_mkname (buf);
((NNTP_DATA *) ctx->data)->nserv->conn->account.host,
((NNTP_DATA *) ctx->data)->group);
f = mutt_mkname (buf);
data->lastCached = 0;
nntp_cache_expand (buf, ".index");
mutt_update_list_file (buf, data->nserv->conn->account.host, data->group,
data->lastCached = 0;
nntp_cache_expand (buf, ".index");
mutt_update_list_file (buf, data->nserv->conn->account.host, data->group,
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, group);
data->nserv = news;
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, group);
data->nserv = news;
unsigned int i, unread = 0;
for (i = 0; i < Context->msgcount; i++)
unsigned int i, unread = 0;
for (i = 0; i < Context->msgcount; i++)