summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/lua/mplibstuff.c
blob: f4845c0a4f428b5b6900df7aa0ce40cde877c1d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*

mplibstuff.w

Copyright 2021 LuaTeX team <bugs@@luatex.org>

This file is part of LuaTeX.

LuaTeX is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version.

LuaTeX is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
License for more details.

You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>.

*/

/*tex

The \PNG\ and \SVG\ backends are not available in \LUATEX, because it's complex
to manage the math formulas at run time. In this respect \POSTSCRIPT\ and the
highlevel |objects| are better, and they are the standard way. Another problem is
how to emit the warning: the |normal_warning| function is not available when
\LUATEX\ is called as \LUA\ only.

*/

#include <stdio.h>

extern void normal_warning(const char *t, const char *p);

extern int lua_only;

#define mplibstuff_message(MSG) do { \
    if (lua_only) { \
        fprintf(stdout,"mplib: " #MSG " not available.\n"); \
    } else { \
        normal_warning("mplib",  #MSG " not available."); \
    } \
} while (0)

void mp_png_backend_initialize (void *mp);
void mp_png_backend_free (void *mp);
int mp_png_gr_ship_out (void *hh, void *options, int standalone);
int mp_png_ship_out (void *hh, const char *options);

void mp_svg_backend_initialize (void *mp);
void mp_svg_backend_free (void *mp);
int mp_svg_ship_out (void *hh, int prologues);
int mp_svg_gr_ship_out (void *hh, int qprologues, int standalone);

void *mp_initialize_binary_math(void *mp);


void mp_png_backend_initialize (void *mp)                         { return; }
void mp_png_backend_free (void *mp)                               { return; }
int mp_png_gr_ship_out (void *hh, void *options, int standalone)  { mplibstuff_message(png backend); return 1; }
int mp_png_ship_out (void *hh, const char *options)               { mplibstuff_message(png backend); return 1; }

void mp_svg_backend_initialize (void *mp)                         { return; }
void mp_svg_backend_free (void *mp)                               { return; }
int mp_svg_ship_out (void *hh, int prologues)                     { mplibstuff_message(svg bakend); return 1; }
int mp_svg_gr_ship_out (void *hh, int qprologues, int standalone) { mplibstuff_message(svg backend); return 1; }


void *mp_initialize_binary_math(void *mp)                         {mplibstuff_message(math binary);return NULL; }

const char* cairo_version_string (void);
const char* mpfr_get_version(void);
const char* pixman_version_string (void);


#define CAIRO_VERSION_STRING "CAIRO NOT AVAILABLE"
const char *COMPILED_CAIRO_VERSION_STRING = CAIRO_VERSION_STRING;

#define MPFR_VERSION_STRING "MPFR NOT AVAILABLE"
const char *COMPILED_MPFR_VERSION_STRING = MPFR_VERSION_STRING;


#define __GNU_MP_VERSION -1
#define __GNU_MP_VERSION_MINOR -1
#define __GNU_MP_VERSION_PATCHLEVEL -1 
int COMPILED__GNU_MP_VERSION = __GNU_MP_VERSION ;
int COMPILED__GNU_MP_VERSION_MINOR = __GNU_MP_VERSION_MINOR ;
int COMPILED__GNU_MP_VERSION_PATCHLEVEL = __GNU_MP_VERSION_PATCHLEVEL ;
const char * const COMPILED_gmp_version="GMP NOT AVAILABLE";

#define PIXMAN_VERSION_STRING "PIXMAN NOT AVAILABLE"
const char *COMPILED_PIXMAN_VERSION_STRING = PIXMAN_VERSION_STRING;

const char* cairo_version_string (void)
{
    return CAIRO_VERSION_STRING;
}

const char* mpfr_get_version(void)
{
    return MPFR_VERSION_STRING;
}

const char* pixman_version_string (void)
{
    return PIXMAN_VERSION_STRING;
}

char png_libpng_ver[] = "PNG NOT AVAILABLE";