NeoMutt  2023-11-03-85-g512e01
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
muttlib.h
Go to the documentation of this file.
1
24#ifndef MUTT_MUTTLIB_H
25#define MUTT_MUTTLIB_H
26
27#include <signal.h>
28#include <stdbool.h>
29#include <stdint.h>
30#include <stdio.h>
31#include "attach/lib.h"
32#include "format_flags.h"
33
34struct Address;
35struct Body;
36struct Buffer;
37struct ListHead;
38struct passwd;
39struct stat;
40
41void mutt_adv_mktemp(struct Buffer *buf);
42void buf_expand_path(struct Buffer *buf);
43void buf_expand_path_regex(struct Buffer *buf, bool regex);
44void buf_pretty_mailbox(struct Buffer *s);
45void buf_sanitize_filename (struct Buffer *buf, const char *path, short slash);
46void buf_save_path(struct Buffer *dest, const struct Address *a);
47int mutt_check_overwrite(const char *attname, const char *path, struct Buffer *fname, enum SaveAttach *opt, char **directory);
48void mutt_encode_path(struct Buffer *buf, const char *src);
49void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t callback, intptr_t data, MuttFormatFlags flags);
50char * mutt_expand_path(char *s, size_t slen);
51char * mutt_expand_path_regex(char *buf, size_t buflen, bool regex);
52char * mutt_gecos_name(char *dest, size_t destlen, struct passwd *pw);
53void mutt_get_parent_path(const char *path, char *buf, size_t buflen);
54int mutt_inbox_cmp(const char *a, const char *b);
55bool mutt_is_text_part(struct Body *b);
56const char *mutt_make_version(void);
57bool mutt_needs_mailcap(struct Body *b);
58FILE * mutt_open_read(const char *path, pid_t *thepid);
59void mutt_pretty_mailbox(char *buf, size_t buflen);
60void mutt_safe_path(struct Buffer *dest, const struct Address *a);
61int mutt_save_confirm(const char *s, struct stat *st);
62void mutt_save_path(char *d, size_t dsize, const struct Address *a);
63void mutt_sleep(short s);
64void mutt_str_pretty_size(char *buf, size_t buflen, size_t num);
65
66void add_to_stailq (struct ListHead *head, const char *str);
67void remove_from_stailq(struct ListHead *head, const char *str);
68
69#endif /* MUTT_MUTTLIB_H */
GUI display the mailboxes in a side panel.
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 *(* format_t)(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)
Definition: format_flags.h:64
void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t callback, intptr_t data, MuttFormatFlags flags)
Expand expandos (x) in a string -.
Definition: muttlib.c:739
int mutt_inbox_cmp(const char *a, const char *b)
Do two folders share the same path and one is an inbox -.
Definition: muttlib.c:1573
SaveAttach
Options for saving attachments.
Definition: mutt_attach.h:57
char * mutt_expand_path_regex(char *buf, size_t buflen, bool regex)
Create the canonical path (with regex char escaping)
Definition: muttlib.c:343
void mutt_get_parent_path(const char *path, char *buf, size_t buflen)
Find the parent of a path (or mailbox)
Definition: muttlib.c:1511
void remove_from_stailq(struct ListHead *head, const char *str)
Remove an item, matching a string, from a List.
Definition: muttlib.c:1712
void mutt_save_path(char *d, size_t dsize, const struct Address *a)
Turn an email address into a filename (for saving)
Definition: muttlib.c:665
char * mutt_gecos_name(char *dest, size_t destlen, struct passwd *pw)
Lookup a user's real name in /etc/passwd.
Definition: muttlib.c:368
void add_to_stailq(struct ListHead *head, const char *str)
Add a string to a list.
Definition: muttlib.c:1687
void buf_expand_path_regex(struct Buffer *buf, bool regex)
Create the canonical path (with regex char escaping)
Definition: muttlib.c:136
const char * mutt_make_version(void)
Generate the NeoMutt version string.
Definition: muttlib.c:1433
void mutt_sleep(short s)
Sleep for a while.
Definition: muttlib.c:1418
void buf_save_path(struct Buffer *dest, const struct Address *a)
Make a safe filename from an email address.
Definition: muttlib.c:690
void buf_pretty_mailbox(struct Buffer *s)
Shorten a mailbox path using '~' or '='.
Definition: muttlib.c:556
bool mutt_needs_mailcap(struct Body *b)
Does this type need a mailcap entry do display.
Definition: muttlib.c:416
void mutt_str_pretty_size(char *buf, size_t buflen, size_t num)
Display an abbreviated size, like 3.4K.
Definition: muttlib.c:1641
bool mutt_is_text_part(struct Body *b)
Is this part of an email in plain text?
Definition: muttlib.c:444
void mutt_pretty_mailbox(char *buf, size_t buflen)
Shorten a mailbox path using '~' or '='.
Definition: muttlib.c:477
void buf_sanitize_filename(struct Buffer *buf, const char *path, short slash)
Replace unsafe characters in a filename.
Definition: muttlib.c:1619
void mutt_adv_mktemp(struct Buffer *buf)
Create a temporary file.
Definition: muttlib.c:85
char * mutt_expand_path(char *s, size_t slen)
Create the canonical path.
Definition: muttlib.c:124
void buf_expand_path(struct Buffer *buf)
Create the canonical path.
Definition: muttlib.c:329
void mutt_safe_path(struct Buffer *dest, const struct Address *a)
Make a safe filename from an email address.
Definition: muttlib.c:720
int mutt_check_overwrite(const char *attname, const char *path, struct Buffer *fname, enum SaveAttach *opt, char **directory)
Ask the user if overwriting is necessary.
Definition: muttlib.c:578
void mutt_encode_path(struct Buffer *buf, const char *src)
Convert a path to 'us-ascii'.
Definition: muttlib.c:1447
int mutt_save_confirm(const char *s, struct stat *st)
Ask the user to save.
Definition: muttlib.c:1321
FILE * mutt_open_read(const char *path, pid_t *thepid)
Run a command to read from.
Definition: muttlib.c:1276
An email address.
Definition: address.h:36
The body of an email.
Definition: body.h:36
String manipulation buffer.
Definition: buffer.h:34