return NULL; /* no such alias */
}
+/**
+ * expand_aliases_r - Expand aliases, recursively
+ * @param[in] a Address List
+ * @param[out] expn Alias List
+ * @retval ptr Address List with aliases expanded
+ *
+ * ListHead expn is used as temporary storage for already-expanded aliases.
+ */
static struct Address *expand_aliases_r(struct Address *a, struct ListHead *expn)
{
struct Address *head = NULL, *last = NULL, *t = NULL, *w = NULL;
#ifdef MIXMASTER
+/**
+ * redraw_mix_line - Redraw the Mixmaster chain
+ * @param chain List of chain links
+ */
static void redraw_mix_line(struct ListHead *chain)
{
char *t = NULL;
*a = NULL;
}
+/**
+ * dump_stailq - Pack a STAILQ into a binary blob
+ * @param l List to read from
+ * @param d Binary blob to add to
+ * @param off Offset into the blob
+ * @param convert If true, the strings will be converted to utf-8
+ * @retval ptr End of the newly packed binary
+ */
static unsigned char *dump_stailq(struct ListHead *l, unsigned char *d, int *off, bool convert)
{
unsigned int counter = 0;
return d;
}
+/**
+ * restore_stailq - Unpack a STAILQ from a binary blob
+ * @param l List to add to
+ * @param d Binary blob to read from
+ * @param off Offset into blob
+ * @param convert If true, the strings will be converted from utf-8
+ */
static void restore_stailq(struct ListHead *l, const unsigned char *d, int *off, bool convert)
{
unsigned int counter;
mutt_pretty_mailbox(path, pathlen);
}
+/**
+ * list_hook - Find hook strings matching
+ * @param[out] matches List of hook strings
+ * @param[in] match String to match
+ * @param[in] hook Hook type, e.g. #MUTT_CRYPTHOOK
+ */
static void list_hook(struct ListHead *matches, const char *match, int hook)
{
struct Hook *tmp = NULL;
}
}
+/**
+ * mutt_crypt_hook - Find crypto hooks for an Address
+ * @param[out] list List of keys
+ * @param[in] addr Address to match
+ *
+ * The crypt-hook associates keys with addresses.
+ */
void mutt_crypt_hook(struct ListHead *list, struct Address *addr)
{
list_hook(list, addr->mailbox, MUTT_CRYPTHOOK);
mutt_regexlist_free(&NoSpamList);
}
+/**
+ * add_to_stailq - Add a string to a list
+ * @param head String list
+ * @param str String to add
+ *
+ * @note Duplicate or empty strings will not be added
+ */
static void add_to_stailq(struct ListHead *head, const char *str)
{
/* don't add a NULL or empty string to the list */
/**
* finish_source - 'finish' command: stop processing current config file
- * @param tmp Temporary space shared by all command handlers
+ * @param buf Temporary space shared by all command handlers
* @param s Current line of the config file
* @param data data field from init.h:struct Command
* @param err Buffer for any error message
/**
* parse_ifdef - 'ifdef' command: conditional config
- * @param tmp Temporary space shared by all command handlers
+ * @param buf Temporary space shared by all command handlers
* @param s Current line of the config file
* @param data data field from init.h:struct Command
* @param err Buffer for any error message
return 0;
}
+/**
+ * remove_from_stailq - Remove an item, matching a string, from a List
+ * @param head Head of the List
+ * @param str String to match
+ *
+ * @note The string comparison is case-insensitive
+ */
static void remove_from_stailq(struct ListHead *head, const char *str)
{
if (mutt_str_strcmp("*", str) == 0)
Context->hdrs[i]->attach_valid = false;
}
+/**
+ * parse_attach_list - Parse the "attachments" command
+ * @param buf Buffer for temporary storage
+ * @param s Buffer containing the attachments command
+ * @param head List of AttachMatch to add to
+ * @param err Buffer for error messages
+ * @retval 0 Success
+ * @retval -1 Error
+ */
static int parse_attach_list(struct Buffer *buf, struct Buffer *s,
struct ListHead *head, struct Buffer *err)
{
return 0;
}
+/**
+ * parse_unattach_list - Parse the "unattachments" command
+ * @param buf Buffer for temporary storage
+ * @param s Buffer containing the unattachments command
+ * @param head List of AttachMatch to remove from
+ * @param err Buffer for error messages
+ * @retval 0 Always
+ */
static int parse_unattach_list(struct Buffer *buf, struct Buffer *s,
struct ListHead *head, struct Buffer *err)
{
return 0;
}
+/**
+ * print_attach_list - Print a list of attachments
+ * @param h List of attachments
+ * @param op Operation, e.g. '+', '-'
+ * @param name Attached/Inline, 'A', 'I'
+ * @retval 0 Always
+ */
static int print_attach_list(struct ListHead *h, char op, char *name)
{
struct ListNode *np;
/**
* mutt_query_variables - Implement the -Q command line flag
+ * @param queries List of query strings
+ * @retval 0 Success, all queries exist
+ * @retval 1 Error
*/
int mutt_query_variables(struct ListHead *queries)
{
return 0;
}
+/**
+ * execute_commands - Execute a set of NeoMutt commands
+ * @param p List of command strings
+ * @retval 0 Success, all the commands succeeded
+ * @retval -1 Error
+ */
static int execute_commands(struct ListHead *p)
{
struct Buffer err, token;
return true;
}
+/**
+ * mutt_init - Initialise NeoMutt
+ * @param skip_sys_rc If true, don't read the system config file
+ * @param commands List of config commands to execute
+ * @retval 0 Success
+ * @retval 1 Error
+ */
int mutt_init(int skip_sys_rc, struct ListHead *commands)
{
char buffer[LONG_STRING];
#define MUTT_NEWS (1 << 5) /* -g and -G */
#endif
+/**
+ * get_user_info - Find the user's name, home and shell
+ * @param cs Config Set
+ * @retval 0 Success
+ * @retval 1 Error
+ */
static int get_user_info(void)
{
const char *p = mutt_str_getenv("HOME");
* main - Start NeoMutt
* @param argc Number of command line arguments
* @param argv List of command line arguments
- * @param env Copy of the environment
+ * @param envp Copy of the environment
* @retval 0 on success
* @retval 1 on error
*/
/**
* mutt_md5 - Calculate the MD5 hash of a NULL-terminated string
- * @param s String to hash
+ * @param string String to hash
* @param resbuf Buffer for result
*/
void *mutt_md5(const char *string, void *resbuf)
/**
* mutt_md5_process - Process a NULL-terminated string
- * @param s String to process
- * @param ctx MD5 context
+ * @param string String to process
+ * @param ctx MD5 context
*/
void mutt_md5_process(const char *string, struct Md5Ctx *ctx)
{
* mutt_str_strdup - Copy a string, safely
* @param str String to copy
* @retval ptr Copy of the string
- * @retval NULL if s was NULL
+ * @retval NULL if str was NULL
*/
char *mutt_str_strdup(const char *str)
{
/**
* list_to_pattern - Convert STailQ to GPGME-compatible pattern
+ * @param list List of strings to convert
+ * @retval ptr GPGME-compatible pattern
*
* We need to convert spaces in an item into a '+' and '%' into "%25".
+ *
+ * @note The caller must free the returned pattern
*/
static char *list_to_pattern(struct ListHead *list)
{
/**
* get_candidates - Get a list of keys which are candidates for the selection
+ * @param hints List of strings to match
+ * @param app Application type, e.g. #APPLICATION_PGP
+ * @param secret If true, only match secret keys
+ * @retval ptr Key List
+ * @retval NULL Error
*
* Select by looking at the HINTS list.
*/
/**
* find_keys - Find keys of the recipients of the message
- * @retval NULL if any of the keys can not be found
+ * @param addrlist Address List
+ * @param app Application type, e.g. #APPLICATION_PGP
+ * @param oppenc_mode If true, use opportunistic encryption
+ * @retval ptr Space-separated string of keys
+ * @retval NULL At least one of the keys can't be found
*
* If oppenc_mode is true, only keys that can be determined without prompting
* will be used.
return NULL;
}
+/**
+ * pgp_get_candidates - Find PGP keys matching a list of hints
+ * @param keyring PGP Keyring
+ * @param hints List of strings to match
+ * @retval ptr Key list
+ * @retval NULL Error
+ */
struct PgpKeyInfo *pgp_get_candidates(enum PgpRing keyring, struct ListHead *hints)
{
FILE *fp = NULL;
/**
* pgp_find_keys - Find the keyids of the recipients of a message
+ * @param addrlist Address List
+ * @param oppenc_mode If true, use opportunistic encryption
+ * @retval ptr Space-separated string of keys
+ * @retval NULL At least one of the keys can't be found
*
- * It returns NULL if any of the keys can not be found. If oppenc_mode is
- * true, only keys that can be determined without prompting will be used.
+ * If oppenc_mode is true, only keys that can be determined without prompting
+ * will be used.
*/
char *pgp_find_keys(struct Address *addrlist, int oppenc_mode)
{
NULL, uids, PgpVerifyKeyCommand);
}
+/**
+ * pgp_invoke_list_keys - Find matching PGP Keys
+ * @param pgpin File stream pointing to stdin for the command process, can be NULL
+ * @param pgpout File stream pointing to stdout for the command process, can be NULL
+ * @param pgperr File stream pointing to stderr for the command process, can be NULL
+ * @param pgpinfd If `pgpin` is NULL and pgpin is not -1 then pgpin will be used as stdin for the command process
+ * @param pgpoutfd If `pgpout` is NULL and pgpout is not -1 then pgpout will be used as stdout for the command process
+ * @param pgperrfd If `pgperr` is NULL and pgperr is not -1 then pgperr will be used as stderr for the command process
+ * @param keyring Keyring type, e.g. #PGP_SECRING
+ * @param hints Match keys to these strings
+ * @retval n pid of the created process
+ * @retval -1 on any error creating pipes or forking
+ */
pid_t pgp_invoke_list_keys(FILE **pgpin, FILE **pgpout, FILE **pgperr,
int pgpinfd, int pgpoutfd, int pgperrfd,
enum PgpRing keyring, struct ListHead *hints)
/* not reached */
}
+/**
+ * parse_references - Parse references from an email header
+ * @param head List to receive the references
+ * @param s String to parse
+ */
static void parse_references(struct ListHead *head, char *s)
{
char *m = NULL;
/**
* count_body_parts_check - Compares mime types to the ok and except lists
+ * @param checklist List of AttachMatch
+ * @param b Email Body
+ * @param dflt Log whether the matches are OK, or Excluded
+ * @retval true Attachment should be counted
*/
static bool count_body_parts_check(struct ListHead *checklist, struct Body *b, bool dflt)
{
return pat->alladdr; /* No matches, or all matches if alladdr */
}
+/**
+ * match_reference - Match references against a Pattern
+ * @param pat Pattern to match
+ * @param refs List of References
+ * @retval true One of the references matches
+ */
static bool match_reference(struct Pattern *pat, struct ListHead *refs)
{
struct ListNode *np;
{ N_("OK"), OP_MIX_USE }, { NULL, 0 },
};
+/**
+ * mix_make_chain - Create a Mixmaster chain
+ * @param chainhead List if chain links
+ *
+ * Ask the user to select Mixmaster hosts to create a chain.
+ */
void mix_make_chain(struct ListHead *chainhead)
{
int c_cur = 0, c_old = 0;
return 0;
}
+/**
+ * mix_send_message - Send an email via Mixmaster
+ * @param chain String list of hosts
+ * @param tempfile Temporary file containing email
+ * @retval -1 Error
+ * @retval >=0 Success (Mixmaster's return code)
+ */
int mix_send_message(struct ListHead *chain, const char *tempfile)
{
char cmd[HUGE_STRING];
return 0;
}
+/**
+ * add_references - Add the email's references to a list
+ * @param head List of references
+ * @param e Envelope of message
+ */
static void add_references(struct ListHead *head, struct Envelope *e)
{
struct ListHead *src;
}
}
+/**
+ * add_message_id - Add the email's message ID to a list
+ * @param head List of message IDs
+ * @param e Envelope of message
+ */
static void add_message_id(struct ListHead *head, struct Envelope *e)
{
if (e->message_id)
/**
* mutt_write_references - Add the message references to a list
+ * @param r String List of references
+ * @param f File to write to
+ * @param trim Trim the list to at most this many items
*
- * need to write the list in reverse because they are stored in reverse order
- * when parsed to speed up threading
+ * Write the list in reverse because they are stored in reverse order when
+ * parsed to speed up threading.
*/
void mutt_write_references(const struct ListHead *r, FILE *f, size_t trim)
{
return (ferror(fp) == 0 ? 0 : -1);
}
+/**
+ * encode_headers - RFC2047-encode a list of headers
+ * @param h String List of headers
+ *
+ * The strings are encoded in-place.
+ */
static void encode_headers(struct ListHead *h)
{
char *tmp = NULL;
}
/**
- * make_subject_list - Create a list of all subjects in a thread
+ * make_subject_list - Create a sorted list of all subjects in a thread
+ * @param[out] subjects String List of subjects
+ * @param[in] cur Email Thread
+ * @param[out] dateptr Earliest date found in thread
*
- * since we may be trying to attach as a pseudo-thread a MuttThread that
- * has no message, we have to make a list of all the subjects of its
- * most immediate existing descendants. we also note the earliest
- * date on any of the parents and put it in *dateptr.
+ * Since we may be trying to attach as a pseudo-thread a MuttThread that has no
+ * message, we have to make a list of all the subjects of its most immediate
+ * existing descendants.
*/
static void make_subject_list(struct ListHead *subjects, struct MuttThread *cur, time_t *dateptr)
{
/**
* find_subject - Find the best possible match for a parent based on subject
+ * @param ctx Mailbox
+ * @param cur Email to match
+ * @retval ptr Best match for a parent
*
* If there are multiple matches, the one which was sent the latest, but before
* the current message, is used.