NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
lib.h
Go to the documentation of this file.
1
23
42
43#ifndef MUTT_NNTP_LIB_H
44#define MUTT_NNTP_LIB_H
45
46#include <stdbool.h>
47#include <stdio.h>
48#include "core/lib.h"
49#include "expando/lib.h"
50#include "expando_browser.h" // IWYU pragma: keep
51
52struct Buffer;
53struct ConnAccount;
54struct Email;
55struct NntpAccountData;
56struct stat;
57
58extern struct NntpAccountData *CurrentNewsSrv;
59extern const struct MxOps MxNntpOps;
60extern const struct ExpandoRenderCallback NntpRenderCallbacks[];
61
62/* article number type and format */
63#define anum_t long
64#define ANUM_FMT "%ld"
65
70{
71 unsigned int index;
72 char *path;
73};
74
83
84/* number of entries in article cache */
85#define NNTP_ACACHE_LEN 10
86
87struct NntpAccountData *nntp_select_server(struct Mailbox *m, const char *server, bool leave_lock);
90struct NntpMboxData *mutt_newsgroup_catchup(struct Mailbox *m, struct NntpAccountData *adata, char *group);
92int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new);
94int nntp_post(struct Mailbox *m, const char *msg);
95int nntp_check_msgid(struct Mailbox *m, const char *msgid);
96int nntp_check_children(struct Mailbox *m, const char *msgid);
99void nntp_mailbox(struct Mailbox *m, char *buf, size_t buflen);
100void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct);
102int nntp_sort_unsorted(const struct Email *a, const struct Email *b, bool reverse);
103enum MailboxType nntp_path_probe(const char *path, const struct stat *st);
104int nntp_complete(struct Buffer *buf);
105
106#endif /* MUTT_NNTP_LIB_H */
Convenience wrapper for the core headers.
MailboxType
Supported mailbox formats.
Definition mailbox.h:40
Parse Expando string.
NNTP Expando definitions.
const struct ExpandoRenderCallback NntpRenderCallbacks[]
Callbacks for Newsrc Expandos.
const struct MxOps MxNntpOps
NNTP Mailbox - Implements MxOps -.
Definition nntp.c:2809
enum MailboxType nntp_path_probe(const char *path, const struct stat *st)
Is this an NNTP Mailbox?
Definition nntp.c:2787
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:2357
int nntp_check_msgid(struct Mailbox *m, const char *msgid)
Fetch article by Message-ID.
Definition nntp.c:2216
void nntp_clear_cache(struct NntpAccountData *adata)
Clear the NNTP cache.
Definition newsrc.c:846
int nntp_check_children(struct Mailbox *m, const char *msgid)
Fetch children of article with the Message-ID.
Definition nntp.c:2287
int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new)
Fetch list of all newsgroups from server.
Definition nntp.c:2038
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:1947
int nntp_newsrc_parse(struct NntpAccountData *adata)
Parse .newsrc file.
Definition newsrc.c:163
void nntp_mailbox(struct Mailbox *m, char *buf, size_t buflen)
Get first newsgroup with new messages.
Definition newsrc.c:1314
void nntp_newsrc_close(struct NntpAccountData *adata)
Unlock and close .newsrc file.
Definition newsrc.c:119
struct NntpMboxData * mutt_newsgroup_catchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Catchup newsgroup.
Definition newsrc.c:1232
int nntp_newsrc_update(struct NntpAccountData *adata)
Update .newsrc file.
Definition newsrc.c:442
struct NntpMboxData * mutt_newsgroup_subscribe(struct NntpAccountData *adata, char *group)
Subscribe newsgroup.
Definition newsrc.c:1181
struct NntpMboxData * mutt_newsgroup_uncatchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Uncatchup newsgroup.
Definition newsrc.c:1271
void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct)
Make fully qualified url from newsgroup name.
Definition newsrc.c:555
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
Definition nntp.c:74
struct NntpAccountData * nntp_select_server(struct Mailbox *m, const char *server, bool leave_lock)
Open a connection to an NNTP server.
Definition newsrc.c:951
struct NntpMboxData * mutt_newsgroup_unsubscribe(struct NntpAccountData *adata, char *group)
Unsubscribe newsgroup.
Definition newsrc.c:1205
#define anum_t
Definition lib.h:63
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:78
Definition mxapi.h:87
An entry in a .newsrc (subscribed newsgroups)
Definition lib.h:79
anum_t last
Last article number in run.
Definition lib.h:81
anum_t first
First article number in run.
Definition lib.h:80
NNTP article cache.
Definition lib.h:70
char * path
Cache path.
Definition lib.h:72
unsigned int index
Index number.
Definition lib.h:71
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
Account data.
Definition mdata.h:48