NeoMutt  2024-10-02-37-gfa9146
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Browser Function API

Prototype for a Browser Function. More...

Functions

static int op_browser_new_file (struct BrowserPrivateData *priv, int op)
 Select a new file in this directory - Implements browser_function_t -.
 
static int op_browser_subscribe (struct BrowserPrivateData *priv, int op)
 Subscribe to current mbox (IMAP/NNTP only) - Implements browser_function_t -.
 
static int op_browser_tell (struct BrowserPrivateData *priv, int op)
 Display the currently selected file's name - Implements browser_function_t -.
 
static int op_browser_toggle_lsub (struct BrowserPrivateData *priv, int op)
 Toggle view all/subscribed mailboxes (IMAP only) - Implements browser_function_t -.
 
static int op_browser_view_file (struct BrowserPrivateData *priv, int op)
 View file - Implements browser_function_t -.
 
static int op_catchup (struct BrowserPrivateData *priv, int op)
 Mark all articles in newsgroup as read - Implements browser_function_t -.
 
static int op_change_directory (struct BrowserPrivateData *priv, int op)
 Change directories - Implements browser_function_t -.
 
static int op_create_mailbox (struct BrowserPrivateData *priv, int op)
 Create a new mailbox (IMAP only) - Implements browser_function_t -.
 
static int op_delete_mailbox (struct BrowserPrivateData *priv, int op)
 Delete the current mailbox (IMAP only) - Implements browser_function_t -.
 
static int op_enter_mask (struct BrowserPrivateData *priv, int op)
 Enter a file mask - Implements browser_function_t -.
 
static int op_exit (struct BrowserPrivateData *priv, int op)
 Exit this menu - Implements browser_function_t -.
 
static int op_generic_select_entry (struct BrowserPrivateData *priv, int op)
 Select the current entry - Implements browser_function_t -.
 
static int op_load_active (struct BrowserPrivateData *priv, int op)
 Load list of all newsgroups from NNTP server - Implements browser_function_t -.
 
static int op_mailbox_list (struct BrowserPrivateData *priv, int op)
 List mailboxes with new mail - Implements browser_function_t -.
 
static int op_rename_mailbox (struct BrowserPrivateData *priv, int op)
 Rename the current mailbox (IMAP only) - Implements browser_function_t -.
 
static int op_sort (struct BrowserPrivateData *priv, int op)
 Sort messages - Implements browser_function_t -.
 
static int op_subscribe_pattern (struct BrowserPrivateData *priv, int op)
 Subscribe to newsgroups matching a pattern - Implements browser_function_t -.
 
static int op_toggle_mailboxes (struct BrowserPrivateData *priv, int op)
 Toggle whether to browse mailboxes or all files - Implements browser_function_t -.
 

Detailed Description

Prototype for a Browser Function.

Parameters
privPrivate Browser data
opOperation to perform, e.g. OP_MAIN_LIMIT
Return values
enumFunctionRetval

Function Documentation

◆ op_browser_new_file()

static int op_browser_new_file ( struct BrowserPrivateData priv,
int  op 
)
static

Select a new file in this directory - Implements browser_function_t -.

Definition at line 154 of file functions.c.

155{
156 struct Buffer *buf = buf_pool_get();
157 buf_printf(buf, "%s/", buf_string(&LastDir));
158
159 struct FileCompletionData cdata = { false, priv->mailbox, NULL, NULL };
160 const int rc = mw_get_field(_("New file name: "), buf, MUTT_COMP_NO_FLAGS,
161 HC_FILE, &CompleteMailboxOps, &cdata);
162 if (rc != 0)
163 {
164 buf_pool_release(&buf);
165 return FR_NO_ACTION;
166 }
167
168 buf_copy(priv->file, buf);
169 buf_pool_release(&buf);
170 priv->done = true;
171 return FR_DONE;
172}
const struct CompleteOps CompleteMailboxOps
Auto-Completion of Files / Mailboxes.
Definition: complete.c:160
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:161
size_t buf_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
Definition: buffer.c:601
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:96
@ FR_DONE
Exit the Dialog.
Definition: dispatcher.h:35
@ FR_NO_ACTION
Valid function - no action performed.
Definition: dispatcher.h:37
struct Buffer LastDir
Browser: previous selected directory.
Definition: dlg_browser.c:139
int mw_get_field(const char *prompt, struct Buffer *buf, CompletionFlags complete, enum HistoryClass hclass, const struct CompleteOps *comp_api, void *cdata)
Ask the user for a string -.
Definition: window.c:274
@ HC_FILE
Files.
Definition: lib.h:54
#define _(a)
Definition: message.h:28
#define MUTT_COMP_NO_FLAGS
No flags are set.
Definition: mutt.h:56
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
bool done
Should we close the Dialog?
Definition: private_data.h:53
struct Mailbox * mailbox
Mailbox.
Definition: private_data.h:37
struct Buffer * file
Buffer for the result.
Definition: private_data.h:36
String manipulation buffer.
Definition: buffer.h:36
Input for the file completion function.
Definition: curs_lib.h:40
+ Here is the call graph for this function:

◆ op_browser_subscribe()

static int op_browser_subscribe ( struct BrowserPrivateData priv,
int  op 
)
static

Subscribe to current mbox (IMAP/NNTP only) - Implements browser_function_t -.

This function handles:

  • OP_BROWSER_SUBSCRIBE
  • OP_BROWSER_UNSUBSCRIBE

Definition at line 181 of file functions.c.

