luametatex.c /size: 2553 b    last modification: 2024-01-16 10:22
1/*
2    See license.txt in the root of this project.
3*/
4
5# include "luametatex.h"
6
7/*tex
8
9    The version number can be queried with |\luatexversion| and the revision with with
10    |\luatexrevision|. Traditionally the revision can be any character and \PDFTEX\ occasionally
11    used no digits. Here we still use a character but we will stick to 0 upto 9 so users can expect
12    a number represented as string. Further comments have been moved to the manual.
13
14*/
15
16# ifndef LMT_COMPILER_USED
17    # define LMT_COMPILER_USED "unknown"
18# endif
19
20/*tex
21    It would be nice if we could test if musl is used. Comments in the web indicate that there
22    never be some macro to check for that (argument: it shouldn't matter code/api wise). Well it
23    does matter if you have to make a choice for a binary (set path to a tree), as needed in a
24    TeX distribution that ships a lot. A bit lack of imagination I guess or maybe it's only for
25    people who compile themselves. So if no one cares, I don't either. Maybe CMAKE can help some
26    day.
27*/
28
29// # ifndef LMT_LIBC_USED
30//    # if defined(__GLIBC__)
31//        # define LMT_LIBC_USED "glibc"
32//    # elif defined(__UCLIBC__)
33//        # define LMT_LIBC_USED "uclibc"
34//    # else
35//        # define LMT_LIBC_USED "unknown"
36//    # endif
37// # endif
38
39version_state_info lmt_version_state = {
40    .version           = luametatex_version,
41    .revision          = luametatex_revision,
42    .release           = luametatex_release,
43    .developmentid     = luametatex_development_id,
44    .verbose           = luametatex_version_string,
45    .banner            = "This is " luametatex_name_camelcase ", Version " luametatex_version_string,
46    .compiler          = LMT_COMPILER_USED,
47    .formatid          = luametatex_format_fingerprint,
48    .copyright         = luametatex_copyright_holder,
49    .luaversionmajor   = LUA_VERSION_MAJOR_N,
50    .luaversionminor   = LUA_VERSION_MINOR_N,	
51    .luaversionrelease = LUA_VERSION_RELEASE_N,
52    .luatexversion     = (double) luametatex_version + (double) luametatex_revision / 10,
53    .luaversion        = (double) LUA_VERSION_MAJOR_N + (double) LUA_VERSION_MINOR_N / 10,
54};
55
56int main(int ac, char* *av)
57{
58    /*tex We set up the whole machinery, for instance booting \LUA. */
59    tex_engine_initialize(ac, av);
60    /*tex Kind of special: */
61    aux_set_interrupt_handler();
62    /*tex Now we're ready for the more traditional \TEX\ initializations */
63    tex_main_body();
64    /*tex When we arrive here we had a succesful run. */
65    return EXIT_SUCCESS; /* unreachable */
66}
67