NeoMutt  2024-10-02-37-gfa9146
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
lib.h
Go to the documentation of this file.
1
38#ifndef MUTT_BROWSER_LIB_H
39#define MUTT_BROWSER_LIB_H
40
41#include "config.h"
42#include <stdbool.h>
43#include <stdint.h>
44#include <sys/types.h>
45#include "mutt/lib.h"
46
47struct Mailbox;
48struct Menu;
49struct MuttWindow;
50struct stat;
51
52extern struct Buffer LastDir;
53extern struct Buffer LastDirBackup;
54
55typedef uint8_t SelectFileFlags;
56#define MUTT_SEL_NO_FLAGS 0
57#define MUTT_SEL_MAILBOX (1 << 0)
58#define MUTT_SEL_MULTI (1 << 1)
59#define MUTT_SEL_FOLDER (1 << 2)
60
61extern const struct CompleteOps CompleteFileOps;
62extern const struct CompleteOps CompleteMailboxOps;
63
67struct Folder
68{
69 struct FolderFile *ff;
70 int num;
71};
72
77{
78 mode_t mode;
79 off_t size;
80 time_t mtime;
81 uid_t uid;
82 gid_t gid;
83 nlink_t nlink;
84
85 char *name;
86 char *desc;
87
91
92 char delim;
93
94 bool imap : 1;
95 bool selectable : 1;
96 bool inferiors : 1;
97 bool has_mailbox : 1;
98 bool local : 1;
99 bool notify_user : 1;
100 bool poll_new_mail : 1;
101 bool tagged : 1;
102 struct NntpMboxData *nd;
103
104 int gen;
105};
106
107ARRAY_HEAD(BrowserEntryArray, struct FolderFile);
108
115{
137};
138
143{
144 struct BrowserEntryArray entry;
146 char *folder;
148};
149
150void dlg_browser(struct Buffer *file, SelectFileFlags flags, struct Mailbox *m, char ***files, int *numfiles);
151void mutt_browser_select_dir(const char *f);
152void mutt_browser_cleanup(void);
153
154void browser_sort(struct BrowserState *state);
155void 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);
156void browser_highlight_default(struct BrowserState *state, struct Menu *menu);
157int examine_directory(struct Mailbox *m, struct Menu *menu, struct BrowserState *state, const char *d, const char *prefix);
158int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state);
159void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar);
160void init_state(struct BrowserState *state, struct Menu *menu);
161bool link_is_dir(const char *folder, const char *path);
162void destroy_state(struct BrowserState *state);
163void dump_state(struct BrowserState *state);
164
165#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:683
void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar)
Set up a new menu.
Definition: dlg_browser.c:1023
void browser_sort(struct BrowserState *state)
Sort the entries in the browser.
Definition: sort.c:185
ExpandoDataFolder
Expando UIDs for the File Browser.
Definition: lib.h:115
@ ED_FOL_POLL
FolderFile.poll_new_mail.
Definition: lib.h:133
@ ED_FOL_NOTIFY
FolderFile.notify_user.
Definition: lib.h:131
@ ED_FOL_NEW_COUNT
FolderFile.nd (NntpMboxData)
Definition: lib.h:129
@ ED_FOL_FILE_OWNER
FolderFile.uid.
Definition: lib.h:122
@ ED_FOL_FILE_GROUP
FolderFile.gid.
Definition: lib.h:120
@ ED_FOL_FILENAME
FolderFile.name.
Definition: lib.h:119
@ ED_FOL_DATE_FORMAT
FolderFile.mtime.
Definition: lib.h:117
@ ED_FOL_UNREAD_COUNT
FolderFile.msg_unread.
Definition: lib.h:136
@ ED_FOL_FLAGS2
FolderFile.nd (NntpMboxData)
Definition: lib.h:125
@ ED_FOL_FILE_MODE
FolderFile.move.
Definition: lib.h:121
@ ED_FOL_NEW_MAIL
FolderFile.has_new_mail.
Definition: lib.h:130
@ ED_FOL_FILE_SIZE
FolderFile.size.
Definition: lib.h:123
@ ED_FOL_HARD_LINKS
FolderFile.nlink.
Definition: lib.h:126
@ ED_FOL_DATE
FolderFile.mtime.
Definition: lib.h:116
@ ED_FOL_STRF
FolderFile.mtime.
Definition: lib.h:134
@ ED_FOL_TAGGED
FolderFile.tagged.
Definition: lib.h:135
@ ED_FOL_NUMBER
Folder.num.
Definition: lib.h:132
@ ED_FOL_DESCRIPTION
FolderFile.desc, FolderFile.name.
Definition: lib.h:118
@ ED_FOL_MESSAGE_COUNT
FolderFile.msg_count.
Definition: lib.h:127
@ ED_FOL_NEWSGROUP
FolderFile.name.
Definition: lib.h:128
@ ED_FOL_FLAGS
FolderFile.nd (NntpMboxData)
Definition: lib.h:124
const struct CompleteOps CompleteFileOps
Auto-Completion of Files.
Definition: complete.c:153
struct Buffer LastDir
Browser: previous selected directory.
Definition: dlg_browser.c:139
void mutt_browser_select_dir(const char *f)
Remember the last directory selected.
Definition: dlg_browser.c:1267
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:141
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:706
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:632
void mutt_browser_cleanup(void)
Clean up working Buffers.
Definition: dlg_browser.c:162
void browser_highlight_default(struct BrowserState *state, struct Menu *menu)
Decide which browser item should be highlighted.
Definition: dlg_browser.c:997
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:833
uint8_t SelectFileFlags
Flags for mutt_select_file(), e.g. MUTT_SEL_MAILBOX.
Definition: lib.h:55
bool link_is_dir(const char *folder, const char *path)
Does this symlink point to a directory?
Definition: dlg_browser.c:175
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:1290
Convenience wrapper for the library headers.
State of the file/mailbox browser.
Definition: lib.h:143
char * folder
Folder name.
Definition: lib.h:146
bool is_mailbox_list
Viewing mailboxes.
Definition: lib.h:147
struct BrowserEntryArray entry
Array of files / dirs / mailboxes.
Definition: lib.h:144
bool imap_browse
IMAP folder.
Definition: lib.h:145
String manipulation buffer.
Definition: buffer.h:36
Browser entry representing a folder/dir.
Definition: lib.h:77
bool selectable
Folder can be selected.
Definition: lib.h:95
char delim
Path delimiter.
Definition: lib.h:92
bool imap
This is an IMAP folder.
Definition: lib.h:94
bool has_mailbox
This is a mailbox.
Definition: lib.h:97
char * name
Name of file/dir/mailbox.
Definition: lib.h:85
uid_t uid
File's User ID.
Definition: lib.h:81
bool tagged
Folder is tagged.
Definition: lib.h:101
gid_t gid
File's Group ID.
Definition: lib.h:82
bool has_new_mail
true if mailbox has "new mail"
Definition: lib.h:88
bool poll_new_mail
Check mailbox for new mail.
Definition: lib.h:100
bool notify_user
User will be notified of new mail.
Definition: lib.h:99
nlink_t nlink
Number of hard links.
Definition: lib.h:83
char * desc
Description of mailbox.
Definition: lib.h:86
struct NntpMboxData * nd
Extra NNTP data.
Definition: lib.h:102
off_t size
File size.
Definition: lib.h:79
int gen
Unique id, used for (un)sorting.
Definition: lib.h:104
time_t mtime
Modification time.
Definition: lib.h:80
int msg_count
total number of messages
Definition: lib.h:89
mode_t mode
File permissions.
Definition: lib.h:78
bool inferiors
Folder has children.
Definition: lib.h:96
int msg_unread
number of unread messages
Definition: lib.h:90
A folder/dir in the browser.
Definition: lib.h:68
int num
Number in the index.
Definition: lib.h:70
struct FolderFile * ff
File / Dir / Mailbox.
Definition: lib.h:69
A mailbox.
Definition: mailbox.h:79
Definition: lib.h:79
NNTP-specific Mailbox data -.
Definition: mdata.h:34