182{
183 if (OptNews)
184 {
186 int index = menu_get_index(priv->menu);
187
188 if (ARRAY_EMPTY(&priv->state.entry))
189 {
190 mutt_error(_("No newsgroups match the mask"));
191 return FR_ERROR;
192 }
193
194 int rc = nntp_newsrc_parse(adata);
195 if (rc < 0)
196 return FR_ERROR;
197
198 struct FolderFile *ff = ARRAY_GET(&priv->state.entry, index);
199 if (op == OP_BROWSER_SUBSCRIBE)
200 mutt_newsgroup_subscribe(adata, ff->name);
201 else
203
204 menu_set_index(priv->menu, index + 1);
205
206 if (rc > 0)
208 nntp_newsrc_update(adata);
209 nntp_clear_cache(adata);
210 nntp_newsrc_close(adata);
211 }
212 else
213 {
214 if (ARRAY_EMPTY(&priv->state.entry))
215 {
216 mutt_error(_("There are no mailboxes"));
217 return FR_ERROR;
218 }
219
220 struct Buffer *buf = buf_pool_get();
221 int index = menu_get_index(priv->menu);
222 struct FolderFile *ff = ARRAY_GET(&priv->state.entry, index);
223 buf_strcpy(buf, ff->name);
224 buf_expand_path(buf);
225 imap_subscribe(buf_string(buf), (op == OP_BROWSER_SUBSCRIBE));
226 buf_pool_release(&buf);
227 }
228 return FR_SUCCESS;
229}
#define ARRAY_EMPTY(head)
Check if an array is empty.
Definition: array.h:74
#define ARRAY_GET(head, idx)
Return the element at index.
Definition: array.h:109
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:395
@ FR_SUCCESS
Valid function - successfully performed.
Definition: dispatcher.h:39
@ FR_ERROR
Valid function - error occurred.
Definition: dispatcher.h:38
bool OptNews
(pseudo) used to change reader mode
Definition: globals.c:67
#define mutt_error(...)
Definition: logging2.h:92
int imap_subscribe(const char *path, bool subscribe)
Subscribe to a mailbox.
Definition: imap.c:1223
#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
void buf_expand_path(struct Buffer *buf)
Create the canonical path.
Definition: muttlib.c:315
void nntp_clear_cache(struct NntpAccountData *adata)
Clear the NNTP cache.
Definition: newsrc.c:843
int nntp_newsrc_parse(struct NntpAccountData *adata)
Parse .newsrc file.
Definition: newsrc.c:166
void nntp_newsrc_close(struct NntpAccountData *adata)
Unlock and close .newsrc file.
Definition: newsrc.c:122
int nntp_newsrc_update(struct NntpAccountData *adata)
Update .newsrc file.
Definition: newsrc.c:445
struct NntpMboxData * mutt_newsgroup_subscribe(struct NntpAccountData *adata, char *group)
Subscribe newsgroup.
Definition: newsrc.c:1292
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
Definition: nntp.c:77
struct NntpMboxData * mutt_newsgroup_unsubscribe(struct NntpAccountData *adata, char *group)
Unsubscribe newsgroup.
Definition: newsrc.c:1316
void * adata
Private data (for Mailbox backends)
Definition: account.h:42
struct Menu * menu
Menu.
Definition: private_data.h:43
struct BrowserState state
State containing list of files/dir/mailboxes.
Definition: private_data.h:42
struct BrowserEntryArray entry
Array of files / dirs / mailboxes.
Definition: lib.h:144
Browser entry representing a folder/dir.
Definition: lib.h:77
char * name
Name of file/dir/mailbox.
Definition: lib.h:85
NNTP-specific Account data -.
Definition: adata.h:36
+ Here is the call graph for this function:

◆ op_browser_tell()

static int op_browser_tell ( struct BrowserPrivateData priv,
int  op 
)
static

Display the currently selected file's name - Implements browser_function_t -.

Definition at line 234 of file functions.c.

235{
236 int index = menu_get_index(priv->menu);
237 if (ARRAY_EMPTY(&priv->state.entry))
238 return FR_ERROR;
239
240 mutt_message("%s", ARRAY_GET(&priv->state.entry, index)->name);
241 return FR_SUCCESS;
242}
#define mutt_message(...)
Definition: logging2.h:91
+ Here is the call graph for this function:

◆ op_browser_toggle_lsub()

static int op_browser_toggle_lsub ( struct BrowserPrivateData priv,
int  op 
)
static

Toggle view all/subscribed mailboxes (IMAP only) - Implements browser_function_t -.

Definition at line 247 of file functions.c.

248{
249 bool_str_toggle(NeoMutt->sub, "imap_list_subscribed", NULL);
250
251 mutt_unget_op(OP_CHECK_NEW);
252 return FR_SUCCESS;
253}
int bool_str_toggle(struct ConfigSubset *sub, const char *name, struct Buffer *err)
Toggle the value of a bool.
Definition: bool.c:224
void mutt_unget_op(int op)
Return an operation to the input buffer.
Definition: get.c:126
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
+ Here is the call graph for this function:

◆ op_browser_view_file()

static int op_browser_view_file ( struct BrowserPrivateData priv,
int  op 
)
static

View file - Implements browser_function_t -.

Definition at line 258 of file functions.c.

259{
260 if (ARRAY_EMPTY(&priv->state.entry))
261 {
262 mutt_error(_("No files match the file mask"));
263 return FR_ERROR;
264 }
265
266 int index = menu_get_index(priv->menu);
267 struct FolderFile *ff = ARRAY_GET(&priv->state.entry, index);
268 if (ff->selectable)
269 {
270 buf_strcpy(priv->file, ff->name);
271 priv->done = true;
272 return FR_DONE;
273 }
274 else if (S_ISDIR(ff->mode) ||
275 (S_ISLNK(ff->mode) && link_is_dir(buf_string(&LastDir), ff->name)))
276 {
277 mutt_error(_("Can't view a directory"));
278 return FR_ERROR;
279 }
280 else
281 {
282 struct Buffer *path = buf_pool_get();
284 struct Body *b = mutt_make_file_attach(buf_string(path), NeoMutt->sub);
285 if (b)
286 {
287 mutt_view_attachment(NULL, b, MUTT_VA_REGULAR, NULL, NULL, priv->menu->win);
288 mutt_body_free(&b);
290 }
291 else
292 {
293 mutt_error(_("Error trying to view file"));
294 }
295 buf_pool_release(&path);
296 }
297 return FR_ERROR;
298}
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
bool link_is_dir(const char *folder, const char *path)
Does this symlink point to a directory?
Definition: dlg_browser.c:175
void mutt_body_free(struct Body **ptr)
Free a Body.
Definition: body.c:58
int mutt_view_attachment(FILE *fp, struct Body *b, enum ViewAttachMode mode, struct Email *e, struct AttachCtx *actx, struct MuttWindow *win)
View an attachment.
Definition: mutt_attach.c:419
@ MUTT_VA_REGULAR
View using default method.
Definition: mutt_attach.h:44
struct Body * mutt_make_file_attach(const char *path, struct ConfigSubset *sub)
Create a file attachment.
Definition: sendlib.c:607
The body of an email.
Definition: body.h:36
bool selectable
Folder can be selected.
Definition: lib.h:95
mode_t mode
File permissions.
Definition: lib.h:78
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:86
+ Here is the call graph for this function:

