NeoMutt  2024-02-01-23-g345d7b
Teaching an old dog new tricks
No Matches
Go to the documentation of this file.
41#include "config.h"
42#include <stdbool.h>
43#include <stdint.h>
44#include <sys/types.h>
45#include "mutt/lib.h"
46#include "complete/lib.h"
48struct Mailbox;
49struct Menu;
50struct MuttWindow;
51struct stat;
53extern struct Buffer LastDir;
54extern struct Buffer LastDirBackup;
56typedef uint8_t SelectFileFlags;
57#define MUTT_SEL_NO_FLAGS 0
58#define MUTT_SEL_MAILBOX (1 << 0)
59#define MUTT_SEL_MULTI (1 << 1)
60#define MUTT_SEL_FOLDER (1 << 2)
62extern const struct CompleteOps CompleteFileOps;
63extern const struct CompleteOps CompleteMailboxOps;
68struct Folder
70 struct FolderFile *ff;
71 int num;
79 mode_t mode;
80 off_t size;
81 time_t mtime;
82 uid_t uid;
83 gid_t gid;
84 nlink_t nlink;
86 char *name;
87 char *desc;
93 char delim;
95 bool imap : 1;
96 bool selectable : 1;
97 bool inferiors : 1;
98 bool has_mailbox : 1;
99 bool local : 1;
100 bool notify_user : 1;
101 bool poll_new_mail : 1;
102 bool tagged : 1;
103 struct NntpMboxData *nd;
105 int gen;
108ARRAY_HEAD(BrowserEntryArray, struct FolderFile);
115 struct BrowserEntryArray entry;
117 char *folder;
121void dlg_browser(struct Buffer *file, SelectFileFlags flags, struct Mailbox *m, char ***files, int *numfiles);
122void mutt_browser_select_dir(const char *f);
123void mutt_browser_cleanup(void);
125void browser_sort(struct BrowserState *state);
126void browser_add_folder(const struct Menu *menu, struct BrowserState *state, const char *name, const char *desc, const struct stat *st, struct Mailbox *m, void *data);
127void browser_highlight_default(struct BrowserState *state, struct Menu *menu);
128int examine_directory(struct Mailbox *m, struct Menu *menu, struct BrowserState *state, const char *d, const char *prefix);
129int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state);
130void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar);
131void init_state(struct BrowserState *state, struct Menu *menu);
132bool link_is_dir(const char *folder, const char *path);
133void destroy_state(struct BrowserState *state);
134void dump_state(struct BrowserState *state);
136#endif /* MUTT_BROWSER_LIB_H */
#define ARRAY_HEAD(name, type)
Define a named struct for arrays of elements of a certain type.
Definition: array.h:47
void init_state(struct BrowserState *state, struct Menu *menu)
Initialise a browser state.
Definition: dlg_browser.c:629
void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar)
Set up a new menu.
Definition: dlg_browser.c:966
void browser_sort(struct BrowserState *state)
Sort the entries in the browser.
Definition: sort.c:186
const struct CompleteOps CompleteFileOps
Auto-Completion of Files.
Definition: complete.c:153
struct Buffer LastDir
Browser: previous selected directory.
Definition: dlg_browser.c:136
void mutt_browser_select_dir(const char *f)
Remember the last directory selected.
Definition: dlg_browser.c:1210
void destroy_state(struct BrowserState *state)
Free the BrowserState.
Definition: functions.c:137
struct Buffer LastDirBackup
Browser: backup copy of the current directory.
Definition: dlg_browser.c:138
const struct CompleteOps CompleteMailboxOps
Auto-Completion of Files / Mailboxes.
Definition: complete.c:160
int examine_directory(struct Mailbox *m, struct Menu *menu, struct BrowserState *state, const char *d, const char *prefix)
Get list of all files/newsgroups with mask.
Definition: dlg_browser.c:652
void browser_add_folder(const struct Menu *menu, struct BrowserState *state, const char *name, const char *desc, const struct stat *st, struct Mailbox *m, void *data)
Add a folder to the browser list.
Definition: dlg_browser.c:578
void mutt_browser_cleanup(void)
Clean up working Buffers.
Definition: dlg_browser.c:159
void browser_highlight_default(struct BrowserState *state, struct Menu *menu)
Decide which browser item should be highlighted.
Definition: dlg_browser.c:940
void dump_state(struct BrowserState *state)
int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state)
Get list of mailboxes/subscribed newsgroups.
Definition: dlg_browser.c:779
uint8_t SelectFileFlags
Flags for mutt_select_file(), e.g. MUTT_SEL_MAILBOX.
Definition: lib.h:56
bool link_is_dir(const char *folder, const char *path)
Does this symlink point to a directory?
Definition: dlg_browser.c:172
void dlg_browser(struct Buffer *file, SelectFileFlags flags, struct Mailbox *m, char ***files, int *numfiles)
Let the user select a file -.
Definition: dlg_browser.c:1233
Convenience wrapper for the library headers.
State of the file/mailbox browser.
Definition: lib.h:114
char * folder
Folder name.
Definition: lib.h:117
bool is_mailbox_list
Viewing mailboxes.
Definition: lib.h:118
struct BrowserEntryArray entry
Array of files / dirs / mailboxes.
Definition: lib.h:115
bool imap_browse
IMAP folder.
Definition: lib.h:116
String manipulation buffer.
Definition: buffer.h:36
Browser entry representing a folder/dir.
Definition: lib.h:78
bool selectable
Folder can be selected.
Definition: lib.h:96
char delim
Path delimiter.
Definition: lib.h:93
bool imap
This is an IMAP folder.
Definition: lib.h:95
bool has_mailbox
This is a mailbox.
Definition: lib.h:98
char * name
Name of file/dir/mailbox.
Definition: lib.h:86
uid_t uid
File's User ID.
Definition: lib.h:82
bool tagged
Folder is tagged.
Definition: lib.h:102
gid_t gid
File's Group ID.
Definition: lib.h:83
bool has_new_mail
true if mailbox has "new mail"
Definition: lib.h:89
bool poll_new_mail
Check mailbox for new mail.
Definition: lib.h:101
bool notify_user
User will be notified of new mail.
Definition: lib.h:100
nlink_t nlink
Number of hard links.
Definition: lib.h:84
char * desc
Description of mailbox.
Definition: lib.h:87
struct NntpMboxData * nd
Extra NNTP data.
Definition: lib.h:103
off_t size
File size.
Definition: lib.h:80
int gen
Unique id, used for (un)sorting.
Definition: lib.h:105
time_t mtime
Modification time.
Definition: lib.h:81
int msg_count
total number of messages
Definition: lib.h:90
mode_t mode
File permissions.
Definition: lib.h:79
bool inferiors
Folder has children.
Definition: lib.h:97
int msg_unread
number of unread messages
Definition: lib.h:91
A folder/dir in the browser.
Definition: lib.h:69
int num
Number in the index.
Definition: lib.h:71
struct FolderFile * ff
File / Dir / Mailbox.
Definition: lib.h:70
A mailbox.
Definition: mailbox.h:79
Definition: lib.h:69
NNTP-specific Mailbox data -.
Definition: mdata.h:34