NeoMutt  2024-10-02-37-gfa9146
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
dlg_browser.c
Go to the documentation of this file.
1
76#include "config.h"
77#include <dirent.h>
78#include <errno.h>
79#include <grp.h>
80#include <limits.h>
81#include <locale.h>
82#include <pwd.h>
83#include <stdbool.h>
84#include <stdio.h>
85#include <string.h>
86#include <sys/stat.h>
87#include <time.h>
88#include "mutt/lib.h"
89#include "config/lib.h"
90#include "core/lib.h"
91#include "conn/lib.h"
92#include "gui/lib.h"
93#include "lib.h"
94#include "expando/lib.h"
95#include "imap/lib.h"
96#include "key/lib.h"
97#include "menu/lib.h"
98#include "nntp/lib.h"
99#include "functions.h"
100#include "globals.h"
101#include "mutt_logging.h"
102#include "mutt_mailbox.h"
103#include "muttlib.h"
104#include "mx.h"
105#include "nntp/adata.h"
106#include "nntp/mdata.h"
107#include "private_data.h"
108
111
113static const struct Mapping FolderHelp[] = {
114 // clang-format off
115 { N_("Exit"), OP_EXIT },
116 { N_("Chdir"), OP_CHANGE_DIRECTORY },
117 { N_("Goto"), OP_BROWSER_GOTO_FOLDER },
118 { N_("Mask"), OP_ENTER_MASK },
119 { N_("Help"), OP_HELP },
120 { NULL, 0 },
121 // clang-format on
122};
123
125static const struct Mapping FolderNewsHelp[] = {
126 // clang-format off
127 { N_("Exit"), OP_EXIT },
128 { N_("List"), OP_TOGGLE_MAILBOXES },
129 { N_("Subscribe"), OP_BROWSER_SUBSCRIBE },
130 { N_("Unsubscribe"), OP_BROWSER_UNSUBSCRIBE },
131 { N_("Catchup"), OP_CATCHUP },
132 { N_("Mask"), OP_ENTER_MASK },
133 { N_("Help"), OP_HELP },
134 { NULL, 0 },
135 // clang-format on
136};
137
139struct Buffer LastDir = { 0 };
141struct Buffer LastDirBackup = { 0 };
142
148static void init_lastdir(void)
149{
150 static bool done = false;
151 if (!done)
152 {
155 done = true;
156 }
157}
158
163{
166}
167
175bool link_is_dir(const char *folder, const char *path)
176{
177 struct stat st = { 0 };
178 bool rc = false;
179
180 struct Buffer *fullpath = buf_pool_get();
181 buf_concat_path(fullpath, folder, path);
182
183 if (stat(buf_string(fullpath), &st) == 0)
184 rc = S_ISDIR(st.st_mode);
185
186 buf_pool_release(&fullpath);
187
188 return rc;
189}
190
194long folder_date_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
195{
196 const struct Folder *folder = data;
197
198 if (!folder->ff->local)
199 return 0;
200
201 return folder->ff->mtime;
202}
203
207void folder_date(const struct ExpandoNode *node, void *data,
208 MuttFormatFlags flags, struct Buffer *buf)
209{
210 const struct Folder *folder = data;
211
212 if (!folder->ff->local)
213 return;
214
215 bool use_c_locale = false;
216 const char *text = node->text;
217 if (*text == '!')
218 {
219 use_c_locale = true;
220 text++;
221 }
222
223 char tmp[128] = { 0 };
224 struct tm tm = mutt_date_localtime(folder->ff->mtime);
225
226 if (use_c_locale)
227 {
228 strftime_l(tmp, sizeof(tmp), text, &tm, NeoMutt->time_c_locale);
229 }
230 else
231 {
232 strftime(tmp, sizeof(tmp), text, &tm);
233 }
234
235 buf_strcpy(buf, tmp);
236}
237
241void folder_space(const struct ExpandoNode *node, void *data,
242 MuttFormatFlags flags, struct Buffer *buf)
243{
244 buf_addstr(buf, " ");
245}
246
250long folder_a_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
251{
252 const struct Folder *folder = data;
253
254 return folder->ff->notify_user;
255}
256
260long folder_C_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
261{
262 const struct Folder *folder = data;
263
264 return folder->num + 1;
265}
266
270long folder_d_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
271{
272 const struct Folder *folder = data;
273 if (!folder->ff->local)
274 return 0;
275
276 return folder->ff->mtime;
277}
278
282void folder_d(const struct ExpandoNode *node, void *data, MuttFormatFlags flags,
283 struct Buffer *buf)
284{
285 const struct Folder *folder = data;
286 if (!folder->ff->local)
287 return;
288
289 static const time_t one_year = 31536000;
290 const char *t_fmt = ((mutt_date_now() - folder->ff->mtime) < one_year) ?
291 "%b %d %H:%M" :
292 "%b %d %Y";
293
294 char tmp[128] = { 0 };
295
296 mutt_date_localtime_format(tmp, sizeof(tmp), t_fmt, folder->ff->mtime);
297
298 buf_strcpy(buf, tmp);
299}
300
304long folder_D_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
305{
306 const struct Folder *folder = data;
307 if (!folder->ff->local)
308 return 0;
309
310 return folder->ff->mtime;
311}
312
316void folder_D(const struct ExpandoNode *node, void *data, MuttFormatFlags flags,
317 struct Buffer *buf)
318{
319 const struct Folder *folder = data;
320 if (!folder->ff->local)
321 return;
322
323 char tmp[128] = { 0 };
324 bool use_c_locale = false;
325 const char *const c_date_format = cs_subset_string(NeoMutt->sub, "date_format");
326 const char *t_fmt = NONULL(c_date_format);
327 if (*t_fmt == '!')
328 {
329 t_fmt++;
330 use_c_locale = true;
331 }
332
333 if (use_c_locale)
334 {
335 mutt_date_localtime_format_locale(tmp, sizeof(tmp), t_fmt,
336 folder->ff->mtime, NeoMutt->time_c_locale);
337 }
338 else
339 {
340 mutt_date_localtime_format(tmp, sizeof(tmp), t_fmt, folder->ff->mtime);
341 }
342
343 buf_strcpy(buf, tmp);
344}
345
349void folder_f(const struct ExpandoNode *node, void *data, MuttFormatFlags flags,
350 struct Buffer *buf)
351{
352 const struct Folder *folder = data;
353
354 const char *s = NONULL(folder->ff->name);
355
356 buf_printf(buf, "%s%s", s,
357 folder->ff->local ?
358 (S_ISLNK(folder->ff->mode) ?
359 "@" :
360 (S_ISDIR(folder->ff->mode) ?
361 "/" :
362 (((folder->ff->mode & S_IXUSR) != 0) ? "*" : ""))) :
363 "");
364}
365
369void folder_F(const struct ExpandoNode *node, void *data, MuttFormatFlags flags,
370 struct Buffer *buf)
371{
372 const struct Folder *folder = data;
373
374 if (folder->ff->local)
375 {
376 buf_printf(buf, "%c%c%c%c%c%c%c%c%c%c",
377 S_ISDIR(folder->ff->mode) ? 'd' : (S_ISLNK(folder->ff->mode) ? 'l' : '-'),
378 ((folder->ff->mode & S_IRUSR) != 0) ? 'r' : '-',
379 ((folder->ff->mode & S_IWUSR) != 0) ? 'w' : '-',
380 ((folder->ff->mode & S_ISUID) != 0) ? 's' :
381 ((folder->ff->mode & S_IXUSR) != 0) ? 'x' :
382 '-',
383 ((folder->ff->mode & S_IRGRP) != 0) ? 'r' : '-',
384 ((folder->ff->mode & S_IWGRP) != 0) ? 'w' : '-',
385 ((folder->ff->mode & S_ISGID) != 0) ? 's' :
386 ((folder->ff->mode & S_IXGRP) != 0) ? 'x' :
387 '-',
388 ((folder->ff->mode & S_IROTH) != 0) ? 'r' : '-',
389 ((folder->ff->mode & S_IWOTH) != 0) ? 'w' : '-',
390 ((folder->ff->mode & S_ISVTX) != 0) ? 't' :
391 ((folder->ff->mode & S_IXOTH) != 0) ? 'x' :
392 '-');
393 }
394 else if (folder->ff->imap)
395 {
396 /* mark folders with subfolders AND mail */
397 buf_printf(buf, "IMAP %c", (folder->ff->inferiors && folder->ff->selectable) ? '+' : ' ');
398 }
399}
400
404void folder_g(const struct ExpandoNode *node, void *data, MuttFormatFlags flags,
405 struct Buffer *buf)
406{
407 const struct Folder *folder = data;
408 if (!folder->ff->local)
409 return;
410
411 struct group *gr = getgrgid(folder->ff->gid);
412 if (gr)
413 {
414 buf_addstr(buf, gr->gr_name);
415 }
416 else
417 {
418 buf_printf(buf, "%u", folder->ff->gid);
419 }
420}
421
425void folder_i(const struct ExpandoNode *node, void *data, MuttFormatFlags flags,
426 struct Buffer *buf)
427{
428 const struct Folder *folder = data;
429
430 const char *s = NULL;
431 if (folder->ff->desc)
432 s = folder->ff->desc;
433 else
434 s = folder->ff->name;
435
436 buf_printf(buf, "%s%s", s,
437 folder->ff->local ?
438 (S_ISLNK(folder->ff->mode) ?
439 "@" :
440 (S_ISDIR(folder->ff->mode) ?
441 "/" :
442 (((folder->ff->mode & S_IXUSR) != 0) ? "*" : ""))) :
443 "");
444}
445
449long folder_l_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
450{
451 const struct Folder *folder = data;
452
453 if (folder->ff->local)
454 return folder->ff->nlink;
455
456 return 0;
457}
458
462void folder_l(const struct ExpandoNode *node, void *data, MuttFormatFlags flags,
463 struct Buffer *buf)
464{
465 const struct Folder *folder = data;
466 if (!folder->ff->local)
467 return;
468
469 buf_add_printf(buf, "%d", (int) folder->ff->nlink);
470}
471
475long folder_m_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
476{
477 const struct Folder *folder = data;
478
479 if (folder->ff->has_mailbox)
480 return folder->ff->msg_count;
481
482 return 0;
483}
484
488void folder_m(const struct ExpandoNode *node, void *data, MuttFormatFlags flags,
489 struct Buffer *buf)
490{
491 const struct Folder *folder = data;
492 if (!folder->ff->has_mailbox)
493 return;
494
495 buf_add_printf(buf, "%d", folder->ff->msg_count);
496}
497
501long folder_n_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
502{
503 const struct Folder *folder = data;
504
505 if (folder->ff->has_mailbox)
506 return folder->ff->msg_unread;
507
508 return 0;
509}
510
514void folder_n(const struct ExpandoNode *node, void *data, MuttFormatFlags flags,
515 struct Buffer *buf)
516{
517 const struct Folder *folder = data;
518 if (!folder->ff->has_mailbox)
519 return;
520
521 buf_add_printf(buf, "%d", folder->ff->msg_unread);
522}
523
527long folder_N_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
528{
529 const struct Folder *folder = data;
530 return folder->ff->has_new_mail;
531}
532
536void folder_N(const struct ExpandoNode *node, void *data, MuttFormatFlags flags,
537 struct Buffer *buf)
538{
539 const struct Folder *folder = data;
540
541 // NOTE(g0mb4): use $to_chars?
542 const char *s = folder->ff->has_new_mail ? "N" : " ";
543 buf_strcpy(buf, s);
544}
545
549long folder_p_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
550{
551 const struct Folder *folder = data;
552
553 return folder->ff->poll_new_mail;
554}
555
559long folder_s_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
560{
561 const struct Folder *folder = data;
562 return folder->ff->size;
563}
564
568void folder_s(const struct ExpandoNode *node, void *data, MuttFormatFlags flags,
569 struct Buffer *buf)
570{
571 const struct Folder *folder = data;
572
573 char tmp[128] = { 0 };
574
575 mutt_str_pretty_size(tmp, sizeof(tmp), folder->ff->size);
576 buf_strcpy(buf, tmp);
577}
578
582long folder_t_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
583{
584 const struct Folder *folder = data;
585 return folder->ff->tagged;
586}
587
591void folder_t(const struct ExpandoNode *node, void *data, MuttFormatFlags flags,
592 struct Buffer *buf)
593{
594 const struct Folder *folder = data;
595
596 // NOTE(g0mb4): use $to_chars?
597 const char *s = folder->ff->tagged ? "*" : " ";
598 buf_strcpy(buf, s);
599}
600
604void folder_u(const struct ExpandoNode *node, void *data, MuttFormatFlags flags,
605 struct Buffer *buf)
606{
607 const struct Folder *folder = data;
608 if (!folder->ff->local)
609 return;
610
611 struct passwd *pw = getpwuid(folder->ff->uid);
612 if (pw)
613 {
614 buf_addstr(buf, pw->pw_name);
615 }
616 else
617 {
618 buf_printf(buf, "%u", folder->ff->uid);
619 }
620}
621
632void browser_add_folder(const struct Menu *menu, struct BrowserState *state,
633 const char *name, const char *desc,
634 const struct stat *st, struct Mailbox *m, void *data)
635{
636 if ((!menu || state->is_mailbox_list) && m && !m->visible)
637 {
638 return;
639 }
640
641 struct FolderFile ff = { 0 };
642
643 if (st)
644 {
645 ff.mode = st->st_mode;
646 ff.mtime = st->st_mtime;
647 ff.size = st->st_size;
648 ff.gid = st->st_gid;
649 ff.uid = st->st_uid;
650 ff.nlink = st->st_nlink;
651 ff.local = true;
652 }
653 else
654 {
655 ff.local = false;
656 }
657
658 if (m)
659 {
660 ff.has_mailbox = true;
661 ff.gen = m->gen;
662 ff.has_new_mail = m->has_new;
663 ff.msg_count = m->msg_count;
664 ff.msg_unread = m->msg_unread;
665 ff.notify_user = m->notify_user;
667 }
668
669 ff.name = mutt_str_dup(name);
670 ff.desc = mutt_str_dup(desc ? desc : name);
671 ff.imap = false;
672 if (OptNews)
673 ff.nd = data;
674
675 ARRAY_ADD(&state->entry, ff);
676}
677
683void init_state(struct BrowserState *state, struct Menu *menu)
684{
685 ARRAY_INIT(&state->entry);
686 ARRAY_RESERVE(&state->entry, 256);
687 state->imap_browse = false;
688
689 if (menu)
690 {
691 menu->mdata = &state->entry;
692 menu->mdata_free = NULL; // Menu doesn't own the data
693 }
694}
695
706int examine_directory(struct Mailbox *m, struct Menu *menu, struct BrowserState *state,
707 const char *dirname, const char *prefix)
708{
709 int rc = -1;
710 struct Buffer *buf = buf_pool_get();
711 if (OptNews)
712 {
714
715 init_state(state, menu);
716
717 const struct Regex *c_mask = cs_subset_regex(NeoMutt->sub, "mask");
718 for (unsigned int i = 0; i < adata->groups_num; i++)
719 {
720 struct NntpMboxData *mdata = adata->groups_list[i];
721 if (!mdata)
722 continue;
723 if (prefix && *prefix && !mutt_str_startswith(mdata->group, prefix))
724 continue;
725 if (!mutt_regex_match(c_mask, mdata->group))
726 {
727 continue;
728 }
729 browser_add_folder(menu, state, mdata->group, NULL, NULL, NULL, mdata);
730 }
731 }
732 else
733 {
734 struct stat st = { 0 };
735 DIR *dir = NULL;
736 struct dirent *de = NULL;
737
738 while (stat(dirname, &st) == -1)
739 {
740 if (errno == ENOENT)
741 {
742 /* The last used directory is deleted, try to use the parent dir. */
743 char *c = strrchr(dirname, '/');
744
745 if (c && (c > dirname))
746 {
747 *c = '\0';
748 continue;
749 }
750 }
751 mutt_perror("%s", dirname);
752 goto ed_out;
753 }
754
755 if (!S_ISDIR(st.st_mode))
756 {
757 mutt_error(_("%s is not a directory"), dirname);
758 goto ed_out;
759 }
760
761 if (m)
763
764 dir = mutt_file_opendir(dirname, MUTT_OPENDIR_NONE);
765 if (!dir)
766 {
767 mutt_perror("%s", dirname);
768 goto ed_out;
769 }
770
771 init_state(state, menu);
772
773 struct MailboxList ml = STAILQ_HEAD_INITIALIZER(ml);
775
776 const struct Regex *c_mask = cs_subset_regex(NeoMutt->sub, "mask");
777 while ((de = readdir(dir)))
778 {
779 if (mutt_str_equal(de->d_name, "."))
780 continue; /* we don't need . */
781
782 if (prefix && *prefix && !mutt_str_startswith(de->d_name, prefix))
783 {
784 continue;
785 }
786 if (!mutt_regex_match(c_mask, de->d_name))
787 {
788 continue;
789 }
790
791 buf_concat_path(buf, dirname, de->d_name);
792 if (lstat(buf_string(buf), &st) == -1)
793 continue;
794
795 /* No size for directories or symlinks */
796 if (S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode))
797 st.st_size = 0;
798 else if (!S_ISREG(st.st_mode))
799 continue;
800
801 struct MailboxNode *np = NULL;
802 STAILQ_FOREACH(np, &ml, entries)
803 {
805 break;
806 }
807
808 if (np && m && m->poll_new_mail && mutt_str_equal(np->mailbox->realpath, m->realpath))
809 {
810 np->mailbox->msg_count = m->msg_count;
811 np->mailbox->msg_unread = m->msg_unread;
812 }
813 browser_add_folder(menu, state, de->d_name, NULL, &st, np ? np->mailbox : NULL, NULL);
814 }
816 closedir(dir);
817 }
818 browser_sort(state);
819 rc = 0;
820ed_out:
821 buf_pool_release(&buf);
822 return rc;
823}
824
833int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state)
834{
835 struct stat st = { 0 };
836 struct Buffer *md = NULL;
837 struct Buffer *mailbox = NULL;
838
839 if (OptNews)
840 {
842
843 init_state(state, menu);
844
845 const bool c_show_only_unread = cs_subset_bool(NeoMutt->sub, "show_only_unread");
846 for (unsigned int i = 0; i < adata->groups_num; i++)
847 {
848 struct NntpMboxData *mdata = adata->groups_list[i];
849 if (mdata && (mdata->has_new_mail ||
850 (mdata->subscribed && (mdata->unread || !c_show_only_unread))))
851 {
852 browser_add_folder(menu, state, mdata->group, NULL, NULL, NULL, mdata);
853 }
854 }
855 }
856 else
857 {
858 init_state(state, menu);
859
861 return -1;
862 mailbox = buf_pool_get();
863 md = buf_pool_get();
864
866
867 struct MailboxList ml = STAILQ_HEAD_INITIALIZER(ml);
869 struct MailboxNode *np = NULL;
870 const bool c_browser_abbreviate_mailboxes = cs_subset_bool(NeoMutt->sub, "browser_abbreviate_mailboxes");
871
872 STAILQ_FOREACH(np, &ml, entries)
873 {
874 if (!np->mailbox)
875 continue;
876
877 if (m && m->poll_new_mail && mutt_str_equal(np->mailbox->realpath, m->realpath))
878 {
879 np->mailbox->msg_count = m->msg_count;
880 np->mailbox->msg_unread = m->msg_unread;
881 }
882
884 if (c_browser_abbreviate_mailboxes)
886
887 switch (np->mailbox->type)
888 {
889 case MUTT_IMAP:
890 case MUTT_POP:
892 np->mailbox->name, NULL, np->mailbox, NULL);
893 continue;
894 case MUTT_NOTMUCH:
895 case MUTT_NNTP:
896 browser_add_folder(menu, state, mailbox_path(np->mailbox),
897 np->mailbox->name, NULL, np->mailbox, NULL);
898 continue;
899 default: /* Continue */
900 break;
901 }
902
903 if (lstat(mailbox_path(np->mailbox), &st) == -1)
904 continue;
905
906 if ((!S_ISREG(st.st_mode)) && (!S_ISDIR(st.st_mode)) && (!S_ISLNK(st.st_mode)))
907 continue;
908
909 if (np->mailbox->type == MUTT_MAILDIR)
910 {
911 struct stat st2 = { 0 };
912
913 buf_printf(md, "%s/new", mailbox_path(np->mailbox));
914 if (stat(buf_string(md), &st) < 0)
915 st.st_mtime = 0;
916 buf_printf(md, "%s/cur", mailbox_path(np->mailbox));
917 if (stat(buf_string(md), &st2) < 0)
918 st2.st_mtime = 0;
919 if (st2.st_mtime > st.st_mtime)
920 st.st_mtime = st2.st_mtime;
921 }
922
923 browser_add_folder(menu, state, buf_string(mailbox), np->mailbox->name,
924 &st, np->mailbox, NULL);
925 }
927 }
928 browser_sort(state);
929
930 buf_pool_release(&mailbox);
931 buf_pool_release(&md);
932 return 0;
933}
934
938static int select_file_search(struct Menu *menu, regex_t *rx, int line)
939{
940 struct BrowserEntryArray *entry = menu->mdata;
941 if (OptNews)
942 return regexec(rx, ARRAY_GET(entry, line)->desc, 0, NULL, 0);
943 struct FolderFile *ff = ARRAY_GET(entry, line);
944 char *search_on = ff->desc ? ff->desc : ff->name;
945
946 return regexec(rx, search_on, 0, NULL, 0);
947}
948
954static int folder_make_entry(struct Menu *menu, int line, int max_cols, struct Buffer *buf)
955{
956 struct BrowserState *bstate = menu->mdata;
957 struct BrowserEntryArray *entry = &bstate->entry;
958 struct Folder folder = {
959 .ff = ARRAY_GET(entry, line),
960 .num = line,
961 };
962
963 const bool c_arrow_cursor = cs_subset_bool(menu->sub, "arrow_cursor");
964 if (c_arrow_cursor)
965 {
966 const char *const c_arrow_string = cs_subset_string(menu->sub, "arrow_string");
967 max_cols -= (mutt_strwidth(c_arrow_string) + 1);
968 }
969
970 if (OptNews)
971 {
972 const struct Expando *c_group_index_format = cs_subset_expando(NeoMutt->sub, "group_index_format");
973 return expando_filter(c_group_index_format, GroupIndexRenderData, &folder,
974 MUTT_FORMAT_ARROWCURSOR, max_cols, buf);
975 }
976
977 if (bstate->is_mailbox_list)
978 {
979 const struct Expando *c_mailbox_folder_format = cs_subset_expando(NeoMutt->sub, "mailbox_folder_format");
980 return expando_filter(c_mailbox_folder_format, FolderRenderData, &folder,
981 MUTT_FORMAT_ARROWCURSOR, max_cols, buf);
982 }
983
984 const struct Expando *c_folder_format = cs_subset_expando(NeoMutt->sub, "folder_format");
985 return expando_filter(c_folder_format, FolderRenderData, &folder,
986 MUTT_FORMAT_ARROWCURSOR, max_cols, buf);
987}
988
997void browser_highlight_default(struct BrowserState *state, struct Menu *menu)
998{
999 menu->top = 0;
1000 /* Reset menu position to 1.
1001 * We do not risk overflow as the init_menu function changes
1002 * current if it is bigger than state->entrylen. */
1003 if (!ARRAY_EMPTY(&state->entry) &&
1004 (mutt_str_equal(ARRAY_FIRST(&state->entry)->desc, "..") ||
1005 mutt_str_equal(ARRAY_FIRST(&state->entry)->desc, "../")))
1006 {
1007 /* Skip the first entry, unless there's only one entry. */
1008 menu_set_index(menu, (menu->max > 1));
1009 }
1010 else
1011 {
1012 menu_set_index(menu, 0);
1013 }
1014}
1015
1023void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m,
1024 struct MuttWindow *sbar)
1025{
1026 char title[256] = { 0 };
1027 menu->max = ARRAY_SIZE(&state->entry);
1028
1029 int index = menu_get_index(menu);
1030 if (index >= menu->max)
1031 menu_set_index(menu, menu->max - 1);
1032 if (index < 0)
1033 menu_set_index(menu, 0);
1034 if (menu->top > index)
1035 menu->top = 0;
1036
1037 menu->num_tagged = 0;
1038
1039 if (OptNews)
1040 {
1041 if (state->is_mailbox_list)
1042 {
1043 snprintf(title, sizeof(title), _("Subscribed newsgroups"));
1044 }
1045 else
1046 {
1047 snprintf(title, sizeof(title), _("Newsgroups on server [%s]"),
1049 }
1050 }
1051 else
1052 {
1053 if (state->is_mailbox_list)
1054 {
1055 snprintf(title, sizeof(title), _("Mailboxes [%d]"),
1057 }
1058 else
1059 {
1060 struct Buffer *path = buf_pool_get();
1061 buf_copy(path, &LastDir);
1062 buf_pretty_mailbox(path);
1063 const struct Regex *c_mask = cs_subset_regex(NeoMutt->sub, "mask");
1064 const bool c_imap_list_subscribed = cs_subset_bool(NeoMutt->sub, "imap_list_subscribed");
1065 if (state->imap_browse && c_imap_list_subscribed)
1066 {
1067 snprintf(title, sizeof(title), _("Subscribed [%s], File mask: %s"),
1068 buf_string(path), NONULL(c_mask ? c_mask->pattern : NULL));
1069 }
1070 else
1071 {
1072 snprintf(title, sizeof(title), _("Directory [%s], File mask: %s"),
1073 buf_string(path), NONULL(c_mask ? c_mask->pattern : NULL));
1074 }
1075 buf_pool_release(&path);
1076 }
1077 }
1078 sbar_set_title(sbar, title);
1079
1080 /* Browser tracking feature.
1081 * The goal is to highlight the good directory if LastDir is the parent dir
1082 * of LastDirBackup (this occurs mostly when one hit "../"). It should also work
1083 * properly when the user is in examine_mailboxes-mode. */
1085 {
1086 char target_dir[PATH_MAX] = { 0 };
1087
1088 /* Check what kind of dir LastDirBackup is. */
1090 {
1091 mutt_str_copy(target_dir, buf_string(&LastDirBackup), sizeof(target_dir));
1092 imap_clean_path(target_dir, sizeof(target_dir));
1093 }
1094 else
1095 {
1096 mutt_str_copy(target_dir, strrchr(buf_string(&LastDirBackup), '/') + 1,
1097 sizeof(target_dir));
1098 }
1099
1100 /* If we get here, it means that LastDir is the parent directory of
1101 * LastDirBackup. I.e., we're returning from a subdirectory, and we want
1102 * to position the cursor on the directory we're returning from. */
1103 bool matched = false;
1104 struct FolderFile *ff = NULL;
1105 ARRAY_FOREACH(ff, &state->entry)
1106 {
1107 if (mutt_str_equal(ff->name, target_dir))
1108 {
1109 menu_set_index(menu, ARRAY_FOREACH_IDX);
1110 matched = true;
1111 break;
1112 }
1113 }
1114 if (!matched)
1115 browser_highlight_default(state, menu);
1116 }
1117 else
1118 {
1119 browser_highlight_default(state, menu);
1120 }
1121
1123}
1124
1128static int file_tag(struct Menu *menu, int sel, int act)
1129{
1130 struct BrowserEntryArray *entry = menu->mdata;
1131 struct FolderFile *ff = ARRAY_GET(entry, sel);
1132 if (S_ISDIR(ff->mode) ||
1133 (S_ISLNK(ff->mode) && link_is_dir(buf_string(&LastDir), ff->name)))
1134 {
1135 mutt_error(_("Can't attach a directory"));
1136 return 0;
1137 }
1138
1139 bool ot = ff->tagged;
1140 ff->tagged = ((act >= 0) ? act : !ff->tagged);
1141
1142 return ff->tagged - ot;
1143}
1144
1149{
1150 if (nc->event_type != NT_CONFIG)
1151 return 0;
1152 if (!nc->global_data || !nc->event_data)
1153 return -1;
1154
1155 struct EventConfig *ev_c = nc->event_data;
1156
1157 struct BrowserPrivateData *priv = nc->global_data;
1158 struct Menu *menu = priv->menu;
1159
1160 if (mutt_str_equal(ev_c->name, "browser_sort_dirs_first"))
1161 {
1162 struct BrowserState *state = menu->mdata;
1163 browser_sort(state);
1164 browser_highlight_default(state, menu);
1165 }
1166 else if (!mutt_str_equal(ev_c->name, "browser_abbreviate_mailboxes") &&
1167 !mutt_str_equal(ev_c->name, "date_format") &&
1168 !mutt_str_equal(ev_c->name, "folder") &&
1169 !mutt_str_equal(ev_c->name, "folder_format") &&
1170 !mutt_str_equal(ev_c->name, "group_index_format") &&
1171 !mutt_str_equal(ev_c->name, "mailbox_folder_format") &&
1172 !mutt_str_equal(ev_c->name, "sort_browser"))
1173 {
1174 return 0;
1175 }
1176
1178 mutt_debug(LL_DEBUG5, "config done, request WA_RECALC, MENU_REDRAW_FULL\n");
1179
1180 return 0;
1181}
1182
1189{
1190 if (nc->event_type != NT_MAILBOX)
1191 return 0;
1193 return 0;
1194 if (!nc->global_data || !nc->event_data)
1195 return -1;
1196
1197 struct BrowserPrivateData *priv = nc->global_data;
1198
1199 struct BrowserState *state = &priv->state;
1200 if (state->is_mailbox_list)
1201 {
1202 struct EventMailbox *ev_m = nc->event_data;
1203 struct Mailbox *m = ev_m->mailbox;
1204 struct FolderFile *ff = NULL;
1205 ARRAY_FOREACH(ff, &state->entry)
1206 {
1207 if (ff->gen != m->gen)
1208 continue;
1209
1210 ff->has_new_mail = m->has_new;
1211 ff->msg_count = m->msg_count;
1212 ff->msg_unread = m->msg_unread;
1213 ff->notify_user = m->notify_user;
1215 mutt_str_replace(&ff->desc, m->name);
1216 break;
1217 }
1218 }
1219
1221 mutt_debug(LL_DEBUG5, "mailbox done, request WA_RECALC, MENU_REDRAW_FULL\n");
1222
1223 return 0;
1224}
1225
1234{
1235 if (nc->event_type != NT_WINDOW)
1236 return 0;
1237 if (!nc->global_data || !nc->event_data)
1238 return -1;
1240 return 0;
1241
1242 struct BrowserPrivateData *priv = nc->global_data;
1243 struct MuttWindow *win_menu = priv->menu->win;
1244
1245 struct EventWindow *ev_w = nc->event_data;
1246 if (ev_w->win != win_menu)
1247 return 0;
1248
1252
1253 mutt_debug(LL_DEBUG5, "window delete done\n");
1254 return 0;
1255}
1256
1267void mutt_browser_select_dir(const char *f)
1268{
1269 init_lastdir();
1270
1272
1273 /* Method that will fetch the parent path depending on the type of the path. */
1274 char buf[PATH_MAX] = { 0 };
1275 mutt_get_parent_path(buf_string(&LastDirBackup), buf, sizeof(buf));
1276 buf_strcpy(&LastDir, buf);
1277}
1278
1290void dlg_browser(struct Buffer *file, SelectFileFlags flags, struct Mailbox *m,
1291 char ***files, int *numfiles)
1292{
1294 priv->file = file;
1295 priv->mailbox = m;
1296 priv->files = files;
1297 priv->numfiles = numfiles;
1298 struct MuttWindow *dlg = NULL;
1299
1300 priv->multiple = (flags & MUTT_SEL_MULTI);
1301 priv->folder = (flags & MUTT_SEL_FOLDER);
1302 priv->state.is_mailbox_list = (flags & MUTT_SEL_MAILBOX) && priv->folder;
1303 priv->last_selected_mailbox = -1;
1304
1305 init_lastdir();
1306
1307 if (OptNews)
1308 {
1309 if (buf_is_empty(file))
1310 {
1312
1313 /* default state for news reader mode is browse subscribed newsgroups */
1314 priv->state.is_mailbox_list = false;
1315 for (size_t i = 0; i < adata->groups_num; i++)
1316 {
1317 struct NntpMboxData *mdata = adata->groups_list[i];
1318 if (mdata && mdata->subscribed)
1319 {
1320 priv->state.is_mailbox_list = true;
1321 break;
1322 }
1323 }
1324 }
1325 else
1326 {
1327 buf_copy(priv->prefix, file);
1328 }
1329 }
1330 else if (!buf_is_empty(file))
1331 {
1332 buf_expand_path(file);
1333 if (imap_path_probe(buf_string(file), NULL) == MUTT_IMAP)
1334 {
1335 init_state(&priv->state, NULL);
1336 priv->state.imap_browse = true;
1337 if (imap_browse(buf_string(file), &priv->state) == 0)
1338 {
1339 buf_strcpy(&LastDir, priv->state.folder);
1340 browser_sort(&priv->state);
1341 }
1342 }
1343 else
1344 {
1345 int i;
1346 for (i = buf_len(file) - 1; (i > 0) && ((buf_string(file))[i] != '/'); i--)
1347 {
1348 ; // do nothing
1349 }
1350
1351 if (i > 0)
1352 {
1353 if ((buf_string(file))[0] == '/')
1354 {
1355 buf_strcpy_n(&LastDir, buf_string(file), i);
1356 }
1357 else
1358 {
1360 buf_addch(&LastDir, '/');
1361 buf_addstr_n(&LastDir, buf_string(file), i);
1362 }
1363 }
1364 else
1365 {
1366 if ((buf_string(file))[0] == '/')
1367 buf_strcpy(&LastDir, "/");
1368 else
1370 }
1371
1372 if ((i <= 0) && (buf_string(file)[0] != '/'))
1373 buf_copy(priv->prefix, file);
1374 else
1375 buf_strcpy(priv->prefix, buf_string(file) + i + 1);
1376 priv->kill_prefix = true;
1377 }
1378 }
1379 else
1380 {
1381 if (priv->folder)
1382 {
1383 /* Whether we use the tracking feature of the browser depends
1384 * on which sort method we chose to use. This variable is defined
1385 * only to help readability of the code. */
1386 bool browser_track = false;
1387
1388 const enum SortType c_sort_browser = cs_subset_sort(NeoMutt->sub, "sort_browser");
1389 switch (c_sort_browser & SORT_MASK)
1390 {
1391 case SORT_DESC:
1392 case SORT_SUBJECT:
1393 case SORT_ORDER:
1394 browser_track = true;
1395 break;
1396 }
1397
1398 /* We use mutt_browser_select_dir to initialize the two
1399 * variables (LastDir, LastDirBackup) at the appropriate
1400 * values.
1401 *
1402 * We do it only when LastDir is not set (first pass there)
1403 * or when CurrentFolder and LastDirBackup are not the same.
1404 * This code is executed only when we list files, not when
1405 * we press up/down keys to navigate in a displayed list.
1406 *
1407 * We only do this when CurrentFolder has been set (ie, not
1408 * when listing folders on startup with "neomutt -y").
1409 *
1410 * This tracker is only used when browser_track is true,
1411 * meaning only with sort methods SUBJECT/DESC for now. */
1412 if (CurrentFolder)
1413 {
1414 if (buf_is_empty(&LastDir))
1415 {
1416 /* If browsing in "local"-mode, than we chose to define LastDir to
1417 * MailDir */
1419 {
1420 case MUTT_IMAP:
1421 case MUTT_MAILDIR:
1422 case MUTT_MBOX:
1423 case MUTT_MH:
1424 case MUTT_MMDF:
1425 {
1426 const char *const c_folder = cs_subset_string(NeoMutt->sub, "folder");
1427 const char *const c_spool_file = cs_subset_string(NeoMutt->sub, "spool_file");
1428 if (c_folder)
1429 buf_strcpy(&LastDir, c_folder);
1430 else if (c_spool_file)
1431 mutt_browser_select_dir(c_spool_file);
1432 break;
1433 }
1434 default:
1436 break;
1437 }
1438 }
1440 {
1442 }
1443 }
1444
1445 /* When browser tracking feature is disabled, clear LastDirBackup */
1446 if (!browser_track)
1448 }
1449 else
1450 {
1452 }
1453
1454 if (!priv->state.is_mailbox_list &&
1456 {
1457 init_state(&priv->state, NULL);
1458 priv->state.imap_browse = true;
1460 browser_sort(&priv->state);
1461 }
1462 else
1463 {
1464 size_t i = buf_len(&LastDir);
1465 while ((i > 0) && (buf_string(&LastDir)[--i] == '/'))
1466 LastDir.data[i] = '\0';
1468 if (buf_is_empty(&LastDir))
1470 }
1471 }
1472
1473 buf_reset(file);
1474
1475 const struct Mapping *help_data = NULL;
1476
1477 if (OptNews)
1478 help_data = FolderNewsHelp;
1479 else
1480 help_data = FolderHelp;
1481
1482 dlg = simple_dialog_new(MENU_FOLDER, WT_DLG_BROWSER, help_data);
1483
1484 priv->menu = dlg->wdata;
1485 dlg->wdata = priv;
1488 if (priv->multiple)
1489 priv->menu->tag = file_tag;
1490
1491 priv->sbar = window_find_child(dlg, WT_STATUS_BAR);
1493
1494 struct MuttWindow *win_menu = priv->menu->win;
1495
1496 // NT_COLOR is handled by the SimpleDialog
1500
1501 struct MuttWindow *old_focus = window_set_focus(priv->menu->win);
1502
1503 if (priv->state.is_mailbox_list)
1504 {
1505 examine_mailboxes(m, NULL, &priv->state);
1506 }
1507 else if (!priv->state.imap_browse)
1508 {
1509 // examine_directory() calls browser_add_folder() which needs the menu
1510 if (examine_directory(m, priv->menu, &priv->state, buf_string(&LastDir),
1511 buf_string(priv->prefix)) == -1)
1512 {
1513 goto bail;
1514 }
1515 }
1516
1517 init_menu(&priv->state, priv->menu, m, priv->sbar);
1518 // only now do we have a valid priv->state to attach
1519 priv->menu->mdata = &priv->state;
1520
1521 // ---------------------------------------------------------------------------
1522 // Event Loop
1523 int op = OP_NULL;
1524 do
1525 {
1526 menu_tagging_dispatcher(priv->menu->win, op);
1527 window_redraw(NULL);
1528
1530 mutt_debug(LL_DEBUG1, "Got op %s (%d)\n", opcodes_get_name(op), op);
1531 if (op < 0)
1532 continue;
1533 if (op == OP_NULL)
1534 {
1536 continue;
1537 }
1539
1540 int rc = browser_function_dispatcher(priv->win_browser, op);
1541
1542 if (rc == FR_UNKNOWN)
1543 rc = menu_function_dispatcher(priv->menu->win, op);
1544 if (rc == FR_UNKNOWN)
1545 rc = global_function_dispatcher(NULL, op);
1546 } while (!priv->done);
1547 // ---------------------------------------------------------------------------
1548
1549bail:
1550 window_set_focus(old_focus);
1551 simple_dialog_free(&dlg);
1553}
1554
1560const struct ExpandoRenderData FolderRenderData[] = {
1561 // clang-format off
1580 { -1, -1, NULL, NULL },
1581 // clang-format on
1582};
1583
1589const struct ExpandoRenderData GroupIndexRenderData[] = {
1590 // clang-format off
1600 { -1, -1, NULL, NULL },
1601 // clang-format on
1602};
#define ARRAY_RESERVE(head, num)
Reserve memory for the array.
Definition: array.h:189
#define ARRAY_FIRST(head)
Convenience method to get the first element.
Definition: array.h:135
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
Definition: array.h:156
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition: array.h:212
#define ARRAY_EMPTY(head)
Check if an array is empty.
Definition: array.h:74
#define ARRAY_SIZE(head)
The number of elements stored.
Definition: array.h:87
#define ARRAY_INIT(head)
Initialize an array.
Definition: array.h:65
#define ARRAY_GET(head, idx)
Return the element at index.
Definition: array.h:109
int browser_function_dispatcher(struct MuttWindow *win, int op)
Perform a Browser function.
Definition: functions.c:1140
#define MUTT_SEL_MAILBOX
Select a mailbox.
Definition: lib.h:57
void browser_sort(struct BrowserState *state)
Sort the entries in the browser.
Definition: sort.c:185
@ 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
#define MUTT_SEL_FOLDER
Select a local directory.
Definition: lib.h:59
#define MUTT_SEL_MULTI
Multi-selection is enabled.
Definition: lib.h:58
uint8_t SelectFileFlags
Flags for mutt_select_file(), e.g. MUTT_SEL_MAILBOX.
Definition: lib.h:55
struct BrowserPrivateData * browser_private_data_new(void)
Create new Browser Data.
Definition: private_data.c:55
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:161
int buf_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
Definition: buffer.c:204
size_t buf_addstr_n(struct Buffer *buf, const char *s, size_t len)
Add a string to a Buffer, expanding it if necessary.
Definition: buffer.c:96
size_t buf_len(const struct Buffer *buf)
Calculate the length of a Buffer.
Definition: buffer.c:491
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:377
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition: buffer.c:76
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition: buffer.c:291
void buf_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
Definition: buffer.c:182
size_t buf_strcpy_n(struct Buffer *buf, const char *s, size_t len)
Copy a string into a Buffer.
Definition: buffer.c:416
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
Definition: buffer.c:241
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition: buffer.c:226
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:395
size_t buf_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
Definition: buffer.c:601
size_t buf_concat_path(struct Buffer *buf, const char *dir, const char *fname)
Join a directory name and a filename.
Definition: buffer.c:509
void buf_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
Definition: buffer.c:337
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:96
const struct Regex * cs_subset_regex(const struct ConfigSubset *sub, const char *name)
Get a regex config item by name.
Definition: helpers.c:217
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:291
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:47
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Definition: helpers.c:266
const struct Expando * cs_subset_expando(const struct ConfigSubset *sub, const char *name)
Get an Expando config item by name.
Definition: config_type.c:357
Convenience wrapper for the config headers.
Connection Library.
Convenience wrapper for the core headers.
@ NT_MAILBOX_DELETE
Mailbox is about to be deleted.
Definition: mailbox.h:183
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition: mailbox.h:223
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Definition: mailbox.h:51
@ MUTT_MMDF
'mmdf' Mailbox type
Definition: mailbox.h:46
@ MUTT_POP
'POP3' Mailbox type
Definition: mailbox.h:52
@ MUTT_MH
'MH' Mailbox type
Definition: mailbox.h:47
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
Definition: mailbox.h:49
@ MUTT_IMAP
'IMAP' Mailbox type
Definition: mailbox.h:50
@ MUTT_MBOX
'mbox' Mailbox type
Definition: mailbox.h:45
@ MUTT_MAILBOX_ANY
Match any Mailbox type.
Definition: mailbox.h:42
@ MUTT_MAILDIR
'Maildir' Mailbox type
Definition: mailbox.h:48
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
Definition: curs_lib.c:443
@ FR_UNKNOWN
Unknown function.
Definition: dispatcher.h:33
void init_state(struct BrowserState *state, struct Menu *menu)
Initialise a browser state.
Definition: dlg_browser.c:683
int examine_directory(struct Mailbox *m, struct Menu *menu, struct BrowserState *state, const char *dirname, const char *prefix)
Get list of all files/newsgroups with mask.
Definition: dlg_browser.c:706
const struct ExpandoRenderData GroupIndexRenderData[]
Callbacks for Nntp Browser Expandos.
Definition: dlg_browser.c:110
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
static void init_lastdir(void)
Initialise the browser directories.
Definition: dlg_browser.c:148
const struct ExpandoRenderData FolderRenderData[]
Callbacks for Browser Expandos.
Definition: dlg_browser.c:109
static const struct Mapping FolderNewsHelp[]
Help Bar for the NNTP Mailbox browser dialog.
Definition: dlg_browser.c:125
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
struct Buffer LastDirBackup
Browser: backup copy of the current directory.
Definition: dlg_browser.c:141
static const struct Mapping FolderHelp[]
Help Bar for the File/Dir/Mailbox browser dialog.
Definition: dlg_browser.c:113
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
int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state)
Get list of mailboxes/subscribed newsgroups.
Definition: dlg_browser.c:833
bool link_is_dir(const char *folder, const char *path)
Does this symlink point to a directory?
Definition: dlg_browser.c:175
@ ED_FOLDER
Folder ED_FOL_ ExpandoDataFolder.
Definition: domain.h:43
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition: domain.h:44
int expando_filter(const struct Expando *exp, const struct ExpandoRenderData *rdata, void *data, MuttFormatFlags flags, int max_cols, struct Buffer *buf)
Render an Expando and run the result through a filter.
Definition: filter.c:138
Parse Expando string.
DIR * mutt_file_opendir(const char *path, enum MuttOpenDirMode mode)
Open a directory.
Definition: file.c:642
@ MUTT_OPENDIR_NONE
Plain opendir()
Definition: file.h:63
int km_dokey(enum MenuType mtype, GetChFlags flags)
Determine what a keypress should do.
Definition: get.c:464
void km_error_key(enum MenuType mtype)
Handle an unbound key sequence.
Definition: get.c:294
bool OptNews
(pseudo) used to change reader mode
Definition: globals.c:67
char * CurrentFolder
Currently selected mailbox.
Definition: globals.c:42
int menu_tagging_dispatcher(struct MuttWindow *win, int op)
Perform tagging operations on the Menu - Implements function_dispatcher_t -.
Definition: tagging.c:230
int global_function_dispatcher(struct MuttWindow *win, int op)
Perform a Global function - Implements function_dispatcher_t -.
Definition: global.c:172
int menu_function_dispatcher(struct MuttWindow *win, int op)
Perform a Menu function - Implements function_dispatcher_t -.
Definition: functions.c:318
long group_index_a_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
NNTP: Alert for new mail - Implements ExpandoRenderData::get_number() -.
Definition: browse.c:45
long folder_date_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Browser: Last modified (strftime) - Implements ExpandoRenderData::get_number() -.
Definition: dlg_browser.c:194
long folder_d_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Browser: Last modified - Implements ExpandoRenderData::get_number() -.
Definition: dlg_browser.c:270
long folder_s_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Browser: Size in bytes - Implements ExpandoRenderData::get_number() -.
Definition: dlg_browser.c:559
long folder_t_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Browser: Is Tagged - Implements ExpandoRenderData::get_number() -.
Definition: dlg_browser.c:582
long folder_l_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Browser: Hard links - Implements ExpandoRenderData::get_number() -.
Definition: dlg_browser.c:449
long folder_D_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Browser: Last modified ($date_format) - Implements ExpandoRenderData::get_number() -.
Definition: dlg_browser.c:304
long folder_N_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Browser: New mail flag - Implements ExpandoRenderData::get_number() -.
Definition: dlg_browser.c:527
long folder_m_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Browser: Number of messages - Implements ExpandoRenderData::get_number() -.
Definition: dlg_browser.c:475
long group_index_p_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
NNTP: Poll for new mail - Implements ExpandoRenderData::get_number() -.
Definition: browse.c:166
long group_index_s_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
NNTP: Number of unread articles - Implements ExpandoRenderData::get_number() -.
Definition: browse.c:176
long folder_n_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Browser: Number of unread messages - Implements ExpandoRenderData::get_number() -.
Definition: dlg_browser.c:501
long folder_p_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Browser: Poll for new mail - Implements ExpandoRenderData::get_number() -.
Definition: dlg_browser.c:549
long group_index_C_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
NNTP: Index number - Implements ExpandoRenderData::get_number() -.
Definition: browse.c:55
long group_index_n_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
NNTP: Number of new articles - Implements ExpandoRenderData::get_number() -.
Definition: browse.c:125
long folder_a_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Browser: Alert for new mail - Implements ExpandoRenderData::get_number() -.
Definition: dlg_browser.c:250
long folder_C_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Browser: Index number - Implements ExpandoRenderData::get_number() -.
Definition: dlg_browser.c:260
void folder_u(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: Owner name - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:604
void folder_g(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: Group name - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:404
void folder_i(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: Description - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:425
void group_index_d(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
NNTP: Description - Implements ExpandoRenderData::get_string() -.
Definition: browse.c:65
void folder_f(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: Filename - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:349
void group_index_f(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
NNTP: Newsgroup name - Implements ExpandoRenderData::get_string() -.
Definition: browse.c:91
void folder_m(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: Number of messages - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:488
void folder_d(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: Last modified - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:282
void folder_s(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: Size in bytes - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:568
void folder_date(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: Last modified (strftime) - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:207
void folder_t(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: Is Tagged - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:591
void folder_D(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: Last modified ($date_format) - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:316
void folder_l(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: Hard links - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:462
void group_index_M(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
NNTP: Moderated flag - Implements ExpandoRenderData::get_string() -.
Definition: browse.c:103
void folder_N(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: New mail flag - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:536
void folder_F(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: File permissions - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:369
void folder_n(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Browser: Number of unread messages - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:514
void group_index_N(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
NNTP: New flag - Implements ExpandoRenderData::get_string() -.
Definition: browse.c:144
void folder_space(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Fixed whitespace - Implements ExpandoRenderData::get_string() -.
Definition: dlg_browser.c:241
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
#define mutt_error(...)
Definition: logging2.h:92
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
#define mutt_perror(...)
Definition: logging2.h:93
static int folder_make_entry(struct Menu *menu, int line, int max_cols, struct Buffer *buf)
Format a Folder for the Menu - Implements Menu::make_entry() -.
Definition: dlg_browser.c:954
static int select_file_search(struct Menu *menu, regex_t *rx, int line)
Menu search callback for matching files - Implements Menu::search() -.
Definition: dlg_browser.c:938
static int file_tag(struct Menu *menu, int sel, int act)
Tag an entry in the menu - Implements Menu::tag() -.
Definition: dlg_browser.c:1128
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe() -.
Definition: imap.c:2345
static int browser_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: dlg_browser.c:1148
static int browser_mailbox_observer(struct NotifyCallback *nc)
Notification that a Mailbox has changed - Implements observer_t -.
Definition: dlg_browser.c:1188
static int browser_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: dlg_browser.c:1233
void browser_private_data_free(struct BrowserPrivateData **ptr)
Free Private Browser Data - Implements MuttWindow::wdata_free() -.
Definition: private_data.c:37
Convenience wrapper for the gui headers.
void simple_dialog_free(struct MuttWindow **ptr)
Destroy a simple index Dialog.
Definition: simple.c:168
struct MuttWindow * simple_dialog_new(enum MenuType mtype, enum WindowType wtype, const struct Mapping *help_data)
Create a simple index Dialog.
Definition: simple.c:132
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
Definition: browse.c:197
IMAP network mailbox.
void imap_clean_path(char *path, size_t plen)
Cleans an IMAP path using imap_fix_path.
Definition: util.c:192
Manage keymappings.
#define GETCH_NO_FLAGS
No flags are set.
Definition: lib.h:51
@ LL_DEBUG5
Log at debug level 5.
Definition: logging2.h:47
@ LL_DEBUG1
Log at debug level 1.
Definition: logging2.h:43
GUI present the user with a selectable list.
#define MENU_REDRAW_FULL
Redraw everything.
Definition: lib.h:59
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition: menu.c:184
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition: menu.c:160
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition: menu.c:174
struct tm mutt_date_localtime(time_t t)
Converts calendar time to a broken-down time structure expressed in user timezone.
Definition: date.c:906
size_t mutt_date_localtime_format(char *buf, size_t buflen, const char *format, time_t t)
Format localtime.
Definition: date.c:951
size_t mutt_date_localtime_format_locale(char *buf, size_t buflen, const char *format, time_t t, locale_t loc)
Format localtime using a given locale.
Definition: date.c:969
time_t mutt_date_now(void)
Return the number of seconds since the Unix epoch.
Definition: date.c:456
Convenience wrapper for the library headers.
#define N_(a)
Definition: message.h:32
#define _(a)
Definition: message.h:28
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition: notify.c:230
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition: notify.c:191
const char * mutt_path_getcwd(struct Buffer *cwd)
Get the current working directory.
Definition: path.c:476
bool mutt_regex_match(const struct Regex *regex, const char *str)
Shorthand to mutt_regex_capture()
Definition: regex.c:614
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:253
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:660
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
Definition: string.c:230
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:581
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:280
#define PATH_MAX
Definition: mutt.h:42
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:74
NeoMutt Logging.
int mutt_mailbox_check(struct Mailbox *m_cur, CheckStatsFlags flags)
Check all all Mailboxes for new mail.
Definition: mutt_mailbox.c:169
Mailbox helper functions.
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
Definition: mutt_window.c:633
struct MuttWindow * window_set_focus(struct MuttWindow *win)
Set the Window focus.
Definition: mutt_window.c:683
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
Definition: mutt_window.c:532
@ WT_DLG_BROWSER
Browser Dialog, dlg_browser()
Definition: mutt_window.h:80
@ WT_STATUS_BAR
Status Bar containing extra info about the Index/Pager/etc.
Definition: mutt_window.h:101
@ WT_MENU
An Window containing a Menu.
Definition: mutt_window.h:97
@ NT_WINDOW_DELETE
Window is about to be deleted.
Definition: mutt_window.h:228
void mutt_get_parent_path(const char *path, char *buf, size_t buflen)
Find the parent of a path (or mailbox)
Definition: muttlib.c:936
void buf_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
Definition: muttlib.c:519
void mutt_str_pretty_size(char *buf, size_t buflen, size_t num)
Display an abbreviated size, like 3.4K.
Definition: muttlib.c:1004
void buf_expand_path(struct Buffer *buf)
Create the canonical path.
Definition: muttlib.c:315
Some miscellaneous functions.
enum MailboxType mx_path_probe(const char *path)
Find a mailbox that understands a path.
Definition: mx.c:1321
API for mailboxes.
#define MUTT_MAILBOX_CHECK_NO_FLAGS
No flags are set.
Definition: mxapi.h:53
void neomutt_mailboxlist_clear(struct MailboxList *ml)
Free a Mailbox List.
Definition: neomutt.c:168
size_t neomutt_mailboxlist_get_all(struct MailboxList *head, struct NeoMutt *n, enum MailboxType type)
Get a List of all Mailboxes.
Definition: neomutt.c:191
Nntp-specific Account data.
Usenet network mailbox type; talk to an NNTP server.
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
Definition: nntp.c:77
Nntp-specific Mailbox data.
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:57
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:43
@ NT_MAILBOX
Mailbox has changed, NotifyMailbox, EventMailbox.
Definition: notify_type.h:49
const char * opcodes_get_name(int op)
Get the name of an opcode.
Definition: opcodes.c:48
Private state data for the Pager.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:81
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition: pool.c:94
#define STAILQ_HEAD_INITIALIZER(head)
Definition: queue.h:324
#define STAILQ_FOREACH(var, head, field)
Definition: queue.h:352
#define TAILQ_EMPTY(head)
Definition: queue.h:721
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: render.h:37
uint8_t MuttFormatFlags
Flags for expando_render(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition: render.h:32
void sbar_set_title(struct MuttWindow *win, const char *title)
Set the title for the Simple Bar.
Definition: sbar.c:227
Sidebar functions.
#define SORT_MASK
Mask for the sort id.
Definition: sort2.h:70
SortType
Methods for sorting.
Definition: sort2.h:34
@ SORT_SUBJECT
Sort by the email's subject.
Definition: sort2.h:38
@ SORT_ORDER
Sort by the order the messages appear in the mailbox.
Definition: sort2.h:40
@ SORT_DESC
Sort by the folder's description.
Definition: sort2.h:55
Key value store.
#define NONULL(x)
Definition: string2.h:37
void * adata
Private data (for Mailbox backends)
Definition: account.h:42
Private state data for the Browser.
Definition: private_data.h:34
char *** files
Array of selected files.
Definition: private_data.h:38
struct Menu * menu
Menu.
Definition: private_data.h:43
struct Buffer * prefix
Folder prefix string.
Definition: private_data.h:49
bool kill_prefix
Prefix is in use.
Definition: private_data.h:44
bool done
Should we close the Dialog?
Definition: private_data.h:53
bool folder
Select folders.
Definition: private_data.h:46
int last_selected_mailbox
Index of last selected Mailbox.
Definition: private_data.h:50
int * numfiles
Number of selected files.
Definition: private_data.h:39
struct Mailbox * mailbox
Mailbox.
Definition: private_data.h:37
struct BrowserState state
State containing list of files/dir/mailboxes.
Definition: private_data.h:42
struct Buffer * file
Buffer for the result.
Definition: private_data.h:36
bool multiple
Allow multiple selections.
Definition: private_data.h:45
struct MuttWindow * win_browser
Browser Window.
Definition: private_data.h:52
struct MuttWindow * sbar
Status Bar.
Definition: private_data.h:51
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
char * data
Pointer to data.
Definition: buffer.h:37
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition: subset.h:52
char host[128]
Server to login to.
Definition: connaccount.h:54
struct ConnAccount account
Account details: username, password, etc.
Definition: connection.h:49
A config-change event.
Definition: subset.h:71
const char * name
Name of config item that changed.
Definition: subset.h:73
An Event that happened to a Mailbox.
Definition: mailbox.h:199
struct Mailbox * mailbox
The Mailbox this Event relates to.
Definition: mailbox.h:200
An Event that happened to a Window.
Definition: mutt_window.h:238
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:239
WindowNotifyFlags flags
Attributes of Window that changed.
Definition: mutt_window.h:240
Basic Expando Node.
Definition: node.h:67
const char * text
Node-specific text.
Definition: node.h:73
Parsed Expando trees.
Definition: expando.h:41
Browser entry representing a folder/dir.
Definition: lib.h:77
bool selectable
Folder can be selected.
Definition: lib.h:95
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
List of Mailboxes.
Definition: mailbox.h:166
struct Mailbox * mailbox
Mailbox in the list.
Definition: mailbox.h:167
A mailbox.
Definition: mailbox.h:79
bool has_new
Mailbox has new mail.
Definition: mailbox.h:85
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
Definition: mailbox.h:81
int msg_count
Total number of messages.
Definition: mailbox.h:88
enum MailboxType type
Mailbox type.
Definition: mailbox.h:102
bool poll_new_mail
Check for new mail.
Definition: mailbox.h:115
void * mdata
Driver specific data.
Definition: mailbox.h:132
char * name
A short name for the Mailbox.
Definition: mailbox.h:82
bool notify_user
Notify the user of new mail.
Definition: mailbox.h:113
bool visible
True if a result of "mailboxes".
Definition: mailbox.h:130
int msg_unread
Number of unread messages.
Definition: mailbox.h:89
int gen
Generation number, for sorting.
Definition: mailbox.h:147
Mapping between user-readable string and a constant.
Definition: mapping.h:33
Definition: lib.h:79
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:86
int num_tagged
Number of tagged entries.
Definition: lib.h:93
void(* mdata_free)(struct Menu *menu, void **ptr)
Definition: lib.h:161
int(* search)(struct Menu *menu, regex_t *rx, int line)
Definition: lib.h:119
int top
Entry that is the top of the current page.
Definition: lib.h:90
int(* tag)(struct Menu *menu, int sel, int act)
Definition: lib.h:131
int(* make_entry)(struct Menu *menu, int line, int max_cols, struct Buffer *buf)
Definition: lib.h:106
struct ConfigSubset * sub
Inherited config items.
Definition: lib.h:87
void * mdata
Private data.
Definition: lib.h:147
int max
Number of entries in the menu.
Definition: lib.h:81
void * wdata
Private data.
Definition: mutt_window.h:144
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:137
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct AccountList accounts
List of all Accounts.
Definition: neomutt.h:47
struct Notify * notify
Notifications handler.
Definition: neomutt.h:43
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
locale_t time_c_locale
Current locale but LC_TIME=C.
Definition: neomutt.h:48
NNTP-specific Account data -.
Definition: adata.h:36
struct Connection * conn
Connection to NNTP Server.
Definition: adata.h:62
unsigned int groups_num
Definition: adata.h:58
void ** groups_list
Definition: adata.h:60
NNTP-specific Mailbox data -.
Definition: mdata.h:34
struct NntpAccountData * adata
Definition: mdata.h:48
Data passed to a notification function.
Definition: observer.h:34
void * event_data
Data from notify_send()
Definition: observer.h:38
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
Definition: observer.h:36
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
Definition: observer.h:37
void * global_data
Data from notify_observer_add()
Definition: observer.h:39
Cached regular expression.
Definition: regex3.h:86
char * pattern
printable version
Definition: regex3.h:87
@ MENU_FOLDER
General file/mailbox browser.
Definition: type.h:45
@ ED_GLO_PADDING_SPACE
Space Padding.
Definition: uid.h:39