◆ op_catchup()

static int op_catchup ( struct BrowserPrivateData priv,
int  op 
)
static

Mark all articles in newsgroup as read - Implements browser_function_t -.

Definition at line 303 of file functions.c.

304{
305 if (!OptNews)
306 return FR_NOT_IMPL;
307
308 struct NntpMboxData *mdata = NULL;
309
311 if (rc < 0)
312 return FR_ERROR;
313
314 int index = menu_get_index(priv->menu);
315 struct FolderFile *ff = ARRAY_GET(&priv->state.entry, index);
316 if (op == OP_CATCHUP)
318 else
320
321 if (mdata)
322 {
324 index = menu_get_index(priv->menu) + 1;
325 if (index < priv->menu->max)
326 menu_set_index(priv->menu, index);
327 }
328
329 if (rc != 0)
331
333 return FR_ERROR;
334}
@ FR_NOT_IMPL
Invalid function - feature not enabled.
Definition: dispatcher.h:36
#define MENU_REDRAW_INDEX
Redraw the index.
Definition: lib.h:56
struct NntpMboxData * mutt_newsgroup_catchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Catchup newsgroup.
Definition: newsrc.c:1343
struct NntpMboxData * mutt_newsgroup_uncatchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Uncatchup newsgroup.
Definition: newsrc.c:1382
void * mdata
Driver specific data.
Definition: mailbox.h:132
NNTP-specific Mailbox data -.
Definition: mdata.h:34
+ Here is the call graph for this function:

◆ op_change_directory()

static int op_change_directory ( struct BrowserPrivateData priv,
int  op 
)
static

Change directories - Implements browser_function_t -.

This function handles:

  • OP_GOTO_PARENT
  • OP_CHANGE_DIRECTORY

Definition at line 343 of file functions.c.

344{
345 if (OptNews)
346 return FR_NOT_IMPL;
347
348 struct Buffer *buf = buf_pool_get();
349 buf_copy(buf, &LastDir);
350 if (!priv->state.imap_browse)
351 {
352 /* add '/' at the end of the directory name if not already there */
353 size_t len = buf_len(buf);
354 if ((len > 0) && (buf_string(&LastDir)[len - 1] != '/'))
355 buf_addch(buf, '/');
356 }
357
358 if (op == OP_CHANGE_DIRECTORY)
359 {
360 struct FileCompletionData cdata = { false, priv->mailbox, NULL, NULL };
361 int rc = mw_get_field(_("Chdir to: "), buf, MUTT_COMP_NO_FLAGS, HC_FILE,
362 &CompleteMailboxOps, &cdata);
363 if ((rc != 0) && buf_is_empty(buf))
364 {
365 buf_pool_release(&buf);
366 return FR_NO_ACTION;
367 }
368 }
369 else if (op == OP_GOTO_PARENT)
370 {
371 mutt_get_parent_path(buf_string(buf), buf->data, buf->dsize);
372 }
373
374 if (!buf_is_empty(buf))
375 {
376 priv->state.is_mailbox_list = false;
377 buf_expand_path(buf);
378 if (imap_path_probe(buf_string(buf), NULL) == MUTT_IMAP)
379 {
380 buf_copy(&LastDir, buf);
381 destroy_state(&priv->state);
382 init_state(&priv->state, NULL);
383 priv->state.imap_browse = true;
385 browser_sort(&priv->state);
386 priv->menu->mdata = &priv->state.entry;
387 priv->menu->mdata_free = NULL; // Menu doesn't own the data
388 browser_highlight_default(&priv->state, priv->menu);
389 init_menu(&priv->state, priv->menu, priv->mailbox, priv->sbar);
390 }
391 else
392 {
393 if (buf_string(buf)[0] != '/')
394 {
395 /* in case dir is relative, make it relative to LastDir,
396 * not current working dir */
397 struct Buffer *tmp = buf_pool_get();
399 buf_copy(buf, tmp);
400 buf_pool_release(&tmp);
401 }
402 /* Resolve path from <chdir>
403 * Avoids buildup such as /a/b/../../c
404 * Symlinks are always unraveled to keep code simple */
405 if (mutt_path_realpath(buf) == 0)
406 {
407 buf_pool_release(&buf);
408 return FR_ERROR;
409 }
410
411 struct stat st = { 0 };
412 if (stat(buf_string(buf), &st) == 0)
413 {
414 if (S_ISDIR(st.st_mode))
415 {
416 destroy_state(&priv->state);
417 if (examine_directory(priv->mailbox, priv->menu, &priv->state,
418 buf_string(buf), buf_string(priv->prefix)) == 0)
419 {
420 buf_copy(&LastDir, buf);
421 }
422 else
423 {
424 mutt_error(_("Error scanning directory"));
425 if (examine_directory(priv->mailbox, priv->menu, &priv->state,
426 buf_string(&LastDir), buf_string(priv->prefix)) == -1)
427 {
428 priv->done = true;
429 return FR_ERROR;
430 }
431 }
432 browser_highlight_default(&priv->state, priv->menu);
433 init_menu(&priv->state, priv->menu, priv->mailbox, priv->sbar);
434 }
435 else
436 {
437 mutt_error(_("%s is not a directory"), buf_string(buf));
438 }
439 }
440 else
441 {
442 mutt_perror("%s", buf_string(buf));
443 }
444 }
445 }
446 buf_pool_release(&buf);
447 return FR_ERROR;
448}
void destroy_state(struct BrowserState *state)
Free the BrowserState.
Definition: functions.c:137
void browser_sort(struct BrowserState *state)
Sort the entries in the browser.
Definition: sort.c:185
size_t buf_len(const struct Buffer *buf)
Calculate the length of a Buffer.
Definition: buffer.c:491
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition: buffer.c:291
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
Definition: buffer.c:241
@ MUTT_IMAP
'IMAP' Mailbox type
Definition: mailbox.h:50
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
void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar)
Set up a new menu.
Definition: dlg_browser.c:1023
void browser_highlight_default(struct BrowserState *state, struct Menu *menu)
Decide which browser item should be highlighted.
Definition: dlg_browser.c:997
#define mutt_perror(...)
Definition: logging2.h:93
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
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
Definition: browse.c:197
size_t mutt_path_realpath(struct Buffer *path)
Resolve path, unraveling symlinks.
Definition: path.c:377
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
struct Buffer * prefix
Folder prefix string.
Definition: private_data.h:49
struct MuttWindow * sbar
Status Bar.
Definition: private_data.h:51
bool is_mailbox_list
Viewing mailboxes.
Definition: lib.h:147
bool imap_browse
IMAP folder.
Definition: lib.h:145
size_t dsize
Length of data.
Definition: buffer.h:39
char * data
Pointer to data.
Definition: buffer.h:37
void(* mdata_free)(struct Menu *menu, void **ptr)
Definition: lib.h:161
void * mdata
Private data.
Definition: lib.h:147
+ Here is the call graph for this function:

