| 1 |
/* |
| 2 |
|
| 3 |
mplibstuff.w |
| 4 |
|
| 5 |
Copyright 2021 LuaTeX team <bugs@@luatex.org> |
| 6 |
|
| 7 |
This file is part of LuaTeX. |
| 8 |
|
| 9 |
LuaTeX is free software; you can redistribute it and/or modify it under |
| 10 |
the terms of the GNU General Public License as published by the Free |
| 11 |
Software Foundation; either version 2 of the License, or (at your |
| 12 |
option) any later version. |
| 13 |
|
| 14 |
LuaTeX is distributed in the hope that it will be useful, but WITHOUT |
| 15 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 16 |
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
| 17 |
License for more details. |
| 18 |
|
| 19 |
You should have received a copy of the GNU General Public License along |
| 20 |
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. |
| 21 |
|
| 22 |
*/ |
| 23 |
|
| 24 |
/*tex |
| 25 |
|
| 26 |
The \PNG\ and \SVG\ backends are not available in \LUATEX, because it's complex |
| 27 |
to manage the math formulas at run time. In this respect \POSTSCRIPT\ and the |
| 28 |
highlevel |objects| are better, and they are the standard way. Another problem is |
| 29 |
how to emit the warning: the |normal_warning| function is not available when |
| 30 |
\LUATEX\ is called as \LUA\ only. |
| 31 |
|
| 32 |
*/ |
| 33 |
|
| 34 |
#include <stdio.h> |
| 35 |
|
| 36 |
extern void normal_warning(const char *t, const char *p); |
| 37 |
|
| 38 |
extern int lua_only; |
| 39 |
|
| 40 |
#define mplibstuff_message(MSG) do { \ |
| 41 |
if (lua_only) { \ |
| 42 |
fprintf(stdout,"mplib: " #MSG " not available.\n"); \ |
| 43 |
} else { \ |
| 44 |
normal_warning("mplib", #MSG " not available."); \ |
| 45 |
} \ |
| 46 |
} while (0) |
| 47 |
|
| 48 |
void mp_png_backend_initialize (void *mp); |
| 49 |
void mp_png_backend_free (void *mp); |
| 50 |
int mp_png_gr_ship_out (void *hh, void *options, int standalone); |
| 51 |
int mp_png_ship_out (void *hh, const char *options); |
| 52 |
|
| 53 |
void mp_svg_backend_initialize (void *mp); |
| 54 |
void mp_svg_backend_free (void *mp); |
| 55 |
int mp_svg_ship_out (void *hh, int prologues); |
| 56 |
int mp_svg_gr_ship_out (void *hh, int qprologues, int standalone); |
| 57 |
|
| 58 |
void *mp_initialize_interval_math(void *mp); |
| 59 |
void *mp_initialize_binary_math(void *mp); |
| 60 |
|
| 61 |
|
| 62 |
void mp_png_backend_initialize (void *mp) { return; } |
| 63 |
void mp_png_backend_free (void *mp) { return; } |
| 64 |
int mp_png_gr_ship_out (void *hh, void *options, int standalone) { mplibstuff_message(png backend); return 1; } |
| 65 |
int mp_png_ship_out (void *hh, const char *options) { mplibstuff_message(png backend); return 1; } |
| 66 |
|
| 67 |
void mp_svg_backend_initialize (void *mp) { return; } |
| 68 |
void mp_svg_backend_free (void *mp) { return; } |
| 69 |
int mp_svg_ship_out (void *hh, int prologues) { mplibstuff_message(svg bakend); return 1; } |
| 70 |
int mp_svg_gr_ship_out (void *hh, int qprologues, int standalone) { mplibstuff_message(svg backend); return 1; } |
| 71 |
|
| 72 |
|
| 73 |
void *mp_initialize_interval_math(void *mp) {mplibstuff_message(math interval);return NULL; } |
| 74 |
void *mp_initialize_binary_math(void *mp) {mplibstuff_message(math binary);return NULL; } |
| 75 |
|
| 76 |
const char* cairo_version_string (void); |
| 77 |
const char* mpfi_get_version(void); |
| 78 |
const char* mpfr_get_version(void); |
| 79 |
const char* pixman_version_string (void); |
| 80 |
|
| 81 |
|
| 82 |
#define CAIRO_VERSION_STRING "CAIRO NOT AVAILABLE" |
| 83 |
const char *COMPILED_CAIRO_VERSION_STRING = CAIRO_VERSION_STRING; |
| 84 |
|
| 85 |
#define MPFR_VERSION_STRING "MPFR NOT AVAILABLE" |
| 86 |
const char *COMPILED_MPFR_VERSION_STRING = MPFR_VERSION_STRING; |
| 87 |
|
| 88 |
#define MPFI_VERSION_STRING "MPFI NOT AVAILABLE" |
| 89 |
const char *COMPILED_MPFI_VERSION_STRING = MPFI_VERSION_STRING; |
| 90 |
|
| 91 |
|
| 92 |
#define __GNU_MP_VERSION -1 |
| 93 |
#define __GNU_MP_VERSION_MINOR -1 |
| 94 |
#define __GNU_MP_VERSION_PATCHLEVEL -1 |
| 95 |
int COMPILED__GNU_MP_VERSION = __GNU_MP_VERSION ; |
| 96 |
int COMPILED__GNU_MP_VERSION_MINOR = __GNU_MP_VERSION_MINOR ; |
| 97 |
int COMPILED__GNU_MP_VERSION_PATCHLEVEL = __GNU_MP_VERSION_PATCHLEVEL ; |
| 98 |
const char * const COMPILED_gmp_version="GMP NOT AVAILABLE"; |
| 99 |
|
| 100 |
#define PIXMAN_VERSION_STRING "PIXMAN NOT AVAILABLE" |
| 101 |
const char *COMPILED_PIXMAN_VERSION_STRING = PIXMAN_VERSION_STRING; |
| 102 |
|
| 103 |
const char* cairo_version_string (void) |
| 104 |
{ |
| 105 |
return CAIRO_VERSION_STRING; |
| 106 |
} |
| 107 |
|
| 108 |
const char* mpfi_get_version(void) |
| 109 |
{ |
| 110 |
return MPFI_VERSION_STRING; |
| 111 |
} |
| 112 |
|
| 113 |
const char* mpfr_get_version(void) |
| 114 |
{ |
| 115 |
return MPFR_VERSION_STRING; |
| 116 |
} |
| 117 |
|
| 118 |
const char* pixman_version_string (void) |
| 119 |
{ |
| 120 |
return PIXMAN_VERSION_STRING; |
| 121 |
} |
| 122 |
|
| 123 |
char png_libpng_ver[] = "PNG NOT AVAILABLE"; |
| 124 |
|
| 125 |
|
| 126 |
|