NeoMutt  2024-02-01-23-g345d7b
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
lib.h
Go to the documentation of this file.
1
40#ifndef MUTT_NNTP_LIB_H
41#define MUTT_NNTP_LIB_H
42
43#include <stdbool.h>
44#include <stdint.h>
45#include <stdio.h>
46#include "core/lib.h"
47#include "format_flags.h"
48
49struct Buffer;
50struct ConnAccount;
51struct Email;
52struct NntpAccountData;
53struct stat;
54
55extern struct NntpAccountData *CurrentNewsSrv;
56extern const struct MxOps MxNntpOps;
57
58/* article number type and format */
59#define anum_t long
60#define ANUM_FMT "%ld"
61
66{
67 unsigned int index;
68 char *path;
69};
70
75{
78};
79
80/* number of entries in article cache */
81#define NNTP_ACACHE_LEN 10
82
83struct NntpAccountData *nntp_select_server(struct Mailbox *m, const char *server, bool leave_lock);
86struct NntpMboxData *mutt_newsgroup_catchup(struct Mailbox *m, struct NntpAccountData *adata, char *group);
88int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new);
90int nntp_post(struct Mailbox *m, const char *msg);
91int nntp_check_msgid(struct Mailbox *m, const char *msgid);
92int nntp_check_children(struct Mailbox *m, const char *msgid);
95void nntp_mailbox(struct Mailbox *m, char *buf, size_t buflen);
96void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct);
98const 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);
99int nntp_compare_order(const struct Email *a, const struct Email *b, bool reverse);
100enum MailboxType nntp_path_probe(const char *path, const struct stat *st);
101const 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);
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
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:930
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:58
const struct MxOps MxNntpOps
NNTP Mailbox - Implements MxOps -.
Definition: nntp.c:2760
enum MailboxType nntp_path_probe(const char *path, const struct stat *st)
Is this an NNTP Mailbox? - Implements MxOps::path_probe() -.
Definition: nntp.c:2738
int nntp_compare_order(const struct Email *a, const struct Email *b, bool reverse)
Restore the 'unsorted' order of emails - Implements sort_mail_t -.
Definition: nntp.c:2308
int nntp_check_msgid(struct Mailbox *m, const char *msgid)
Fetch article by Message-ID.
Definition: nntp.c:2167
void nntp_clear_cache(struct NntpAccountData *adata)
Clear the NNTP cache.
Definition: newsrc.c:850
int nntp_check_children(struct Mailbox *m, const char *msgid)
Fetch children of article with the Message-ID.
Definition: nntp.c:2238
int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new)
Fetch list of all newsgroups from server.
Definition: nntp.c:1989
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:1904
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:1386
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:1304
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:1253
struct NntpMboxData * mutt_newsgroup_uncatchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Uncatchup newsgroup.
Definition: newsrc.c:1343
void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct)
Make fully qualified url from newsgroup name.
Definition: newsrc.c:565
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:1025
struct NntpMboxData * mutt_newsgroup_unsubscribe(struct NntpAccountData *adata, char *group)
Unsubscribe newsgroup.
Definition: newsrc.c:1277
#define anum_t
Definition: lib.h:59
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:75
anum_t last
Last article number in run.
Definition: lib.h:77
anum_t first
First article number in run.
Definition: lib.h:76
NNTP article cache.
Definition: lib.h:66
char * path
Cache path.
Definition: lib.h:68
unsigned int index
Index number.
Definition: lib.h:67
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