◆ op_create_mailbox()

static int op_create_mailbox ( struct BrowserPrivateData priv,
int  op 
)
static

Create a new mailbox (IMAP only) - Implements browser_function_t -.

Definition at line 453 of file functions.c.

454{
455 if (!priv->state.imap_browse)
456 {
457 mutt_error(_("Create is only supported for IMAP mailboxes"));
458 return FR_ERROR;
459 }
460
462 return FR_ERROR;
463
464 /* TODO: find a way to detect if the new folder would appear in
465 * this window, and insert it without starting over. */
466 destroy_state(&priv->state);
467 init_state(&priv->state, NULL);
468 priv->state.imap_browse = true;
470 browser_sort(&priv->state);
471 priv->menu->mdata = &priv->state.entry;
472 priv->menu->mdata_free = NULL; // Menu doesn't own the data
473 browser_highlight_default(&priv->state, priv->menu);
474 init_menu(&priv->state, priv->menu, priv->mailbox, priv->sbar);
475
476 return FR_SUCCESS;
477}
int imap_mailbox_create(const char *path)
Create a new IMAP mailbox.
Definition: browse.c:394
+ Here is the call graph for this function:

◆ op_delete_mailbox()

static int op_delete_mailbox ( struct BrowserPrivateData priv,
int  op 
)
static

Delete the current mailbox (IMAP only) - Implements browser_function_t -.

Definition at line 482 of file functions.c.

483{
484 int index = menu_get_index(priv->menu);
485 struct FolderFile *ff = ARRAY_GET(&priv->state.entry, index);
486 if (!ff->imap)
487 {
488 mutt_error(_("Delete is only supported for IMAP mailboxes"));
489 return FR_ERROR;
490 }
491
492 char msg[128] = { 0 };
493
494 // TODO(sileht): It could be better to select INBOX instead. But I
495 // don't want to manipulate Mailboxes/mailbox->account here for now.
496 // Let's just protect neomutt against crash for now. #1417
497 if (mutt_str_equal(mailbox_path(priv->mailbox), ff->name))
498 {
499 mutt_error(_("Can't delete currently selected mailbox"));
500 return FR_ERROR;
501 }
502
503 snprintf(msg, sizeof(msg), _("Really delete mailbox \"%s\"?"), ff->name);
504 if (query_yesorno(msg, MUTT_NO) != MUTT_YES)
505 {
506 mutt_message(_("Mailbox not deleted"));
507 return FR_NO_ACTION;
508 }
509
510 if (imap_delete_mailbox(priv->mailbox, ff->name) != 0)
511 {
512 mutt_error(_("Mailbox deletion failed"));
513 return FR_ERROR;
514 }
515
516 /* free the mailbox from the browser */
517 FREE(&ff->name);
518 FREE(&ff->desc);
519 /* and move all other entries up */
520 ARRAY_REMOVE(&priv->state.entry, ff);
521 mutt_message(_("Mailbox deleted"));
522 init_menu(&priv->state, priv->menu, priv->mailbox, priv->sbar);
523
524 return FR_SUCCESS;
525}
#define ARRAY_REMOVE(head, elem)
Remove an entry from the array, shifting down the subsequent entries.
Definition: array.h:267
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition: mailbox.h:223
int imap_delete_mailbox(struct Mailbox *m, char *path)
Delete a mailbox.
Definition: imap.c:505
#define FREE(x)
Definition: memory.h:45
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:660
@ MUTT_NO
User answered 'No', or assume 'No'.
Definition: quad.h:38
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition: quad.h:39
enum QuadOption query_yesorno(const char *prompt, enum QuadOption def)
Ask the user a Yes/No question.
Definition: question.c:327
bool imap
This is an IMAP folder.
Definition: lib.h:94
char * desc
Description of mailbox.
Definition: lib.h:86
+ Here is the call graph for this function:

◆ op_enter_mask()

static int op_enter_mask ( struct BrowserPrivateData priv,
int  op 
)
static

