return 0;
}
-typedef int (*parser_callback_t)(struct Buffer *buf, struct Buffer *s, int *fg,
- int *bg, int *attr, struct Buffer *err);
-
-#ifdef HAVE_COLOR
-
/**
- * parse_color_pair - Parse a pair of colours
+ * parser_callback_t - Prototype for a function to parse color config
* @param[in] buf Temporary Buffer space
* @param[in] s Buffer containing string to be parsed
- * @param[out] fg Foreground colour
- * @param[out] bg Background colour
+ * @param[out] fg Foreground colour (set to -1)
+ * @param[out] bg Background colour (set to -1)
* @param[out] attr Attribute flags
* @param[out] err Buffer for error messages
* @retval 0 Success
* @retval -1 Error
*/
+typedef int (*parser_callback_t)(struct Buffer *buf, struct Buffer *s, int *fg,
+ int *bg, int *attr, struct Buffer *err);
+
+#ifdef HAVE_COLOR
+
+/**
+ * parse_color_pair - Parse a pair of colours - Implements ::parser_callback_t
+ */
static int parse_color_pair(struct Buffer *buf, struct Buffer *s, int *fg,
int *bg, int *attr, struct Buffer *err)
{
#endif
/**
- * parse_attr_spec - Parse an attribute description
- * @param[in] buf Temporary Buffer space
- * @param[in] s Buffer containing string to be parsed
- * @param[out] fg Foreground colour (set to -1)
- * @param[out] bg Background colour (set to -1)
- * @param[out] attr Attribute flags
- * @param[out] err Buffer for error messages
- * @retval 0 Success
- * @retval -1 Error
+ * parse_attr_spec - Parse an attribute description - Implements ::parser_callback_t
*/
static int parse_attr_spec(struct Buffer *buf, struct Buffer *s, int *fg,
int *bg, int *attr, struct Buffer *err)
* @param buf Temporary Buffer space
* @param s Buffer containing string to be parsed
* @param err Buffer for error messages
- * @param callback Function to handle command
+ * @param callback Function to handle command - Implements ::parser_callback_t
* @param dry_run If true, test the command, but don't apply it
* @param color If true "color", else "mono"
* @retval 0 Success
#define CONTINUATION_BYTE(c) (((c) &0xc0) == 0x80)
-typedef size_t (*encoder_t)(char *str, const char *buf, size_t buflen, const char *tocode);
-
/**
- * b_encoder - Base64 Encode a string
+ * encoder_t - Prototype for an encoding function
* @param str String to encode
* @param buf Buffer for result
* @param buflen Length of buffer
* @param tocode Character encoding
* @retval num Bytes written to buffer
*/
+typedef size_t (*encoder_t)(char *str, const char *buf, size_t buflen, const char *tocode);
+
+/**
+ * b_encoder - Base64 Encode a string - Implements ::encoder_t
+ */
static size_t b_encoder(char *str, const char *buf, size_t buflen, const char *tocode)
{
char *s0 = str;
}
/**
- * q_encoder - Quoted-printable Encode a string
- * @param str String to encode
- * @param buf Buffer for result
- * @param buflen Length of buffer
- * @param tocode Character encoding
- * @retval num Bytes written to buffer
+ * q_encoder - Quoted-printable Encode a string - Implements ::encoder_t
*/
static size_t q_encoder(char *str, const char *buf, size_t buflen, const char *tocode)
{
struct Buffer buf = { 0 }; /* Output buffer */
char *s = *pd; /* Read pointer */
char *beg = NULL; /* Begin of encoded word */
- enum ContentEncoding enc; /* ENC_BASE64 or ENC_QUOTED_PRINTABLE */
+ enum ContentEncoding enc; /* ENC_BASE64 or ENC_QUOTED_PRINTABLE */
char *charset = NULL; /* Which charset */
size_t charsetlen; /* Length of the charset */
char *text = NULL; /* Encoded text */
}
/**
- * mutt_free_attachmatch - Free an AttachMatch
- * @param am AttachMatch to free
+ * mutt_free_attachmatch - Free an AttachMatch - Implements ::list_free_t
*
* @note We don't free minor because it is either a pointer into major,
* or a static string.
*/
STAILQ_HEAD(ListHead, ListNode);
+/**
+ * list_free_t - Prototype for a function to free List data
+ * @param ptr Data to free
+ */
typedef void (*list_free_t)(void **ptr);
void mutt_list_clear(struct ListHead *h);
}
/**
- * nntp_compare_order - Sort to mailbox order
- * @param a First Header to compare
- * @param b First Header to compare
- * @retval -1 a precedes b
- * @retval 0 a and b are identical
- * @retval 1 b precedes a
+ * nntp_compare_order - Sort to mailbox order - Implements ::sort_t
*/
int nntp_compare_order(const void *a, const void *b)
{
}
/**
- * compare_score - Compare two emails using their scores
- * @param a First email
- * @param b Second email
- * @retval -1 a precedes b
- * @retval 0 a and b are identical
- * @retval 1 b precedes a
+ * compare_score - Compare two emails using their scores - Implements ::sort_t
*/
static int compare_score(const void *a, const void *b)
{
}
/**
- * compare_size - Compare the size of two emails
- * @param a First email
- * @param b Second email
- * @retval -1 a precedes b
- * @retval 0 a and b are identical
- * @retval 1 b precedes a
+ * compare_size - Compare the size of two emails - Implements ::sort_t
*/
static int compare_size(const void *a, const void *b)
{
}
/**
- * compare_date_sent - Compare the sent date of two emails
- * @param a First email
- * @param b Second email
- * @retval -1 a precedes b
- * @retval 0 a and b are identical
- * @retval 1 b precedes a
+ * compare_date_sent - Compare the sent date of two emails - Implements ::sort_t
*/
static int compare_date_sent(const void *a, const void *b)
{
}
/**
- * compare_subject - Compare the subject of two emails
- * @param a First email
- * @param b Second email
- * @retval -1 a precedes b
- * @retval 0 a and b are identical
- * @retval 1 b precedes a
+ * compare_subject - Compare the subject of two emails - Implements ::sort_t
*/
static int compare_subject(const void *a, const void *b)
{
}
/**
- * compare_to - Compare the 'to' fields of two emails
- * @param a First email
- * @param b Second email
- * @retval -1 a precedes b
- * @retval 0 a and b are identical
- * @retval 1 b precedes a
+ * compare_to - Compare the 'to' fields of two emails - Implements ::sort_t
*/
static int compare_to(const void *a, const void *b)
{
}
/**
- * compare_from - Compare the 'from' fields of two emails
- * @param a First email
- * @param b Second email
- * @retval -1 a precedes b
- * @retval 0 a and b are identical
- * @retval 1 b precedes a
+ * compare_from - Compare the 'from' fields of two emails - Implements ::sort_t
*/
static int compare_from(const void *a, const void *b)
{
}
/**
- * compare_date_received - Compare the date received of two emails
- * @param a First email
- * @param b Second email
- * @retval -1 a precedes b
- * @retval 0 a and b are identical
- * @retval 1 b precedes a
+ * compare_date_received - Compare the date received of two emails - Implements ::sort_t
*/
static int compare_date_received(const void *a, const void *b)
{
}
/**
- * compare_order - Restore the 'unsorted' order of emails
- * @param a First email
- * @param b Second email
- * @retval -1 a precedes b
- * @retval 0 a and b are identical
- * @retval 1 b precedes a
+ * compare_order - Restore the 'unsorted' order of emails - Implements ::sort_t
*/
static int compare_order(const void *a, const void *b)
{
}
/**
- * compare_spam - Compare the spam values of two emails
- * @param a First email
- * @param b Second email
- * @retval -1 a precedes b
- * @retval 0 a and b are identical
- * @retval 1 b precedes a
+ * compare_spam - Compare the spam values of two emails - Implements ::sort_t
*/
static int compare_spam(const void *a, const void *b)
{
}
/**
- * compare_label - Compare the labels of two emails
- * @param a First email
- * @param b Second email
- * @retval -1 a precedes b
- * @retval 0 a and b are identical
- * @retval 1 b precedes a
+ * compare_label - Compare the labels of two emails - Implements ::sort_t
*/
static int compare_label(const void *a, const void *b)
{
/**
* mutt_get_sort_func - Get the sort function for a given sort id
* @param method Sort id, e.g. #SORT_DATE
- * @retval ptr qsort-compatible sort function
+ * @retval ptr sort function - Implements ::sort_t
*/
sort_t *mutt_get_sort_func(int method)
{
#define SORTCODE(x) (Sort & SORT_REVERSE) ? -(x) : x
+/**
+ * sort_t - Prototype for a function to compare two emails
+ * @param a First email
+ * @param b Second email
+ * @retval -1 a precedes b
+ * @retval 0 a and b are identical
+ * @retval 1 b precedes a
+ */
typedef int sort_t(const void *a, const void *b);
+
sort_t *mutt_get_sort_func(int method);
void mutt_sort_headers(struct Context *ctx, int init);