NeoMutt
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 <stdint.h>
47#include <stdio.h>
48#include "core/lib.h"
49#include "format_flags.h"
50
51struct Buffer;
52struct ConnAccount;
53struct Email;
54struct NntpAccountData;
55struct stat;
56
57extern struct NntpAccountData *CurrentNewsSrv;
58extern const struct MxOps MxNntpOps;
59
60/* article number type and format */
61#define anum_t long
62#define ANUM "%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);
100const 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);
101int nntp_compare_order(const struct Email *a, const struct Email *b, bool reverse);
102enum MailboxType nntp_path_probe(const char *path, const struct stat *st);
103const 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);
104int nntp_complete(struct Buffer *buf);
105
106#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:927
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:57
const struct MxOps MxNntpOps
NNTP Mailbox - Implements MxOps -.
Definition: nntp.c:2774
enum MailboxType nntp_path_probe(const char *path, const struct stat *st)
Is this an NNTP Mailbox? - Implements MxOps::path_probe() -.
Definition: nntp.c:2734
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:2305
MailboxType
Supported mailbox formats.
Definition: mailbox.h:41
int nntp_check_msgid(struct Mailbox *m, const char *msgid)
Fetch article by Message-ID.
Definition: nntp.c:2164
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:2235
int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new)
Fetch list of all newsgroups from server.
Definition: nntp.c:1986
int nntp_complete(struct Buffer *buf)
Auto-complete NNTP newsgroups.
Definition: complete.c:45
int nntp_post(struct Mailbox *m, const char *msg)
Post article.
Definition: nntp.c:1901
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:1382
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:1300
int nntp_newsrc_update(struct NntpAccountData *adata)
Update .newsrc file.
Definition: newsrc.c:441
struct NntpMboxData * mutt_newsgroup_subscribe(struct NntpAccountData *adata, char *group)
Subscribe newsgroup.
Definition: newsrc.c:1249
struct NntpMboxData * mutt_newsgroup_uncatchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Uncatchup newsgroup.
Definition: newsrc.c:1339
void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct)
Make fully qualified url from newsgroup name.
Definition: newsrc.c:564
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:1021
struct NntpMboxData * mutt_newsgroup_unsubscribe(struct NntpAccountData *adata, char *group)
Unsubscribe newsgroup.
Definition: newsrc.c:1273
#define anum_t
Definition: lib.h:61
String manipulation buffer.
Definition: buffer.h:34
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:91
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