Enter a file mask - Implements browser_function_t -.

Definition at line 530 of file functions.c.

531{
532 const struct Regex *c_mask = cs_subset_regex(NeoMutt->sub, "mask");
533 struct Buffer *buf = buf_pool_get();
534 buf_strcpy(buf, c_mask ? c_mask->pattern : NULL);
535 if (mw_get_field(_("File Mask: "), buf, MUTT_COMP_NO_FLAGS, HC_OTHER, NULL, NULL) != 0)
536 {
537 buf_pool_release(&buf);
538 return FR_NO_ACTION;
539 }
540
541 buf_fix_dptr(buf);
542
543 priv->state.is_mailbox_list = false;
544 /* assume that the user wants to see everything */
545 if (buf_is_empty(buf))
546 buf_strcpy(buf, ".");
547
548 struct Buffer *errmsg = buf_pool_get();
549 int rc = cs_subset_str_string_set(NeoMutt->sub, "mask", buf_string(buf), errmsg);
550 buf_pool_release(&buf);
551 if (CSR_RESULT(rc) != CSR_SUCCESS)
552 {
553 if (!buf_is_empty(errmsg))
554 {
555 mutt_error("%s", buf_string(errmsg));
556 buf_pool_release(&errmsg);
557 }
558 return FR_ERROR;
559 }
560 buf_pool_release(&errmsg);
561
562 destroy_state(&priv->state);
563 if (priv->state.imap_browse)
564 {
565 init_state(&priv->state, NULL);
566 priv->state.imap_browse = true;
568 browser_sort(&priv->state);
569 priv->menu->mdata = &priv->state.entry;
570 priv->menu->mdata_free = NULL; // Menu doesn't own the data
571 init_menu(&priv->state, priv->menu, priv->mailbox, priv->sbar);
572 }
573 else if (examine_directory(priv->mailbox, priv->menu, &priv->state,
574 buf_string(&LastDir), NULL) == 0)
575 {
576 init_menu(&priv->state, priv->menu, priv->mailbox, priv->sbar);
577 }
578 else
579 {
580 mutt_error(_("Error scanning directory"));
581 priv->done = true;
582 return FR_ERROR;
583 }
584 priv->kill_prefix = false;
585 if (ARRAY_EMPTY(&priv->state.entry))
586 {
587 mutt_error(_("No files match the file mask"));
588 return FR_ERROR;
589 }
590 return FR_SUCCESS;
591}
void buf_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
Definition: buffer.c:182
const struct Regex * cs_subset_regex(const struct ConfigSubset *sub, const char *name)
Get a regex config item by name.
Definition: helpers.c:217
#define CSR_RESULT(x)
Definition: set.h:52
#define CSR_SUCCESS
Action completed successfully.
Definition: set.h:35
@ HC_OTHER
Miscellaneous strings.
Definition: lib.h:56
bool kill_prefix
Prefix is in use.
Definition: private_data.h:44
Cached regular expression.
Definition: regex3.h:86
char * pattern
printable version
Definition: regex3.h:87
int cs_subset_str_string_set(const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err)
Set a config item by string.
Definition: subset.c:386
+ Here is the call graph for this function:

◆ op_exit()

static int op_exit ( struct BrowserPrivateData priv,
int  op 
)
static

Exit this menu - Implements browser_function_t -.

Definition at line 596 of file functions.c.

597{
598 if (priv->multiple)
599 {
600 char **tfiles = NULL;
601
602 if (priv->menu->num_tagged)
603 {
604 *priv->numfiles = priv->menu->num_tagged;
605 tfiles = mutt_mem_calloc(*priv->numfiles, sizeof(char *));
606 size_t j = 0;
607 struct FolderFile *ff = NULL;
608 ARRAY_FOREACH(ff, &priv->state.entry)
609 {
610 if (ff->tagged)
611 {
612 struct Buffer *buf = buf_pool_get();
614 buf_expand_path(buf);
615 tfiles[j++] = buf_strdup(buf);
616 buf_pool_release(&buf);
617 }
618 }
619 *priv->files = tfiles;
620 }
621 else if (!buf_is_empty(priv->file)) /* no tagged entries. return selected entry */
622 {
623 *priv->numfiles = 1;
624 tfiles = mutt_mem_calloc(*priv->numfiles, sizeof(char *));
625 buf_expand_path(priv->file);
626 tfiles[0] = buf_strdup(priv->file);
627 *priv->files = tfiles;
628 }
629 }
630
631 priv->done = true;
632 return FR_DONE;
633}
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition: array.h:212
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
Definition: buffer.c:571
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:51
char *** files
Array of selected files.
Definition: private_data.h:38
int * numfiles
Number of selected files.
Definition: private_data.h:39
bool multiple
Allow multiple selections.
Definition: private_data.h:45
bool tagged
Folder is tagged.
Definition: lib.h:101
int num_tagged
Number of tagged entries.
Definition: lib.h:93
+ Here is the call graph for this function:

◆ op_generic_select_entry()

static int op_generic_select_entry ( struct BrowserPrivateData priv,
int  op 
)
static

Select the current entry - Implements browser_function_t -.

This function handles:

  • OP_DESCEND_DIRECTORY
  • OP_GENERIC_SELECT_ENTRY

Definition at line 642 of file functions.c.

