put old m_snsubst into file.c as m_file_fmt.
implement m_temp{fd,file} functions to replace mutt_(adv_)mktemp, that
work like that:
m_tempFOO(dst, dstlen, tmpdir, fmt).
it returns either a fd or a FILE* (check it's properly >= 0 or !NULL !!!)
and put the chose name in the buffer dst of size dstlen.
tmpdir is the directory where to create files.
fmp is a file format, where we strip any directory part, then use the
remains like that:
- if there is a %s specifier, fmt is used as a simple file format
specifier, and %s is substituted with a temporary file name.
- if there is no %s specifier, fmt is supposed to be a file name we
want to take as model, meaning we just want to copy its extension.
So if you pass "foo.jpg" as a fmt, the resulting file name will end
in .jpg
mark mutt_(adv_)?mktemp functions as obsolete, and currently
reimplement them with m_temp* functions as a proof of concept.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>