NeoMutt  2025-09-05-7-geaa2bd
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
lib.h
Go to the documentation of this file.
1
42#ifndef MUTT_NNTP_LIB_H
43#define MUTT_NNTP_LIB_H
44
45#include <stdbool.h>
46#include <stdio.h>
47#include "core/lib.h"
48#include "expando_browser.h" // IWYU pragma: keep
49
50struct Buffer;
51struct ConnAccount;
52struct Email;
53struct NntpAccountData;
54struct stat;
55
56extern struct NntpAccountData *CurrentNewsSrv;
57extern const struct MxOps MxNntpOps;
58extern const struct ExpandoRenderCallback NntpRenderCallbacks[];
59
60/* article number type and format */
61#define anum_t long
62#define ANUM_FMT "%ld"
63
68{
69 unsigned int index;
70 char *path;
71};
72
77{
80};
81
82/* number of entries in article cache */
83#define NNTP_ACACHE_LEN 10
84
85struct NntpAccountData *nntp_select_server(struct Mailbox *m, const char *server, bool leave_lock);
88struct NntpMboxData *mutt_newsgroup_catchup(struct Mailbox *m, struct NntpAccountData *adata, char *group);
90int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new);
92int nntp_post(struct Mailbox *m, const char *msg);
93int nntp_check_msgid(struct Mailbox *m, const char *msgid);
94int nntp_check_children(struct Mailbox *m, const char *msgid);
97void nntp_mailbox(struct Mailbox *m, char *buf, size_t buflen);
98void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct);
100int nntp_sort_unsorted(const struct Email *a, const struct Email *b, bool reverse);
101enum MailboxType nntp_path_probe(const char *path, const struct stat *st);
102int nntp_complete(struct Buffer *buf);
103
104#endif /* MUTT_NNTP_LIB_H */
Convenience wrapper for the core headers.
MailboxType
Supported mailbox formats.
Definition: mailbox.h:41
NNTP Expando definitions.
const struct MxOps MxNntpOps
NNTP Mailbox - Implements MxOps -.
Definition: nntp.c:2807
enum MailboxType nntp_path_probe(const char *path, const struct stat *st)
Is this an NNTP Mailbox? - Implements MxOps::path_probe() -.
Definition: nntp.c:2785
int nntp_sort_unsorted(const struct Email *a, const struct Email *b, bool reverse)
Restore the 'unsorted' order of emails - Implements sort_email_t -.
Definition: nntp.c:2355
int nntp_check_msgid(struct Mailbox *m, const char *msgid)
Fetch article by Message-ID.
Definition: nntp.c:2214
void nntp_clear_cache(struct NntpAccountData *adata)
Clear the NNTP cache.
Definition: newsrc.c:841
int nntp_check_children(struct Mailbox *m, const char *msgid)
Fetch children of article with the Message-ID.
Definition: nntp.c:2285
int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new)
Fetch list of all newsgroups from server.
Definition: nntp.c:2036
int nntp_complete(struct Buffer *buf)
Auto-complete NNTP newsgroups.
Definition: complete.c:46
int nntp_post(struct Mailbox *m, const char *msg)
Post article.
Definition: nntp.c:1945
int nntp_newsrc_parse(struct NntpAccountData *adata)
Parse .newsrc file.
Definition: newsrc.c:164
void nntp_mailbox(struct Mailbox *m, char *buf, size_t buflen)
Get first newsgroup with new messages.
Definition: newsrc.c:1308
void nntp_newsrc_close(struct NntpAccountData *adata)
Unlock and close .newsrc file.
Definition: newsrc.c:120
struct NntpMboxData * mutt_newsgroup_catchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Catchup newsgroup.
Definition: newsrc.c:1226
int nntp_newsrc_update(struct NntpAccountData *adata)
Update .newsrc file.
Definition: newsrc.c:443
struct NntpMboxData * mutt_newsgroup_subscribe(struct NntpAccountData *adata, char *group)
Subscribe newsgroup.
Definition: newsrc.c:1175
struct NntpMboxData * mutt_newsgroup_uncatchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Uncatchup newsgroup.
Definition: newsrc.c:1265
void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct)
Make fully qualified url from newsgroup name.
Definition: newsrc.c:556
const struct ExpandoRenderCallback NntpRenderCallbacks[]
Callbacks for Newsrc Expandos.
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
Definition: nntp.c:76
struct NntpAccountData * nntp_select_server(struct Mailbox *m, const char *server, bool leave_lock)
Open a connection to an NNTP server.
Definition: newsrc.c:945
struct NntpMboxData * mutt_newsgroup_unsubscribe(struct NntpAccountData *adata, char *group)
Unsubscribe newsgroup.
Definition: newsrc.c:1199
#define anum_t
Definition: lib.h:61
String manipulation buffer.
Definition: buffer.h:36
Login details for a remote server.
Definition: connaccount.h:53
The envelope/body of an email.
Definition: email.h:39
A mailbox.
Definition: mailbox.h:79
Definition: mxapi.h:88
An entry in a .newsrc (subscribed newsgroups)
Definition: lib.h:77
anum_t last
Last article number in run.
Definition: lib.h:79
anum_t first
First article number in run.
Definition: lib.h:78
NNTP article cache.
Definition: lib.h:68
char * path
Cache path.
Definition: lib.h:70
unsigned int index
Index number.
Definition: lib.h:69
NNTP-specific Account data -.
Definition: adata.h:36
NNTP-specific Mailbox data -.
Definition: mdata.h:34
char * group
Name of newsgroup.
Definition: mdata.h:35
struct NntpAccountData * adata
Definition: mdata.h:48