643{
644 if (ARRAY_EMPTY(&priv->state.entry))
645 {
646 mutt_error(_("No files match the file mask"));
647 return FR_ERROR;
648 }
649
650 int index = menu_get_index(priv->menu);
651 struct FolderFile *ff = ARRAY_GET(&priv->state.entry, index);
652 if (S_ISDIR(ff->mode) ||
653 (S_ISLNK(ff->mode) && link_is_dir(buf_string(&LastDir), ff->name)) || ff->inferiors)
654 {
655 /* make sure this isn't a MH or maildir mailbox */
656 struct Buffer *buf = buf_pool_get();
657 if (priv->state.is_mailbox_list)
658 {
659 buf_strcpy(buf, ff->name);
660 buf_expand_path(buf);
661 }
662 else if (priv->state.imap_browse)
663 {
664 buf_strcpy(buf, ff->name);
665 }
666 else
667 {
669 }
670
671 enum MailboxType type = mx_path_probe(buf_string(buf));
672 buf_pool_release(&buf);
673
674 if ((op == OP_DESCEND_DIRECTORY) || (type == MUTT_MAILBOX_ERROR) ||
675 (type == MUTT_UNKNOWN) || ff->inferiors)
676 {
677 /* save the old directory */
679
680 if (mutt_str_equal(ff->name, ".."))
681 {
682 size_t lastdirlen = buf_len(&LastDir);
683 if ((lastdirlen > 1) && mutt_str_equal("..", buf_string(&LastDir) + lastdirlen - 2))
684 {
685 buf_addstr(&LastDir, "/..");
686 }
687 else
688 {
689 char *p = NULL;
690 if (lastdirlen > 1)
691 p = strrchr(LastDir.data + 1, '/');
692
693 if (p)
694 {
695 *p = '\0';
697 }
698 else
699 {
700 if (buf_string(&LastDir)[0] == '/')
701 buf_strcpy(&LastDir, "/");
702 else
703 buf_addstr(&LastDir, "/..");
704 }
705 }
706 }
707 else if (priv->state.is_mailbox_list)
708 {
709 buf_strcpy(&LastDir, ff->name);
711 }
712 else if (priv->state.imap_browse)
713 {
714 buf_strcpy(&LastDir, ff->name);
715 /* tack on delimiter here */
716
717 /* special case "" needs no delimiter */
718 struct Url *url = url_parse(ff->name);
719 if (url && url->path && (ff->delim != '\0'))
720 {
721 buf_addch(&LastDir, ff->delim);
722 }
723 url_free(&url);
724 }
725 else
726 {
727 struct Buffer *tmp = buf_pool_get();
729 buf_copy(&LastDir, tmp);
730 buf_pool_release(&tmp);
731 }
732
733 destroy_state(&priv->state);
734 if (priv->kill_prefix)
735 {
736 buf_reset(priv->prefix);
737 priv->kill_prefix = false;
738 }
739 priv->state.is_mailbox_list = false;
740 if (priv->state.imap_browse)
741 {
742 init_state(&priv->state, NULL);
743 priv->state.imap_browse = true;
745 browser_sort(&priv->state);
746 priv->menu->mdata = &priv->state.entry;
747 priv->menu->mdata_free = NULL; // Menu doesn't own the data
748 }
749 else
750 {
751 if (examine_directory(priv->mailbox, priv->menu, &priv->state,
752 buf_string(&LastDir), buf_string(priv->prefix)) == -1)
753 {
754 /* try to restore the old values */
756 if (examine_directory(priv->mailbox, priv->menu, &priv->state,
757 buf_string(&LastDir), buf_string(priv->prefix)) == -1)
758 {
760 priv->done = true;
761 return FR_DONE;
762 }
763 }
764 /* resolve paths navigated from GUI */
765 if (mutt_path_realpath(&LastDir) == 0)
766 return FR_ERROR;
767 }
768
769 browser_highlight_default(&priv->state, priv->menu);
770 init_menu(&priv->state, priv->menu, priv->mailbox, priv->sbar);
771 priv->goto_swapper[0] = '\0';
772 return FR_SUCCESS;
773 }
774 }
775 else if (op == OP_DESCEND_DIRECTORY)
776 {
777 mutt_error(_("%s is not a directory"), ARRAY_GET(&priv->state.entry, index)->name);
778 return FR_ERROR;
779 }
780
781 if (priv->state.is_mailbox_list || OptNews)
782 {
783 buf_strcpy(priv->file, ff->name);
784 buf_expand_path(priv->file);
785 }
786 else if (priv->state.imap_browse)
787 {
788 buf_strcpy(priv->file, ff->name);
789 }
790 else
791 {
793 }
794
795 return op_exit(priv, op);
796}
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition: buffer.c:76
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition: buffer.c:226
char * HomeDir
User's home directory.
Definition: globals.c:37
MailboxType
Supported mailbox formats.
Definition: mailbox.h:41
@ MUTT_MAILBOX_ERROR
Error occurred examining Mailbox.
Definition: mailbox.h:43
@ MUTT_UNKNOWN
Mailbox wasn't recognised.
Definition: mailbox.h:44
static int op_exit(struct AliasMenuData *mdata, int op)
exit this menu - Implements alias_function_t -
Definition: functions.c:191
enum MailboxType mx_path_probe(const char *path)
Find a mailbox that understands a path.
Definition: mx.c:1321
struct Buffer * old_last_dir
Previous to last dir.
Definition: private_data.h:48
char goto_swapper[PATH_MAX]
Saved path after <goto-folder>
Definition: private_data.h:47
char delim
Path delimiter.
Definition: lib.h:92
bool inferiors
Folder has children.
Definition: lib.h:96
A parsed URL proto://user:password@host:port/path?a=1&b=2
Definition: url.h:69
char * path
Path.
Definition: url.h:75
struct Url * url_parse(const char *src)
Fill in Url.
Definition: url.c:239
void url_free(struct Url **ptr)
Free the contents of a URL.
Definition: url.c:124
+ Here is the call graph for this function:

◆ op_load_active()

static int op_load_active ( struct BrowserPrivateData priv,
int  op 
)
static

Load list of all newsgroups from NNTP server - Implements browser_function_t -.

Definition at line 801 of file functions.c.

