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#ifdef USE_IMAP
94 char delim;
96 bool imap : 1;
97 bool selectable : 1;
98 bool inferiors : 1;
100 bool has_mailbox : 1;
101 bool local : 1;
102 bool notify_user : 1;
103 bool poll_new_mail : 1;
104 bool tagged : 1;
105#ifdef USE_NNTP
106 struct NntpMboxData *nd;
109 int gen;
112ARRAY_HEAD(BrowserEntryArray, struct FolderFile);
119 struct BrowserEntryArray entry;
120#ifdef USE_IMAP
122 char *folder;
127void dlg_browser(struct Buffer *file, SelectFileFlags flags, struct Mailbox *m, char ***files, int *numfiles);
128void mutt_browser_select_dir(const char *f);
129void mutt_browser_cleanup(void);
131void browser_sort(struct BrowserState *state);
132void 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);
133void browser_highlight_default(struct BrowserState *state, struct Menu *menu);
134int examine_directory(struct Mailbox *m, struct Menu *menu, struct BrowserState *state, const char *d, const char *prefix);
135int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state);
136void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar);
137void init_state(struct BrowserState *state, struct Menu *menu);
138bool link_is_dir(const char *folder, const char *path);
139void destroy_state(struct BrowserState *state);
140void dump_state(struct BrowserState *state);
142#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:46
void init_state(struct BrowserState *state, struct Menu *menu)
Initialise a browser state.
Definition: dlg_browser.c:633
void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar)
Set up a new menu.
Definition: dlg_browser.c:977
void browser_sort(struct BrowserState *state)
Sort the entries in the browser.
Definition: sort.c:185
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:1225
void destroy_state(struct BrowserState *state)
Free the BrowserState.
Definition: functions.c:173
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:657
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:951
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:786
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:1248
Convenience wrapper for the library headers.
State of the file/mailbox browser.
Definition: lib.h:118
char * folder
Folder name.
Definition: lib.h:122
bool is_mailbox_list
Viewing mailboxes.
Definition: lib.h:124
struct BrowserEntryArray entry
Array of files / dirs / mailboxes.
Definition: lib.h:119
bool imap_browse
IMAP folder.
Definition: lib.h:121
String manipulation buffer.
Definition: buffer.h:34
Browser entry representing a folder/dir.
Definition: lib.h:78
bool selectable
Folder can be selected.
Definition: lib.h:97
char delim
Path delimiter.
Definition: lib.h:94
bool imap
This is an IMAP folder.
Definition: lib.h:96
bool has_mailbox
This is a mailbox.
Definition: lib.h:100
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:104
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:103
bool notify_user
User will be notified of new mail.
Definition: lib.h:102
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:106
off_t size
File size.
Definition: lib.h:80
int gen
Unique id, used for (un)sorting.
Definition: lib.h:109
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:98
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:70
NNTP-specific Mailbox data -.
Definition: mdata.h:34