59 new_size =
ROUND_UP(new_size + 2, 512);
80 if (!dest || !user || !src)
83 if (strstr(src, user) != src)
95 for (l = 0; (src[l] !=
'\0') && (src[l] == dest[l]); l++)
114 char *pt = buf->
data;
118 spaces = pt - buf->
data;
120 pt = buf->
data + pos - spaces;
121 while ((pt > buf->
data) && !isspace((
unsigned char) *pt))
135 for (
size_t num = 0, size =
commands_array(&c); num < size; num++)
168 static const char *
const prefixes[] = {
"no",
"inv",
"?",
"&", 0 };
174 for (
int num = 0; prefixes[num]; num++)
194 for (
size_t i = 0; he_list[i]; i++)
249 for (
int num = 0; funcs[num].
name; num++)
255 for (
int num = 0; funcs[num].
name; num++)
298static int label_sort(
const void *a,
const void *b,
void *sdata)
300 return strcasecmp(*(
const char **) a, *(
const char **) b);
313 char *pt = buf->
data;
375 char *pt = buf->
data;
381 const int spaces = pt - buf->
data;
383 pt = buf->
data + pos - spaces;
384 while ((pt > buf->
data) && !isspace((
unsigned char) *pt))
392 char var[256] = { 0 };
399 var[vlen - 1] =
'\0';
411 snprintf(pt, buf->
dsize - (pt - buf->
data),
"%s=%s", var, pretty->
data);
428 if (!wdata || ((op != OP_EDITOR_COMPLETE) && (op != OP_EDITOR_COMPLETE_QUERY)))
434 if ((i != 0) && (
buf_at(wdata->
buffer, i - 1) ==
'=') &&
453 if (!wdata || ((op != OP_EDITOR_COMPLETE) && (op != OP_EDITOR_COMPLETE_QUERY)))
size_t buf_len(const struct Buffer *buf)
Calculate the length of a Buffer.
void buf_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
char buf_at(const struct Buffer *buf, size_t offset)
Return the character at the given offset.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
size_t buf_startswith(const struct Buffer *buf, const char *prefix)
Check whether a buffer starts with a prefix.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
int mutt_var_value_complete(struct CompletionData *cd, struct Buffer *buf, int pos)
Complete a variable/value.
void matches_ensure_morespace(struct CompletionData *cd, int new_size)
Allocate more space for auto-completion.
int mutt_label_complete(struct CompletionData *cd, struct Buffer *buf, int numtabs)
Complete a label name.
int mutt_command_complete(struct CompletionData *cd, struct Buffer *buf, int pos, int numtabs)
Complete a command name.
const struct CompleteOps CompleteLabelOps
Auto-Completion of Labels.
const struct CompleteOps CompleteCommandOps
Auto-Completion of Commands.
bool candidate(struct CompletionData *cd, char *user, const char *src, char *dest, size_t dlen)
Helper function for completion.
size_t pretty_var(const char *str, struct Buffer *buf)
Escape and stringify a config item value.
Convenience wrapper for the config headers.
#define CSR_SUCCESS
Action completed successfully.
size_t commands_array(struct Command **first)
Get Commands array.
Convenience wrapper for the core headers.
String auto-completion data.
FunctionRetval
Possible return values for NeoMutt functions.
@ FR_SUCCESS
Valid function - successfully performed.
@ FR_ERROR
Valid function - error occurred.
@ FR_CONTINUE
Remain in the Dialog.
@ FR_NO_ACTION
Valid function - no action performed.
void replace_part(struct EnterState *es, size_t from, const char *buf)
Search and replace on a buffer.
enum FunctionRetval complete_label(struct EnterWindowData *wdata, int op)
Complete a label - Implements CompleteOps::complete() -.
enum FunctionRetval complete_command(struct EnterWindowData *wdata, int op)
Complete a NeoMutt Command - Implements CompleteOps::complete() -.
static int label_sort(const void *a, const void *b, void *sdata)
Compare two label strings - Implements sort_t -.
const struct MenuFuncOp OpGeneric[]
Functions for the Generic Menu.
Convenience wrapper for the gui headers.
struct HashElem * mutt_hash_walk(const struct HashTable *table, struct HashWalkState *state)
Iterate through all the HashElem's in a Hash Table.
GUI manage the main index (list of emails)
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
const struct MenuFuncOp * km_get_table(enum MenuType mtype)
Lookup a Menu's functions.
void buf_mb_wcstombs(struct Buffer *dest, const wchar_t *wstr, size_t wlen)
Convert a string from wide to multibyte characters.
#define ROUND_UP(NUM, STEP)
#define MUTT_MEM_REALLOC(pptr, n, type)
Convenience wrapper for the library headers.
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
void mutt_qsort_r(void *base, size_t nmemb, size_t size, sort_t compar, void *sdata)
Sort an array, where the comparator has access to opaque data rather than requiring global variables.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
const char * name
Name of the command.
enum FunctionRetval(* complete)(struct EnterWindowData *wdata, int op)
State data for auto-completion.
int match_list_len
Enough space for all of the config items.
char user_typed[1024]
Initial string that starts completion.
char completed[256]
Completed string (command or variable)
int num_matched
Number of matches for completion.
const char ** match_list
Matching strings.
struct ConfigSet * cs
Parent ConfigSet.
size_t curpos
Position of the cursor.
wchar_t * wbuf
Buffer for the string being entered.
size_t lastchar
Position of the last character.
Data to fill the Enter Window.
int tabs
Number of times the user has hit tab.
struct CompletionData * cd
Auto-completion state data.
struct Buffer * buffer
struct Buffer for the result
struct EnterState * state
Current state of text entry.
The item stored in a Hash Table.
union HashKey key
Key representing the data.
int type
Type of data stored in Hash Table, e.g. DT_STRING.
Cursor to iterate through a Hash Table.
struct HashTable * label_hash
Hash Table: "x-labels" -> Email.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
int cs_subset_he_string_get(const struct ConfigSubset *sub, struct HashElem *he, struct Buffer *result)
Get a config item as a string.
struct HashElem ** get_elem_list(struct ConfigSet *cs)
Create a sorted list of all config items.
struct HashElem * cs_subset_lookup(const struct ConfigSubset *sub, const char *name)
Find an inherited config item.
MenuType
Types of GUI selections.
@ MENU_GENERIC
Generic selection list.
@ MENU_PAGER
Pager pager (email viewer)
#define D_INTERNAL_DEPRECATED
Config item shouldn't be used any more.
@ DT_SYNONYM
synonym for another variable
const char * strkey
String key.