802{
803 if (!OptNews)
804 return FR_NOT_IMPL;
805
807
808 if (nntp_newsrc_parse(adata) < 0)
809 return FR_ERROR;
810
811 for (size_t i = 0; i < adata->groups_num; i++)
812 {
813 struct NntpMboxData *mdata = adata->groups_list[i];
814 if (mdata)
815 mdata->deleted = true;
816 }
820
821 destroy_state(&priv->state);
822 if (priv->state.is_mailbox_list)
823 {
824 examine_mailboxes(priv->mailbox, priv->menu, &priv->state);
825 }
826 else
827 {
828 if (examine_directory(priv->mailbox, priv->menu, &priv->state, NULL, NULL) == -1)
829 return FR_ERROR;
830 }
831 init_menu(&priv->state, priv->menu, priv->mailbox, priv->sbar);
832 return FR_SUCCESS;
833}
int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state)
Get list of mailboxes/subscribed newsgroups.
Definition: dlg_browser.c:833
int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new)
Fetch list of all newsgroups from server.
Definition: nntp.c:2037
void ** groups_list
Definition: adata.h:60
struct NntpAccountData * adata
Definition: mdata.h:48
+ Here is the call graph for this function:

◆ op_mailbox_list()

static int op_mailbox_list ( struct BrowserPrivateData priv,
int  op 
)
static

List mailboxes with new mail - Implements browser_function_t -.

Definition at line 838 of file functions.c.

839{
841 return FR_SUCCESS;
842}
bool mutt_mailbox_list(void)
Show a message with the list of mailboxes with new mail.
Definition: mutt_mailbox.c:248
+ Here is the call graph for this function:

◆ op_rename_mailbox()

static int op_rename_mailbox ( struct BrowserPrivateData priv,
int  op 
)
static

Rename the current mailbox (IMAP only) - Implements browser_function_t -.

Definition at line 847 of file functions.c.

848{
849 int index = menu_get_index(priv->menu);
850 struct FolderFile *ff = ARRAY_GET(&priv->state.entry, index);
851 if (!ff->imap)
852 {
853 mutt_error(_("Rename is only supported for IMAP mailboxes"));
854 return FR_ERROR;
855 }
856
857 if (imap_mailbox_rename(ff->name) < 0)
858 return FR_ERROR;
859
860 destroy_state(&priv->state);
861 init_state(&priv->state, NULL);
862 priv->state.imap_browse = true;
864 browser_sort(&priv->state);
865 priv->menu->mdata = &priv->state.entry;
866 priv->menu->mdata_free = NULL; // Menu doesn't own the data
867 browser_highlight_default(&priv->state, priv->menu);
868 init_menu(&priv->state, priv->menu, priv->mailbox, priv->sbar);
869
870 return FR_SUCCESS;
871}
int imap_mailbox_rename(const char *path)
Rename a mailbox.
Definition: browse.c:449
+ Here is the call graph for this function:

◆ op_sort()

static int op_sort ( struct BrowserPrivateData priv,
int  op 
)
static

Sort messages - Implements browser_function_t -.

This function handles:

  • OP_SORT
  • OP_SORT_REVERSE

Definition at line 880 of file functions.c.

881{
882 bool resort = true;
883 int sort = -1;
884 int reverse = (op == OP_SORT_REVERSE);
885
886 switch (mw_multi_choice((reverse) ?
887 /* L10N: The highlighted letters must match the "Sort" options */
888 _("Reverse sort by (d)ate, (a)lpha, si(z)e, d(e)scription, (c)ount, ne(w) count, or do(n)'t sort?") :
889 /* L10N: The highlighted letters must match the "Reverse Sort" options */
890 _("Sort by (d)ate, (a)lpha, si(z)e, d(e)scription, (c)ount, ne(w) count, or do(n)'t sort?"),
891 /* L10N: These must match the highlighted letters from "Sort" and "Reverse Sort" */
892 _("dazecwn")))
893 {
894 case -1: /* abort */
895 resort = false;
896 break;
897
898 case 1: /* (d)ate */
899 sort = SORT_DATE;
900 break;
901
902 case 2: /* (a)lpha */
903 sort = SORT_SUBJECT;
904 break;
905
906 case 3: /* si(z)e */
907 sort = SORT_SIZE;
908 break;
909
910 case 4: /* d(e)scription */
911 sort = SORT_DESC;
912 break;
913
914 case 5: /* (c)ount */
915 sort = SORT_COUNT;
916 break;
917
918 case 6: /* ne(w) count */
919 sort = SORT_UNREAD;
920 break;
921
922 case 7: /* do(n)'t sort */
923 sort = SORT_ORDER;
924 break;
925 }
926
927 if (!resort)
928 return FR_NO_ACTION;
929
930 sort |= reverse ? SORT_REVERSE : 0;
931 cs_subset_str_native_set(NeoMutt->sub, "sort_browser", sort, NULL);
932 browser_sort(&priv->state);
933 browser_highlight_default(&priv->state, priv->menu);
935 return FR_SUCCESS;
936}
int mw_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question -.
Definition: question.c:63
@ 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_SIZE
Sort by the size of the email.
Definition: sort2.h:36
@ SORT_DESC
Sort by the folder's description.
Definition: sort2.h:55
@ SORT_DATE
Sort by the date the email was sent.
Definition: sort2.h:35
@ SORT_COUNT
Sort by number of emails in a folder.
Definition: sort2.h:50
@ SORT_UNREAD
Sort by the number of unread emails.
Definition: sort2.h:51
#define SORT_REVERSE
Reverse the order of the sort.
Definition: sort2.h:71
int cs_subset_str_native_set(const struct ConfigSubset *sub, const char *name, intptr_t value, struct Buffer *err)
Natively set the value of a string config item.
Definition: subset.c:297
+ Here is the call graph for this function:

◆ op_subscribe_pattern()

static int op_subscribe_pattern ( struct BrowserPrivateData priv,
int  op 
)
static

Subscribe to newsgroups matching a pattern - Implements browser_function_t -.

This function handles:

  • OP_SUBSCRIBE_PATTERN
  • OP_UNSUBSCRIBE_PATTERN

Definition at line 945 of file functions.c.

