Bump S-nail v14.9.16 ("Message of Winter, your hopes shall be crushed"), 2019-12-29
[s-mailx.git] / src / su / cxx-core.cc
blobfd222ec0cf1420092b7627f77f8c45f44b3b9fd6
1 /*@ C++ injection point of most things which need it.
3 * Copyright (c) 2019 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
4 * SPDX-License-Identifier: ISC
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #undef su_FILE
19 #define su_FILE su_cxx_core
20 #define su_SOURCE
22 #include "su/code.h"
23 su_USECASE_MX_DISABLED
25 #include <stdarg.h>
27 #include "su/cs.h"
28 #include "su/utf.h"
30 #include "su/code-in.h"
31 NSPC_USE(su)
33 // code.h
35 STA void
36 log::write(level lvl, char const *fmt, ...){ // XXX unroll
37 va_list va;
38 NYD_IN;
40 va_start(va, fmt);
41 su_log_vwrite(S(enum su_log_level,lvl), fmt, &va);
42 va_end(va);
43 NYD_OU;
46 // cs.h
48 STA type_toolbox<char*> const * const cs::type_toolbox =
49 R(NSPC(su)type_toolbox<char*> const*,&su_cs_toolbox);
50 STA type_toolbox<char const*> const * const cs::const_type_toolbox =
51 R(NSPC(su)type_toolbox<char const*> const*,&su_cs_toolbox);
53 STA type_toolbox<char*> const * const cs::type_toolbox_case =
54 R(NSPC(su)type_toolbox<char*> const*,&su_cs_toolbox_case);
55 STA type_toolbox<char const*> const * const cs::const_type_toolbox_case =
56 R(NSPC(su)type_toolbox<char const*> const*,&su_cs_toolbox_case);
58 // utf.h
60 STA char const utf8::replacer[sizeof su_UTF8_REPLACER] = su_UTF8_REPLACER;
62 #include "su/code-ou.h"
63 /* s-it-mode */