-/* compare two option_t*'s for sorting -t/-T output */
-static int opt_cmp (const void* a, const void* b) {
- return (str_cmp ((*(struct option_t**) a)->option,
- (*(struct option_t**) b)->option));
-}
-
-/* callback for hash_map() to put all non-synonym vars into list */
-static void opt_sel_full (const char* key, void* data,
- unsigned long more) {
- list2_t** l = (list2_t**) more;
- struct option_t* option = (struct option_t*) data;
-
- if (DTYPE (option->type) == DT_SYN)
- return;
- list_push_back (l, option);
-}
-
-/* callback for hash_map() to put all changed non-synonym vars into list */
-static void opt_sel_diff (const char* key, void* data,
- unsigned long more) {
- list2_t** l = (list2_t**) more;
- struct option_t* option = (struct option_t*) data;
- char buf[LONG_STRING];
-
- if (DTYPE (option->type) == DT_SYN)
- return;
-
- mutt_option_value (option->option, buf, sizeof (buf));
- if (str_cmp (buf, option->init) != 0)
- list_push_back (l, option);
-}
-
-/* dump out the value of all the variables we have */
-int mutt_dump_variables (int full) {
- int i = 0;
- char outbuf[STRING];
- list2_t* tmp = NULL;
- struct option_t* option = NULL;
-
- /* get all non-synonyms into list... */
- hash_map (ConfigOptions, full ? opt_sel_full : opt_sel_diff,
- (unsigned long) &tmp);
-
- if (!list_empty(tmp)) {
- /* ...and dump list sorted */
- qsort (tmp->data, tmp->length, sizeof (void*), opt_cmp);
- for (i = 0; i < tmp->length; i++) {
- option = (struct option_t*) tmp->data[i];
- FuncTable[DTYPE (option->type)].opt_to_string
- (outbuf, sizeof (outbuf), option);
- printf ("%s\n", outbuf);
- }
- }
- list_del (&tmp, NULL);
- return 0;
-}