946{
947 if (!OptNews)
948 return FR_NOT_IMPL;
949
951 regex_t rx = { 0 };
952 int index = menu_get_index(priv->menu);
953
954 char tmp2[256] = { 0 };
955
956 struct Buffer *buf = buf_pool_get();
957 if (op == OP_SUBSCRIBE_PATTERN)
958 snprintf(tmp2, sizeof(tmp2), _("Subscribe pattern: "));
959 else
960 snprintf(tmp2, sizeof(tmp2), _("Unsubscribe pattern: "));
961 /* buf comes from the buffer pool, so defaults to size 1024 */
962 if ((mw_get_field(tmp2, buf, MUTT_COMP_NO_FLAGS, HC_PATTERN, &CompletePatternOps, NULL) != 0) ||
963 buf_is_empty(buf))
964 {
965 buf_pool_release(&buf);
966 return FR_NO_ACTION;
967 }
968
969 int err = REG_COMP(&rx, buf->data, REG_NOSUB);
970 if (err != 0)
971 {
972 regerror(err, &rx, buf->data, buf->dsize);
973 regfree(&rx);
974 mutt_error("%s", buf_string(buf));
975 buf_pool_release(&buf);
976 return FR_ERROR;
977 }
979 index = 0;
980 buf_pool_release(&buf);
981
982 int rc = nntp_newsrc_parse(adata);
983 if (rc < 0)
984 return FR_ERROR;
985
986 struct FolderFile *ff = NULL;
987 ARRAY_FOREACH_FROM(ff, &priv->state.entry, index)
988 {
989 if (regexec(&rx, ff->name, 0, NULL, 0) == 0)
990 {
991 if (op == OP_SUBSCRIBE_PATTERN)
992 mutt_newsgroup_subscribe(adata, ff->name);
993 else
995 }
996 }
997
998 if (op == OP_SUBSCRIBE_PATTERN)
999 {
1000 for (size_t j = 0; j < adata->groups_num; j++)
1001 {
1002 struct NntpMboxData *mdata = adata->groups_list[j];
1003 if (mdata && mdata->group && !mdata->subscribed)
1004 {
1005 if (regexec(&rx, mdata->group, 0, NULL, 0) == 0)
1006 {
1008 browser_add_folder(priv->menu, &priv->state, mdata->group, NULL, NULL, NULL, mdata);
1009 }
1010 }
1011 }
1012 init_menu(&priv->state, priv->menu, priv->mailbox, priv->sbar);
1013 }
1014 if (rc > 0)
1019 regfree(&rx);
1020 return FR_SUCCESS;
1021}
#define ARRAY_FOREACH_FROM(elem, head, from)
Iterate from an index to the end.
Definition: array.h:223
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
@ HC_PATTERN
Patterns.
Definition: lib.h:55
const struct CompleteOps CompletePatternOps
Auto-Completion of Patterns.
Definition: complete.c:82
#define REG_COMP(preg, regex, cflags)
Compile a regular expression.
Definition: regex3.h:50
unsigned int groups_num
Definition: adata.h:58
+ Here is the call graph for this function:

◆ op_toggle_mailboxes()

static int op_toggle_mailboxes ( struct BrowserPrivateData priv,
int  op 
)
static

Toggle whether to browse mailboxes or all files - Implements browser_function_t -.

This function handles:

  • OP_CHECK_NEW
  • OP_TOGGLE_MAILBOXES

Definition at line 1030 of file functions.c.

1031{
1032 if (priv->state.is_mailbox_list)
1033 {
1035 }
1036
1037 if (op == OP_TOGGLE_MAILBOXES)
1038 {
1040 }
1041
1042 if (op == OP_BROWSER_GOTO_FOLDER)
1043 {
1044 /* When in mailboxes mode, disables this feature */
1045 const char *const c_folder = cs_subset_string(NeoMutt->sub, "folder");
1046 if (c_folder)
1047 {
1048 mutt_debug(LL_DEBUG3, "= hit! Folder: %s, LastDir: %s\n", c_folder,
1050 if (priv->goto_swapper[0] == '\0')
1051 {
1052 if (!mutt_str_equal(buf_string(&LastDir), c_folder))
1053 {
1054 /* Stores into goto_swapper LastDir, and swaps to `$folder` */
1055 mutt_str_copy(priv->goto_swapper, buf_string(&LastDir), sizeof(priv->goto_swapper));
1057 buf_strcpy(&LastDir, c_folder);
1058 }
1059 }
1060 else
1061 {
1064 priv->goto_swapper[0] = '\0';
1065 }
1066 }
1067 }
1068 destroy_state(&priv->state);
1069 buf_reset(priv->prefix);
1070 priv->kill_prefix = false;
1071
1072 if (priv->state.is_mailbox_list)
1073 {
1074 examine_mailboxes(priv->mailbox, priv->menu, &priv->state);
1075 }
1076 else if (imap_path_probe(buf_string(&LastDir), NULL) == MUTT_IMAP)
1077 {
1078 init_state(&priv->state, NULL);
1079 priv->state.imap_browse = true;
1081 browser_sort(&priv->state);
1082 priv->menu->mdata = &priv->state.entry;
1083 priv->menu->mdata_free = NULL; // Menu doesn't own the data
1084 }
1085 else if (examine_directory(priv->mailbox, priv->menu, &priv->state,
1086 buf_string(&LastDir), buf_string(priv->prefix)) == -1)
1087 {
1088 priv->done = true;
1089 return FR_ERROR;
1090 }
1091 init_menu(&priv->state, priv->menu, priv->mailbox, priv->sbar);
1092 if (priv->state.is_mailbox_list)
1094 return FR_ERROR;
1095}
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:291
struct Buffer LastDirBackup
Browser: backup copy of the current directory.
Definition: dlg_browser.c:141
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
@ LL_DEBUG3
Log at debug level 3.
Definition: logging2.h:45
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
int last_selected_mailbox
Index of last selected Mailbox.
Definition: private_data.h:50
+ Here is the call graph for this function: