NeoMutt  2022-04-29-215-gc12b98
Teaching an old dog new tricks
DOXYGEN
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 <stdint.h>
47#include <stdio.h>
48#include "core/lib.h"
49#include "format_flags.h"
50
51struct ConnAccount;
52struct Email;
53struct NntpAccountData;
54struct stat;
55
56extern struct NntpAccountData *CurrentNewsSrv;
57extern struct MxOps MxNntpOps;
58
59/* article number type and format */
60#define anum_t long
61#define ANUM "%ld"
62
67{
68 unsigned int index;
69 char *path;
70};
71
76{
79};
80
81/* number of entries in article cache */
82#define NNTP_ACACHE_LEN 10
83
84struct NntpAccountData *nntp_select_server(struct Mailbox *m, const char *server, bool leave_lock);
87struct NntpMboxData *mutt_newsgroup_catchup(struct Mailbox *m, struct NntpAccountData *adata, char *group);
89int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new);
91int nntp_post(struct Mailbox *m, const char *msg);
92int nntp_check_msgid(struct Mailbox *m, const char *msgid);
93int nntp_check_children(struct Mailbox *m, const char *msgid);
96void nntp_mailbox(struct Mailbox *m, char *buf, size_t buflen);
97void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct);
99const char *nntp_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags);
100int nntp_compare_order(const struct Email *a, const struct Email *b, bool reverse);
101enum MailboxType nntp_path_probe(const char *path, const struct stat *st);
102const char *group_index_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags);
103int nntp_complete(char *buf, size_t buflen);
104
105#endif /* MUTT_NNTP_LIB_H */
Convenience wrapper for the core headers.
Flags to control mutt_expando_format()
uint8_t MuttFormatFlags
Flags for mutt_expando_format(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition: format_flags.h:29
const char * nntp_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags)
Expand the newsrc filename - Implements format_t -.
Definition: newsrc.c:925
const char * group_index_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags)
Format a string for the newsgroup menu - Implements format_t -.
Definition: browse.c:55
struct MxOps MxNntpOps
NNTP Mailbox - Implements MxOps -.
Definition: nntp.c:2741
enum MailboxType nntp_path_probe(const char *path, const struct stat *st)
Is this an NNTP Mailbox? - Implements MxOps::path_probe() -.
Definition: nntp.c:2701
int nntp_compare_order(const struct Email *a, const struct Email *b, bool reverse)
Sort to mailbox order - Implements sort_mail_t -.
Definition: nntp.c:2271
MailboxType
Supported mailbox formats.
Definition: mailbox.h:41
int nntp_complete(char *buf, size_t buflen)
Auto-complete NNTP newsgroups.
Definition: complete.c:47
int nntp_check_msgid(struct Mailbox *m, const char *msgid)
Fetch article by Message-ID.
Definition: nntp.c:2133
void nntp_clear_cache(struct NntpAccountData *adata)
Clear the NNTP cache.
Definition: newsrc.c:847
int nntp_check_children(struct Mailbox *m, const char *msgid)
Fetch children of article with the Message-ID.
Definition: nntp.c:2203
int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new)
Fetch list of all newsgroups from server.
Definition: nntp.c:1957
int nntp_post(struct Mailbox *m, const char *msg)
Post article.
Definition: nntp.c:1874
int nntp_newsrc_parse(struct NntpAccountData *adata)
Parse .newsrc file.
Definition: newsrc.c:162
void nntp_mailbox(struct Mailbox *m, char *buf, size_t buflen)
Get first newsgroup with new messages.
Definition: newsrc.c:1405
void nntp_newsrc_close(struct NntpAccountData *adata)
Unlock and close .newsrc file.
Definition: newsrc.c:118
struct NntpMboxData * mutt_newsgroup_catchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Catchup newsgroup.
Definition: newsrc.c:1323
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:1272
struct NntpMboxData * mutt_newsgroup_uncatchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Uncatchup newsgroup.
Definition: newsrc.c:1362
void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct)
Make fully qualified url from newsgroup name.
Definition: newsrc.c:561
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:1019
struct NntpMboxData * mutt_newsgroup_unsubscribe(struct NntpAccountData *adata, char *group)
Unsubscribe newsgroup.
Definition: newsrc.c:1296
#define anum_t
Definition: lib.h:60
Login details for a remote server.
Definition: connaccount.h:53
The envelope/body of an email.
Definition: email.h:37
A mailbox.
Definition: mailbox.h:79
Definition: mxapi.h:112
An entry in a .newsrc (subscribed newsgroups)
Definition: lib.h:76
anum_t last
Last article number in run.
Definition: lib.h:78
anum_t first
First article number in run.
Definition: lib.h:77
NNTP article cache.
Definition: lib.h:67
char * path
Cache path.
Definition: lib.h:69
unsigned int index
Index number.
Definition: lib.h:68
NNTP-specific Account data -.
Definition: adata.h:37
NNTP-specific Mailbox data -.
Definition: mdata.h:33
char * group
Name of newsgroup.
Definition: mdata.h:34
struct NntpAccountData * adata
Definition: mdata.h:47