- Rework OpenSSL certificate verification to support alternative chains. (closes #3903)
- Add option to control whether threads uncollapse when new mail arrives.
- In the manual, replaced 2 para by example (similar to the first example).
- - Create mbchar_table type for multibyte character arrays. (see #3024)
+ - Create MbTable type for multibyte character arrays. (see #3024)
- Make to_chars and status_chars accept mulitibyte characters. (closes #3024)
2016-11-26 Richard Russon <rich@flatcap.org>
curs_lib.c curs_main.c edit.c editmsg.c enter.c enter_state.h \
envelope.c envelope.h filter.c flags.c format_flags.h from.c getdomain.c group.c \
handler.c hdrline.c header.h headers.c help.c history.c hook.c \
- init.c keymap.c list.h main.c mbox.c mbyte.c mbyte_table.h \
+ init.c keymap.c list.h main.c mbox.c mbyte.c mbtable.h \
menu.c mh.c muttlib.c mutt_idna.c mutt_sasl_plain.c mutt_socket.c \
mutt_tunnel.c mx.c newsrc.c nntp.c options.h pager.c parameter.c parameter.h \
parse.c pattern.c pattern.h pop.c pop_auth.c pop_lib.c postpone.c \
test_config_type("mask", "!^\\\\.[^.]", ".*")
end)
- it('works with DT_MBCHARTBL', function()
+ it('works with DT_MBTABLE', function()
test_config_type("to_chars", "+TCFL", "+T")
end)
WHERE char *ForwardAttrTrailer;
WHERE char *ForwFmt;
WHERE char *Fqdn;
-WHERE struct MbCharTable *FromChars;
+WHERE struct MbTable *FromChars;
WHERE char *HdrFmt;
WHERE char *HistFile;
WHERE char *HomeDir;
WHERE char *SslCACertFile;
#endif
#endif
-WHERE struct MbCharTable *StChars;
+WHERE struct MbTable *StChars;
WHERE char *Status;
WHERE char *TempDir;
-WHERE struct MbCharTable *ToChars;
-WHERE struct MbCharTable *FlagChars;
+WHERE struct MbTable *ToChars;
+WHERE struct MbTable *FlagChars;
WHERE char *TrashPath;
WHERE char *TSStatusFormat;
WHERE char *TSIconFormat;
#include "globals.h"
#include "header.h"
#include "lib/lib.h"
-#include "mbyte_table.h"
+#include "mbtable.h"
#include "mutt_curses.h"
#include "mutt_idna.h"
#include "ncrypt/ncrypt.h"
* If the index is invalid, then a space character will be returned.
* If the character selected is '\n' (Ctrl-M), then "" will be returned.
*/
-static char *get_nth_wchar(struct MbCharTable *table, int index)
+static char *get_nth_wchar(struct MbTable *table, int index)
{
if (!table || !table->chars || (index < 0) || (index >= table->len))
return " ";
#include "list.h"
#include "mailbox.h"
#include "mbyte.h"
-#include "mbyte_table.h"
+#include "mbtable.h"
#include "mutt.h"
#include "mutt_curses.h"
#include "mutt_idna.h"
}
#endif
-static void free_mbchar_table(struct MbCharTable **t)
+static void free_mbtable(struct MbTable **t)
{
if (!t || !*t)
return;
FREE(t);
}
-static struct MbCharTable *parse_mbchar_table(const char *s)
+static struct MbTable *parse_mbtable(const char *s)
{
- struct MbCharTable *t = NULL;
+ struct MbTable *t = NULL;
size_t slen, k;
mbstate_t mbstate;
char *d = NULL;
- t = safe_calloc(1, sizeof(struct MbCharTable));
+ t = safe_calloc(1, sizeof(struct MbTable));
slen = mutt_strlen(s);
if (!slen)
return t;
if (k == (size_t)(-1) || k == (size_t)(-2))
{
mutt_debug(
- 1, "parse_mbchar_table: mbrtowc returned %d converting %s in %s\n",
+ 1, "parse_mbtable: mbrtowc returned %d converting %s in %s\n",
(k == (size_t)(-1)) ? -1 : -2, s, t->orig_str);
if (k == (size_t)(-1))
memset(&mbstate, 0, sizeof(mbstate));
break;
case DT_MBTABLE:
{
- struct MbCharTable **tbl = (struct MbCharTable **) MuttVars[idx].data;
- free_mbchar_table(tbl);
- *tbl = parse_mbchar_table((const char *) val->data);
+ struct MbTable **tbl = (struct MbTable **) MuttVars[idx].data;
+ free_mbtable(tbl);
+ *tbl = parse_mbtable((const char *) val->data);
}
break;
case DT_ADDRESS:
mutt_str_replace((char **) p->data, (char *) p->init);
break;
case DT_MBTABLE:
- free_mbchar_table((struct MbCharTable **) p->data);
- *((struct MbCharTable **) p->data) = parse_mbchar_table((char *) p->init);
+ free_mbtable((struct MbTable **) p->data);
+ *((struct MbTable **) p->data) = parse_mbtable((char *) p->init);
break;
case DT_PATH:
FREE((char **) p->data);
else if (DTYPE(MuttVars[idx].type) == DT_ADDRESS)
rfc822_free_address((struct Address **) MuttVars[idx].data);
else if (DTYPE(MuttVars[idx].type) == DT_MBTABLE)
- free_mbchar_table((struct MbCharTable **) MuttVars[idx].data);
+ free_mbtable((struct MbTable **) MuttVars[idx].data);
else
/* MuttVars[idx].data is already 'char**' (or some 'void**') or...
* so cast to 'void*' is okay */
}
else if (DTYPE(MuttVars[idx].type) == DT_MBTABLE)
{
- struct MbCharTable *mbt = (*((struct MbCharTable **) MuttVars[idx].data));
+ struct MbTable *mbt = (*((struct MbTable **) MuttVars[idx].data));
val = mbt ? NONULL(mbt->orig_str) : "";
}
else
}
else if (DTYPE(MuttVars[idx].type) == DT_MBTABLE)
{
- free_mbchar_table((struct MbCharTable **) MuttVars[idx].data);
- *((struct MbCharTable **) MuttVars[idx].data) = parse_mbchar_table(tmp->data);
+ free_mbtable((struct MbTable **) MuttVars[idx].data);
+ *((struct MbTable **) MuttVars[idx].data) = parse_mbtable(tmp->data);
}
else
{
}
else if (DTYPE(MuttVars[idx].type) == DT_MBTABLE)
{
- struct MbCharTable *mbt = (*((struct MbCharTable **) MuttVars[idx].data));
+ struct MbTable *mbt = (*((struct MbTable **) MuttVars[idx].data));
strfcpy(tmp, mbt ? NONULL(mbt->orig_str) : "", sizeof(tmp));
}
else if (DTYPE(MuttVars[idx].type) == DT_ADDRESS)
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _MUTT_MBYTE_TABLE_H
-#define _MUTT_MBYTE_TABLE_H
+#ifndef _MUTT_MBTABLE_H
+#define _MUTT_MBTABLE_H
/**
- * struct MbCharTable - multibyte character table
+ * struct MbTable - multibyte character table
*
* Allows for direct access to the individual multibyte characters in a
* string. This is used for the FlagChars, FromChars, StChars and ToChars
* option types.
*/
-struct MbCharTable
+struct MbTable
{
int len; /**< number of characters */
char **chars; /**< the array of multibyte character strings */
char *orig_str;
};
-#endif /* _MUTT_MBYTE_TABLE_H */
+#endif /* _MUTT_MBTABLE_H */
#include "globals.h"
#include "lib/lib.h"
#include "mailbox.h"
-#include "mbyte_table.h"
+#include "mbtable.h"
#include "mutt_commands.h"
#include "mutt_options.h"
#include "options.h"
}
case DT_MBTABLE:
{
- struct MbCharTable *tbl = *(struct MbCharTable **) opt.data;
+ struct MbTable *tbl = *(struct MbTable **) opt.data;
lua_pushstring(l, tbl->orig_str);
return 1;
}
#include "format_flags.h"
#include "globals.h"
#include "lib/lib.h"
-#include "mbyte_table.h"
+#include "mbtable.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "mx.h"