NeoMutt  2024-11-14-138-ge5ca67
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/lib.h"
49#include "expando_browser.h" // IWYU pragma: keep
50
51struct Buffer;
52struct ConnAccount;
53struct Email;
54struct NntpAccountData;
55struct stat;
56
57extern struct NntpAccountData *CurrentNewsSrv;
58extern const struct MxOps MxNntpOps;
59extern const struct ExpandoRenderCallback NntpRenderCallbacks[];
60
61/* article number type and format */
62#define anum_t long
63#define ANUM_FMT "%ld"
64
69{
70 unsigned int index;
71 char *path;
72};
73
78{
81};
82
83/* number of entries in article cache */
84#define NNTP_ACACHE_LEN 10
85
86struct NntpAccountData *nntp_select_server(struct Mailbox *m, const char *server, bool leave_lock);
89struct NntpMboxData *mutt_newsgroup_catchup(struct Mailbox *m, struct NntpAccountData *adata, char *group);
91int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new);
93int nntp_post(struct Mailbox *m, const char *msg);
94int nntp_check_msgid(struct Mailbox *m, const char *msgid);
95int nntp_check_children(struct Mailbox *m, const char *msgid);
98void nntp_mailbox(struct Mailbox *m, char *buf, size_t buflen);
99void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct);
101int nntp_sort_unsorted(const struct Email *a, const struct Email *b, bool reverse);
102enum MailboxType nntp_path_probe(const char *path, const struct stat *st);
103int nntp_complete(struct Buffer *buf);
104
105#endif /* MUTT_NNTP_LIB_H */
Convenience wrapper for the core headers.
MailboxType
Supported mailbox formats.
Definition: mailbox.h:41
Parse Expando string.
NNTP Expando definitions.
const struct MxOps MxNntpOps
NNTP Mailbox - Implements MxOps -.
Definition: nntp.c:2808
enum MailboxType nntp_path_probe(const char *path, const struct stat *st)
Is this an NNTP Mailbox? - Implements MxOps::path_probe() -.
Definition: nntp.c:2786
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:2356
int nntp_check_msgid(struct Mailbox *m, const char *msgid)
Fetch article by Message-ID.
Definition: nntp.c:2215
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:2286
int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new)
Fetch list of all newsgroups from server.
Definition: nntp.c:2037
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:1946
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:77
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:62
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:91
An entry in a .newsrc (subscribed newsgroups)
Definition: lib.h:78
anum_t last
Last article number in run.
Definition: lib.h:80
anum_t first
First article number in run.
Definition: lib.h:79
NNTP article cache.
Definition: lib.h:69
char * path
Cache path.
Definition: lib.h:71
unsigned int index
Index number.
Definition: lib.h:70
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