NeoMutt  2024-11-14-138-ge5ca67
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
expando.c File Reference

Sidebar Expando definitions. More...

#include <stdbool.h>
#include <stdio.h>
#include "private.h"
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "expando.h"
#include "expando/lib.h"
#include "index/lib.h"
+ Include dependency graph for expando.c:

Go to the source code of this file.

Functions

static size_t add_indent (char *buf, size_t buflen, const struct SbEntry *sbe)
 Generate the needed indentation.
 
static long sidebar_deleted_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Sidebar: Number of deleted messages - Implements get_number_t -.
 
static void sidebar_description (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Sidebar: Descriptive name - Implements get_string_t -.
 
static void sidebar_flagged (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Sidebar: Flagged flags - Implements get_string_t -.
 
static long sidebar_flagged_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Sidebar: Number of flagged messages - Implements get_number_t -.
 
static long sidebar_limited_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Sidebar: Number of limited messages - Implements get_number_t -.
 
static long sidebar_message_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Sidebar: number of messages - Implements get_number_t -.
 
static void sidebar_name (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Sidebar: Name of the mailbox - Implements get_string_t -.
 
static void sidebar_new_mail (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
 Sidebar: New mail flag - Implements get_string_t -.
 
static long sidebar_new_mail_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Sidebar: New mail flag - Implements get_number_t -.
 
static long sidebar_notify_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Sidebar: Alert for new mail - Implements get_number_t -.
 
static long sidebar_old_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Sidebar: Number of old messages - Implements get_number_t -.
 
static long sidebar_poll_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Sidebar: Poll for new mail - Implements get_number_t -.
 
static long sidebar_read_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Sidebar: Number of read messages - Implements get_number_t -.
 
static long sidebar_tagged_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Sidebar: Number of tagged messages - Implements get_number_t -.
 
static long sidebar_unread_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Sidebar: Number of unread messages - Implements get_number_t -.
 
static long sidebar_unseen_count_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
 Sidebar: Number of new messages - Implements get_number_t -.
 

Variables

const struct ExpandoRenderCallback SidebarRenderCallbacks []
 Callbacks for Sidebar Expandos.
 

Detailed Description

Sidebar Expando definitions.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file expando.c.

Function Documentation

◆ add_indent()

static size_t add_indent ( char *  buf,
size_t  buflen,
const struct SbEntry sbe 
)
static

Generate the needed indentation.

Parameters
bufOutput buffer
buflenSize of output buffer
sbeSidebar entry
Return values
numBytes written

Definition at line 46 of file expando.c.

47{
48 size_t res = 0;
49 const char *const c_sidebar_indent_string = cs_subset_string(NeoMutt->sub, "sidebar_indent_string");
50 for (int i = 0; i < sbe->depth; i++)
51 {
52 res += mutt_str_copy(buf + res, c_sidebar_indent_string, buflen - res);
53 }
54 return res;
55}
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:291
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
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
int depth
Indentation depth.
Definition: private.h:44
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ SidebarRenderCallbacks

const struct ExpandoRenderCallback SidebarRenderCallbacks[]
Initial value:
= {
{ -1, -1, NULL, NULL },
}
@ ED_SIDEBAR
Sidebar ED_SID_ ExpandoDataSidebar.
Definition: domain.h:54
static long sidebar_tagged_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Sidebar: Number of tagged messages - Implements get_number_t -.
Definition: expando.c:267
static long sidebar_message_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Sidebar: number of messages - Implements get_number_t -.
Definition: expando.c:161
static long sidebar_unread_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Sidebar: Number of unread messages - Implements get_number_t -.
Definition: expando.c:284
static long sidebar_poll_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Sidebar: Poll for new mail - Implements get_number_t -.
Definition: expando.c:243
static long sidebar_deleted_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Sidebar: Number of deleted messages - Implements get_number_t -.
Definition: expando.c:60
static long sidebar_limited_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Sidebar: Number of limited messages - Implements get_number_t -.
Definition: expando.c:144
static long sidebar_new_mail_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Sidebar: New mail flag - Implements get_number_t -.
Definition: expando.c:207
static long sidebar_flagged_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Sidebar: Number of flagged messages - Implements get_number_t -.
Definition: expando.c:131
static long sidebar_read_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Sidebar: Number of read messages - Implements get_number_t -.
Definition: expando.c:255
static long sidebar_unseen_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Sidebar: Number of new messages - Implements get_number_t -.
Definition: expando.c:297
static long sidebar_old_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Sidebar: Number of old messages - Implements get_number_t -.
Definition: expando.c:231
static long sidebar_notify_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Sidebar: Alert for new mail - Implements get_number_t -.
Definition: expando.c:219
static void sidebar_name(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Sidebar: Name of the mailbox - Implements get_string_t -.
Definition: expando.c:174
static void sidebar_new_mail(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Sidebar: New mail flag - Implements get_string_t -.
Definition: expando.c:192
static void sidebar_description(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Sidebar: Descriptive name - Implements get_string_t -.
Definition: expando.c:77
static void sidebar_flagged(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Sidebar: Flagged flags - Implements get_string_t -.
Definition: expando.c:103
@ ED_SID_FLAGGED_COUNT
Mailbox.msg_flagged.
Definition: private.h:61
@ ED_SID_READ_COUNT
Mailbox.msg_count, Mailbox.msg_unread.
Definition: private.h:69
@ ED_SID_DESCRIPTION
Mailbox.name.
Definition: private.h:59
@ ED_SID_NEW_MAIL
Mailbox.has_new.
Definition: private.h:65
@ ED_SID_UNSEEN_COUNT
Mailbox.msg_new.
Definition: private.h:72
@ ED_SID_POLL
Mailbox.poll_new_mail.
Definition: private.h:68
@ ED_SID_OLD_COUNT
Mailbox.msg_unread, Mailbox.msg_new.
Definition: private.h:67
@ ED_SID_MESSAGE_COUNT
Mailbox.msg_count.
Definition: private.h:63
@ ED_SID_LIMITED_COUNT
Mailbox.vcount.
Definition: private.h:62
@ ED_SID_UNREAD_COUNT
Mailbox.msg_unread.
Definition: private.h:71
@ ED_SID_TAGGED_COUNT
Mailbox.msg_tagged.
Definition: private.h:70
@ ED_SID_NOTIFY
Mailbox.notify_user.
Definition: private.h:66
@ ED_SID_NAME
SbEntry.box.
Definition: private.h:64
@ ED_SID_DELETED_COUNT
Mailbox.msg_deleted.
Definition: private.h:58
@ ED_SID_FLAGGED
Mailbox.msg_flagged.
Definition: private.h:60

Callbacks for Sidebar Expandos.

See also
SidebarFormatDef, ExpandoDataSidebar

Definition at line 312 of file expando.c.