NeoMutt  2025-09-05-7-geaa2bd
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
helpers.c
Go to the documentation of this file.
1
30#include "config.h"
31#include <stddef.h>
32#include "mutt/lib.h"
33#include "helpers.h"
34#include "mutt_thread.h"
35#include "render.h"
36
45 int did, int uid)
46{
47 if (!erc)
48 return NULL;
49
50 for (; erc->did != -1; erc++)
51 {
52 if ((erc->did == did) && (erc->uid == uid) && erc->get_number)
53 {
54 return erc;
55 }
56 }
57
58 return NULL;
59}
60
69 int did, int uid)
70{
71 if (!erc)
72 return NULL;
73
74 for (; erc->did != -1; erc++)
75 {
76 if ((erc->did == did) && (erc->uid == uid) && erc->get_string)
77 {
78 return erc;
79 }
80 }
81
82 return NULL;
83}
84
91void buf_lower_special(struct Buffer *buf)
92{
93 if (!buf || !buf->data)
94 return;
95
96 char *p = buf->data;
97
98 while (*p)
99 {
100 if (*p == MUTT_SPECIAL_INDEX)
101 {
102 p += 2;
103 continue;
104 }
105 else if (*p < MUTT_TREE_MAX)
106 {
107 p++;
108 continue;
109 }
110
111 *p = mutt_tolower(*p);
112 p++;
113 }
114}
int mutt_tolower(int arg)
Wrapper for tolower(3)
Definition: ctype.c:125
const struct ExpandoRenderCallback * find_get_string(const struct ExpandoRenderCallback *erc, int did, int uid)
Find a get_string() callback function.
Definition: helpers.c:68
void buf_lower_special(struct Buffer *buf)
Convert to lowercase, excluding special characters.
Definition: helpers.c:91
const struct ExpandoRenderCallback * find_get_number(const struct ExpandoRenderCallback *erc, int did, int uid)
Find a get_number() callback function.
Definition: helpers.c:44
Shared code.
Convenience wrapper for the library headers.
Create/manipulate threading in emails.
@ MUTT_TREE_MAX
Definition: mutt_thread.h:70
@ MUTT_SPECIAL_INDEX
Colour indicator.
Definition: mutt_thread.h:72
Render Expandos using Data.
String manipulation buffer.
Definition: buffer.h:36
char * data
Pointer to data.
Definition: buffer.h:37
int uid
Unique ID, e.g. ExpandoDataAlias.
Definition: render.h:78
int did
Domain ID, ExpandoDomain.
Definition: render.h:77
get_string_t get_string
Definition: render.h:80
get_number_t get_number
Definition: render.h:81