NeoMutt  2024-11-14-34-g5aaf0d
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
682void init_state(struct BrowserState *state)
683{
684 ARRAY_INIT(&state->entry);
685 ARRAY_RESERVE(&state->entry, 256);
686 state->imap_browse = false;
687}
688
699int examine_directory(struct Mailbox *m, struct Menu *menu, struct BrowserState *state,
700 const char *dirname, const char *prefix)
701{
702 int rc = -1;
703 struct Buffer *buf = buf_pool_get();
704 if (OptNews)
705 {
707
708 init_state(state);
709
710 const struct Regex *c_mask = cs_subset_regex(NeoMutt->sub, "mask");
711 for (unsigned int i = 0; i < adata->groups_num; i++)
712 {
713 struct NntpMboxData *mdata = adata->groups_list[i];
714 if (!mdata)
715 continue;
716 if (prefix && *prefix && !mutt_str_startswith(mdata->group, prefix))
717 continue;
718 if (!mutt_regex_match(c_mask, mdata->group))
719 {
720 continue;
721 }
722 browser_add_folder(menu, state, mdata->group, NULL, NULL, NULL, mdata);
723 }
724 }
725 else
726 {
727 struct stat st = { 0 };
728 DIR *dir = NULL;
729 struct dirent *de = NULL;
730
731 while (stat(dirname, &st) == -1)
732 {
733 if (errno == ENOENT)
734 {
735 /* The last used directory is deleted, try to use the parent dir. */
736 char *c = strrchr(dirname, '/');
737
738 if (c && (c > dirname))
739 {
740 *c = '\0';
741 continue;
742 }
743 }
744 mutt_perror("%s", dirname);
745 goto ed_out;
746 }
747
748 if (!S_ISDIR(st.st_mode))
749 {
750 mutt_error(_("%s is not a directory"), dirname);
751 goto ed_out;
752 }
753
754 if (m)
756
757 dir = mutt_file_opendir(dirname, MUTT_OPENDIR_NONE);
758 if (!dir)
759 {
760 mutt_perror("%s", dirname);
761 goto ed_out;
762 }
763
764 init_state(state);
765
766 struct MailboxList ml = STAILQ_HEAD_INITIALIZER(ml);
768
769 const struct Regex *c_mask = cs_subset_regex(NeoMutt->sub, "mask");
770 while ((de = readdir(dir)))
771 {
772 if (mutt_str_equal(de->d_name, "."))
773 continue; /* we don't need . */
774
775 if (prefix && *prefix && !mutt_str_startswith(de->d_name, prefix))
776 {
777 continue;
778 }
779 if (!mutt_regex_match(c_mask, de->d_name))
780 {
781 continue;
782 }
783
784 buf_concat_path(buf, dirname, de->d_name);
785 if (lstat(buf_string(buf), &st) == -1)
786 continue;
787
788 /* No size for directories or symlinks */
789 if (S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode))
790 st.st_size = 0;
791 else if (!S_ISREG(st.st_mode))
792 continue;
793
794 struct MailboxNode *np = NULL;
795 STAILQ_FOREACH(np, &ml, entries)
796 {
798 break;
799 }
800
801 if (np && m && m->poll_new_mail && mutt_str_equal(np->mailbox->realpath, m->realpath))
802 {
803 np->mailbox->msg_count = m->msg_count;
804 np->mailbox->msg_unread = m->msg_unread;
805 }
806 browser_add_folder(menu, state, de->d_name, NULL, &st, np ? np->mailbox : NULL, NULL);
807 }
809 closedir(dir);
810 }
811 browser_sort(state);
812 rc = 0;
813ed_out:
814 buf_pool_release(&buf);
815 return rc;
816}
817
826int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state)
827{
828 struct stat st = { 0 };
829 struct Buffer *md = NULL;
830 struct Buffer *mailbox = NULL;
831
832 if (OptNews)
833 {
835
836 init_state(state);
837
838 const bool c_show_only_unread = cs_subset_bool(NeoMutt->sub, "show_only_unread");
839 for (unsigned int i = 0; i < adata->groups_num; i++)
840 {
841 struct NntpMboxData *mdata = adata->groups_list[i];
842 if (mdata && (mdata->has_new_mail ||
843 (mdata->subscribed && (mdata->unread || !c_show_only_unread))))
844 {
845 browser_add_folder(menu, state, mdata->group, NULL, NULL, NULL, mdata);
846 }
847 }
848 }
849 else
850 {
851 init_state(state);
852
854 return -1;
855 mailbox = buf_pool_get();
856 md = buf_pool_get();
857
859
860 struct MailboxList ml = STAILQ_HEAD_INITIALIZER(ml);
862 struct MailboxNode *np = NULL;
863 const bool c_browser_abbreviate_mailboxes = cs_subset_bool(NeoMutt->sub, "browser_abbreviate_mailboxes");
864
865 STAILQ_FOREACH(np, &ml, entries)
866 {
867 if (!np->mailbox)
868 continue;
869
870 if (m && m->poll_new_mail && mutt_str_equal(np->mailbox->realpath, m->realpath))
871 {
872 np->mailbox->msg_count = m->msg_count;
873 np->mailbox->msg_unread = m->msg_unread;
874 }
875
877 if (c_browser_abbreviate_mailboxes)
879
880 switch (np->mailbox->type)
881 {
882 case MUTT_IMAP:
883 case MUTT_POP:
885 np->mailbox->name, NULL, np->mailbox, NULL);
886 continue;
887 case MUTT_NOTMUCH:
888 case MUTT_NNTP:
889 browser_add_folder(menu, state, mailbox_path(np->mailbox),
890 np->mailbox->name, NULL, np->mailbox, NULL);
891 continue;
892 default: /* Continue */
893 break;
894 }
895
896 if (lstat(mailbox_path(np->mailbox), &st) == -1)
897 continue;
898
899 if ((!S_ISREG(st.st_mode)) && (!S_ISDIR(st.st_mode)) && (!S_ISLNK(st.st_mode)))
900 continue;
901
902 if (np->mailbox->type == MUTT_MAILDIR)
903 {
904 struct stat st2 = { 0 };
905
906 buf_printf(md, "%s/new", mailbox_path(np->mailbox));
907 if (stat(buf_string(md), &st) < 0)
908 st.st_mtime = 0;
909 buf_printf(md, "%s/cur", mailbox_path(np->mailbox));
910 if (stat(buf_string(md), &st2) < 0)
911 st2.st_mtime = 0;
912 if (st2.st_mtime > st.st_mtime)
913 st.st_mtime = st2.st_mtime;
914 }
915
916 browser_add_folder(menu, state, buf_string(mailbox), np->mailbox->name,
917 &st, np->mailbox, NULL);
918 }
920 }
921 browser_sort(state);
922
923 buf_pool_release(&mailbox);
924 buf_pool_release(&md);
925 return 0;
926}
927
931static int select_file_search(struct Menu *menu, regex_t *rx, int line)
932{
933 struct BrowserPrivateData *priv = menu->mdata;
934 struct BrowserEntryArray *entry = &priv->state.entry;
935 if (OptNews)
936 return regexec(rx, ARRAY_GET(entry, line)->desc, 0, NULL, 0);
937 struct FolderFile *ff = ARRAY_GET(entry, line);
938 char *search_on = ff->desc ? ff->desc : ff->name;
939
940 return regexec(rx, search_on, 0, NULL, 0);
941}
942
948static int folder_make_entry(struct Menu *menu, int line, int max_cols, struct Buffer *buf)
949{
950 struct BrowserPrivateData *priv = menu->mdata;
951 struct BrowserState *bstate = &priv->state;
952 struct BrowserEntryArray *entry = &bstate->entry;
953 struct Folder folder = {
954 .ff = ARRAY_GET(entry, line),
955 .num = line,
956 };
957
958 const bool c_arrow_cursor = cs_subset_bool(menu->sub, "arrow_cursor");
959 if (c_arrow_cursor)
960 {
961 const char *const c_arrow_string = cs_subset_string(menu->sub, "arrow_string");
962 if (max_cols > 0)
963 max_cols -= (mutt_strwidth(c_arrow_string) + 1);
964 }
965
966 if (OptNews)
967 {
968 const struct Expando *c_group_index_format = cs_subset_expando(NeoMutt->sub, "group_index_format");
969 return expando_filter(c_group_index_format, GroupIndexRenderData, &folder,
970 MUTT_FORMAT_ARROWCURSOR, max_cols, buf);
971 }
972
973 if (bstate->is_mailbox_list)
974 {
975 const struct Expando *c_mailbox_folder_format = cs_subset_expando(NeoMutt->sub, "mailbox_folder_format");
976 return expando_filter(c_mailbox_folder_format, FolderRenderData, &folder,
977 MUTT_FORMAT_ARROWCURSOR, max_cols, buf);
978 }
979
980 const struct Expando *c_folder_format = cs_subset_expando(NeoMutt->sub, "folder_format");
981 return expando_filter(c_folder_format, FolderRenderData, &folder,
982 MUTT_FORMAT_ARROWCURSOR, max_cols, buf);
983}
984
993void browser_highlight_default(struct BrowserState *state, struct Menu *menu)
994{
995 menu->top = 0;
996 /* Reset menu position to 1.
997 * We do not risk overflow as the init_menu function changes
998 * current if it is bigger than state->entrylen. */
999 if (!ARRAY_EMPTY(&state->entry) &&
1000 (mutt_str_equal(ARRAY_FIRST(&state->entry)->desc, "..") ||
1001 mutt_str_equal(ARRAY_FIRST(&state->entry)->desc, "../")))
1002 {
1003 /* Skip the first entry, unless there's only one entry. */
1004 menu_set_index(menu, (menu->max > 1));
1005 }
1006 else
1007 {
1008 menu_set_index(menu, 0);
1009 }
1010}
1011
1019void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m,
1020 struct MuttWindow *sbar)
1021{
1022 char title[256] = { 0 };
1023 menu->max = ARRAY_SIZE(&state->entry);
1024
1025 int index = menu_get_index(menu);
1026 if (index >= menu->max)
1027 menu_set_index(menu, menu->max - 1);
1028 if (index < 0)
1029 menu_set_index(menu, 0);
1030 if (menu->top > index)
1031 menu->top = 0;
1032
1033 menu->num_tagged = 0;
1034
1035 if (OptNews)
1036 {
1037 if (state->is_mailbox_list)
1038 {
1039 snprintf(title, sizeof(title), _("Subscribed newsgroups"));
1040 }
1041 else
1042 {
1043 snprintf(title, sizeof(title), _("Newsgroups on server [%s]"),
1045 }
1046 }
1047 else
1048 {
1049 if (state->is_mailbox_list)
1050 {
1051 snprintf(title, sizeof(title), _("Mailboxes [%d]"),
1053 }
1054 else
1055 {
1056 struct Buffer *path = buf_pool_get();
1057 buf_copy(path, &LastDir);
1058 buf_pretty_mailbox(path);
1059 const struct Regex *c_mask = cs_subset_regex(NeoMutt->sub, "mask");
1060 const bool c_imap_list_subscribed = cs_subset_bool(NeoMutt->sub, "imap_list_subscribed");
1061 if (state->imap_browse && c_imap_list_subscribed)
1062 {
1063 snprintf(title, sizeof(title), _("Subscribed [%s], File mask: %s"),
1064 buf_string(path), NONULL(c_mask ? c_mask->pattern : NULL));
1065 }
1066 else
1067 {
1068 snprintf(title, sizeof(title), _("Directory [%s], File mask: %s"),
1069 buf_string(path), NONULL(c_mask ? c_mask->pattern : NULL));
1070 }
1071 buf_pool_release(&path);
1072 }
1073 }
1074 sbar_set_title(sbar, title);
1075
1076 /* Browser tracking feature.
1077 * The goal is to highlight the good directory if LastDir is the parent dir
1078 * of LastDirBackup (this occurs mostly when one hit "../"). It should also work
1079 * properly when the user is in examine_mailboxes-mode. */
1081 {
1082 char target_dir[PATH_MAX] = { 0 };
1083
1084 /* Check what kind of dir LastDirBackup is. */
1086 {
1087 mutt_str_copy(target_dir, buf_string(&LastDirBackup), sizeof(target_dir));
1088 imap_clean_path(target_dir, sizeof(target_dir));
1089 }
1090 else
1091 {
1092 mutt_str_copy(target_dir, strrchr(buf_string(&LastDirBackup), '/') + 1,
1093 sizeof(target_dir));
1094 }
1095
1096 /* If we get here, it means that LastDir is the parent directory of
1097 * LastDirBackup. I.e., we're returning from a subdirectory, and we want
1098 * to position the cursor on the directory we're returning from. */
1099 bool matched = false;
1100 struct FolderFile *ff = NULL;
1101 ARRAY_FOREACH(ff, &state->entry)
1102 {
1103 if (mutt_str_equal(ff->name, target_dir))
1104 {
1105 menu_set_index(menu, ARRAY_FOREACH_IDX);
1106 matched = true;
1107 break;
1108 }
1109 }
1110 if (!matched)
1111 browser_highlight_default(state, menu);
1112 }
1113 else
1114 {
1115 browser_highlight_default(state, menu);
1116 }
1117
1119}
1120
1124static int file_tag(struct Menu *menu, int sel, int act)
1125{
1126 struct BrowserPrivateData *priv = menu->mdata;
1127 struct BrowserEntryArray *entry = &priv->state.entry;
1128 struct FolderFile *ff = ARRAY_GET(entry, sel);
1129 if (S_ISDIR(ff->mode) ||
1130 (S_ISLNK(ff->mode) && link_is_dir(buf_string(&LastDir), ff->name)))
1131 {
1132 mutt_error(_("Can't attach a directory"));
1133 return 0;
1134 }
1135
1136 bool ot = ff->tagged;
1137 ff->tagged = ((act >= 0) ? act : !ff->tagged);
1138
1139 return ff->tagged - ot;
1140}
1141
1146{
1147 if (nc->event_type != NT_CONFIG)
1148 return 0;
1149 if (!nc->global_data || !nc->event_data)
1150 return -1;
1151
1152 struct EventConfig *ev_c = nc->event_data;
1153
1154 struct BrowserPrivateData *priv = nc->global_data;
1155 struct Menu *menu = priv->menu;
1156
1157 if (mutt_str_equal(ev_c->name, "browser_sort_dirs_first"))
1158 {
1159 struct BrowserState *state = &priv->state;
1160 browser_sort(state);
1161 browser_highlight_default(state, menu);
1162 }
1163 else if (!mutt_str_equal(ev_c->name, "browser_abbreviate_mailboxes") &&
1164 !mutt_str_equal(ev_c->name, "date_format") &&
1165 !mutt_str_equal(ev_c->name, "folder") &&
1166 !mutt_str_equal(ev_c->name, "folder_format") &&
1167 !mutt_str_equal(ev_c->name, "group_index_format") &&
1168 !mutt_str_equal(ev_c->name, "mailbox_folder_format") &&
1169 !mutt_str_equal(ev_c->name, "sort_browser"))
1170 {
1171 return 0;
1172 }
1173
1175 mutt_debug(LL_DEBUG5, "config done, request WA_RECALC, MENU_REDRAW_FULL\n");
1176
1177 return 0;
1178}
1179
1186{
1187 if (nc->event_type != NT_MAILBOX)
1188 return 0;
1190 return 0;
1191 if (!nc->global_data || !nc->event_data)
1192 return -1;
1193
1194 struct BrowserPrivateData *priv = nc->global_data;
1195
1196 struct BrowserState *state = &priv->state;
1197 if (state->is_mailbox_list)
1198 {
1199 struct EventMailbox *ev_m = nc->event_data;
1200 struct Mailbox *m = ev_m->mailbox;
1201 struct FolderFile *ff = NULL;
1202 ARRAY_FOREACH(ff, &state->entry)
1203 {
1204 if (ff->gen != m->gen)
1205 continue;
1206
1207 ff->has_new_mail = m->has_new;
1208 ff->msg_count = m->msg_count;
1209 ff->msg_unread = m->msg_unread;
1210 ff->notify_user = m->notify_user;
1212 mutt_str_replace(&ff->desc, m->name);
1213 break;
1214 }
1215 }
1216
1218 mutt_debug(LL_DEBUG5, "mailbox done, request WA_RECALC, MENU_REDRAW_FULL\n");
1219
1220 return 0;
1221}
1222
1231{
1232 if (nc->event_type != NT_WINDOW)
1233 return 0;
1234 if (!nc->global_data || !nc->event_data)
1235 return -1;
1237 return 0;
1238
1239 struct BrowserPrivateData *priv = nc->global_data;
1240 struct MuttWindow *win_menu = priv->menu->win;
1241
1242 struct EventWindow *ev_w = nc->event_data;
1243 if (ev_w->win != win_menu)
1244 return 0;
1245
1249
1250 mutt_debug(LL_DEBUG5, "window delete done\n");
1251 return 0;
1252}
1253
1264void mutt_browser_select_dir(const char *f)
1265{
1266 init_lastdir();
1267
1269
1270 /* Method that will fetch the parent path depending on the type of the path. */
1271 char buf[PATH_MAX] = { 0 };
1272 mutt_get_parent_path(buf_string(&LastDirBackup), buf, sizeof(buf));
1273 buf_strcpy(&LastDir, buf);
1274}
1275
1287void dlg_browser(struct Buffer *file, SelectFileFlags flags, struct Mailbox *m,
1288 char ***files, int *numfiles)
1289{
1291 priv->file = file;
1292 priv->mailbox = m;
1293 priv->files = files;
1294 priv->numfiles = numfiles;
1295 priv->multiple = (flags & MUTT_SEL_MULTI);
1296 priv->folder = (flags & MUTT_SEL_FOLDER);
1297 priv->state.is_mailbox_list = (flags & MUTT_SEL_MAILBOX) && priv->folder;
1298 priv->last_selected_mailbox = -1;
1299
1300 init_lastdir();
1301
1302 if (OptNews)
1303 {
1304 if (buf_is_empty(file))
1305 {
1307
1308 /* default state for news reader mode is browse subscribed newsgroups */
1309 priv->state.is_mailbox_list = false;
1310 for (size_t i = 0; i < adata->groups_num; i++)
1311 {
1312 struct NntpMboxData *mdata = adata->groups_list[i];
1313 if (mdata && mdata->subscribed)
1314 {
1315 priv->state.is_mailbox_list = true;
1316 break;
1317 }
1318 }
1319 }
1320 else
1321 {
1322 buf_copy(priv->prefix, file);
1323 }
1324 }
1325 else if (!buf_is_empty(file))
1326 {
1327 buf_expand_path(file);
1328 if (imap_path_probe(buf_string(file), NULL) == MUTT_IMAP)
1329 {
1330 init_state(&priv->state);
1331 priv->state.imap_browse = true;
1332 if (imap_browse(buf_string(file), &priv->state) == 0)
1333 {
1334 buf_strcpy(&LastDir, priv->state.folder);
1335 browser_sort(&priv->state);
1336 }
1337 }
1338 else
1339 {
1340 int i;
1341 for (i = buf_len(file) - 1; (i > 0) && ((buf_string(file))[i] != '/'); i--)
1342 {
1343 ; // do nothing
1344 }
1345
1346 if (i > 0)
1347 {
1348 if ((buf_string(file))[0] == '/')
1349 {
1350 buf_strcpy_n(&LastDir, buf_string(file), i);
1351 }
1352 else
1353 {
1355 buf_addch(&LastDir, '/');
1356 buf_addstr_n(&LastDir, buf_string(file), i);
1357 }
1358 }
1359 else
1360 {
1361 if ((buf_string(file))[0] == '/')
1362 buf_strcpy(&LastDir, "/");
1363 else
1365 }
1366
1367 if ((i <= 0) && (buf_string(file)[0] != '/'))
1368 buf_copy(priv->prefix, file);
1369 else
1370 buf_strcpy(priv->prefix, buf_string(file) + i + 1);
1371 priv->kill_prefix = true;
1372 }
1373 }
1374 else
1375 {
1376 if (priv->folder)
1377 {
1378 /* Whether we use the tracking feature of the browser depends
1379 * on which sort method we chose to use. This variable is defined
1380 * only to help readability of the code. */
1381 bool browser_track = false;
1382
1383 const enum SortType c_sort_browser = cs_subset_sort(NeoMutt->sub, "sort_browser");
1384 switch (c_sort_browser & SORT_MASK)
1385 {
1386 case SORT_DESC:
1387 case SORT_SUBJECT:
1388 case SORT_ORDER:
1389 browser_track = true;
1390 break;
1391 }
1392
1393 /* We use mutt_browser_select_dir to initialize the two
1394 * variables (LastDir, LastDirBackup) at the appropriate
1395 * values.
1396 *
1397 * We do it only when LastDir is not set (first pass there)
1398 * or when CurrentFolder and LastDirBackup are not the same.
1399 * This code is executed only when we list files, not when
1400 * we press up/down keys to navigate in a displayed list.
1401 *
1402 * We only do this when CurrentFolder has been set (ie, not
1403 * when listing folders on startup with "neomutt -y").
1404 *
1405 * This tracker is only used when browser_track is true,
1406 * meaning only with sort methods SUBJECT/DESC for now. */
1407 if (CurrentFolder)
1408 {
1409 if (buf_is_empty(&LastDir))
1410 {
1411 /* If browsing in "local"-mode, than we chose to define LastDir to
1412 * MailDir */
1414 {
1415 case MUTT_IMAP:
1416 case MUTT_MAILDIR:
1417 case MUTT_MBOX:
1418 case MUTT_MH:
1419 case MUTT_MMDF:
1420 {
1421 const char *const c_folder = cs_subset_string(NeoMutt->sub, "folder");
1422 const char *const c_spool_file = cs_subset_string(NeoMutt->sub, "spool_file");
1423 if (c_folder)
1424 buf_strcpy(&LastDir, c_folder);
1425 else if (c_spool_file)
1426 mutt_browser_select_dir(c_spool_file);
1427 break;
1428 }
1429 default:
1431 break;
1432 }
1433 }
1435 {
1437 }
1438 }
1439
1440 /* When browser tracking feature is disabled, clear LastDirBackup */
1441 if (!browser_track)
1443 }
1444 else
1445 {
1447 }
1448
1449 if (!priv->state.is_mailbox_list &&
1451 {
1452 init_state(&priv->state);
1453 priv->state.imap_browse = true;
1455 browser_sort(&priv->state);
1456 }
1457 else
1458 {
1459 size_t i = buf_len(&LastDir);
1460 while ((i > 0) && (buf_string(&LastDir)[--i] == '/'))
1461 LastDir.data[i] = '\0';
1463 if (buf_is_empty(&LastDir))
1465 }
1466 }
1467
1468 buf_reset(file);
1469
1470 const struct Mapping *help_data = NULL;
1471
1472 if (OptNews)
1473 help_data = FolderNewsHelp;
1474 else
1475 help_data = FolderHelp;
1476
1478
1479 struct Menu *menu = sdw.menu;
1481 menu->search = select_file_search;
1482 menu->mdata = priv;
1483
1484 priv->menu = menu;
1485 if (priv->multiple)
1486 priv->menu->tag = file_tag;
1487
1488 priv->sbar = sdw.sbar;
1489
1490 struct MuttWindow *win_menu = priv->menu->win;
1491
1492 // NT_COLOR is handled by the SimpleDialog
1496
1497 struct MuttWindow *old_focus = window_set_focus(priv->menu->win);
1498
1499 if (priv->state.is_mailbox_list)
1500 {
1501 examine_mailboxes(m, NULL, &priv->state);
1502 }
1503 else if (!priv->state.imap_browse)
1504 {
1505 // examine_directory() calls browser_add_folder() which needs the menu
1506 if (examine_directory(m, priv->menu, &priv->state, buf_string(&LastDir),
1507 buf_string(priv->prefix)) == -1)
1508 {
1509 goto bail;
1510 }
1511 }
1512
1513 init_menu(&priv->state, priv->menu, m, priv->sbar);
1514
1515 // ---------------------------------------------------------------------------
1516 // Event Loop
1517 int op = OP_NULL;
1518 do
1519 {
1520 menu_tagging_dispatcher(priv->menu->win, op);
1521 window_redraw(NULL);
1522
1524 mutt_debug(LL_DEBUG1, "Got op %s (%d)\n", opcodes_get_name(op), op);
1525 if (op < 0)
1526 continue;
1527 if (op == OP_NULL)
1528 {
1530 continue;
1531 }
1533
1534 int rc = browser_function_dispatcher(sdw.dlg, op);
1535
1536 if (rc == FR_UNKNOWN)
1537 rc = menu_function_dispatcher(menu->win, op);
1538 if (rc == FR_UNKNOWN)
1539 rc = global_function_dispatcher(NULL, op);
1540 } while (!priv->done);
1541 // ---------------------------------------------------------------------------
1542
1543bail:
1544 window_set_focus(old_focus);
1545 simple_dialog_free(&sdw.dlg);
1547}
1548
1554const struct ExpandoRenderData FolderRenderData[] = {
1555 // clang-format off
1574 { -1, -1, NULL, NULL },
1575 // clang-format on
1576};
1577
1583const struct ExpandoRenderData GroupIndexRenderData[] = {
1584 // clang-format off
1594 { -1, -1, NULL, NULL },
1595 // clang-format on
1596};
#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:1125
#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
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:699
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:1019
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:1264
void init_state(struct BrowserState *state)
Initialise a browser state.
Definition: dlg_browser.c:682
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:993
int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state)
Get list of mailboxes/subscribed newsgroups.
Definition: dlg_browser.c:826
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:1287
#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:948
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:931
static int file_tag(struct Menu *menu, int sel, int act)
Tag an entry in the menu - Implements Menu::tag() -.
Definition: dlg_browser.c:1124
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:1145
static int browser_mailbox_observer(struct NotifyCallback *nc)
Notification that a Mailbox has changed - Implements observer_t -.
Definition: dlg_browser.c:1185
static int browser_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: dlg_browser.c:1230
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 SimpleDialogWindows 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
@ WT_DLG_BROWSER
Browser Dialog, dlg_browser()
Definition: mutt_window.h:80
@ 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:52
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 * 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
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
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 NntpMboxData ** groups_list
Definition: adata.h:60
struct Connection * conn
Connection to NNTP Server.
Definition: adata.h:62
unsigned int groups_num
Definition: adata.h:58
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
Tuple for the results of simple_dialog_new()
Definition: simple.h:35
struct MuttWindow * sbar
Simple Bar.
Definition: simple.h:37
struct Menu * menu
Menu.
Definition: simple.h:38
struct MuttWindow * dlg
Main Dialog Window.
Definition: simple.h:36
@ MENU_FOLDER
General file/mailbox browser.
Definition: type.h:45
@ ED_GLO_PADDING_SPACE
Space Padding.
Definition: uid.h:39