annotate src/libinterface.h @ 5602:c9e5612f5424

Support the MP library on recent FreeBSD, have it pass relevant tests. src/ChangeLog addition: 2011-11-26 Aidan Kehoe <kehoea@parhasard.net> * number-mp.c (bignum_to_string): Don't overwrite the accumulator we've just set up for this function. * number-mp.c (BIGNUM_TO_TYPE): mp_itom() doesn't necessarily do what this code used to think with negative numbers, it can treat them as unsigned ints. Subtract numbers from bignum_zero instead of multiplying them by -1 to convert them to their negative equivalents. * number-mp.c (bignum_to_int): * number-mp.c (bignum_to_uint): * number-mp.c (bignum_to_long): * number-mp.c (bignum_to_ulong): * number-mp.c (bignum_to_double): Use the changed BIGNUM_TO_TYPE() in these functions. * number-mp.c (bignum_ceil): * number-mp.c (bignum_floor): In these functions, be more careful about rounding to positive and negative infinity, respectively. Don't use the sign of QUOTIENT when working out out whether to add or subtract one, rather use the sign QUOTIENT would have if arbitrary-precision division were done. * number-mp.h: * number-mp.h (MP_GCD): Wrap #include <mp.h> in BEGIN_C_DECLS/END_C_DECLS. * number.c (Fbigfloat_get_precision): * number.c (Fbigfloat_set_precision): Don't attempt to call XBIGFLOAT_GET_PREC if this build doesn't support big floats.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 26 Nov 2011 17:59:14 +0000
parents 308d34e9f07d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
870
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
1 /* Define prototypes for graphics library interface functions.
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
2 Copyright (C) 2002 Ben Wing.
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
3
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
4 This file is part of XEmacs.
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
5
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4708
diff changeset
6 XEmacs is free software: you can redistribute it and/or modify it
870
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4708
diff changeset
8 Free Software Foundation, either version 3 of the License, or (at your
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4708
diff changeset
9 option) any later version.
870
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
10
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
14 for more details.
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
15
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4708
diff changeset
17 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */
870
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
18
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
19 /* Synched up with: Not in FSF. */
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
20
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
21 #ifndef INCLUDED_libinterface_h_
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
22 #define INCLUDED_libinterface_h_
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
23
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
24 #ifdef HAVE_GIF
4708
1cecc3e9f0a0 Use giflib or libungif to provide GIF support, instead of using internal
Jerry James <james@xemacs.org>
parents: 1743
diff changeset
25 #include <gif_lib.h>
870
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
26 #endif /* HAVE_GIF */
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
27
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
28 #ifdef HAVE_PNG
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents: 870
diff changeset
29 BEGIN_C_DECLS
870
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
30 #define message message_ /* Yuck */
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
31 /* See comment in libinterface.c for the following */
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
32 #define PNG_EXPORT(type, symbol) type XCDECL symbol
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
33 #define ZEXPORT XCDECL
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
34 #define ZEXPORTVA XCDECL
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
35 #include <png.h>
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
36 #undef message
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents: 870
diff changeset
37 END_C_DECLS
870
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
38 #endif /* HAVE_PNG */
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
39
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
40 /* #### WARNING: Utterly random magic here to prevent namespace conflicts
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
41 when no one bothers to be the least bit namespace-clean. Potential
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
42 problems: INT32, FAR. DONT_NEED_JPEG avoids the problem with FAR in
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
43 glyphs-msw.c. For some reason, putting the XPM code after this fixes
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
44 other problems; don't move it before. --ben */
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
45 #if defined (HAVE_JPEG) && !defined (DONT_NEED_JPEG)
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents: 870
diff changeset
46 BEGIN_C_DECLS
870
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
47 #ifdef _MSC_VER
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
48 # ifndef XMD_H
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
49 /* Yuck! This tricks jpeglib.h into not defining INT32, which is defined
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
50 in VC98/INCLUDE/basetsd.h */
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
51 # define UNDEF_XMD_H_ME_HARDER
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
52 # define XMD_H
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
53 # endif
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
54 #endif /* _MSC_VER */
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
55 #include <jpeglib.h>
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
56 #ifdef UNDEF_XMD_H_ME_HARDER
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
57 # undef XMD_H
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
58 #endif
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
59 #include <jerror.h>
1743
543769b89fed [xemacs-hg @ 2003-10-14 05:02:57 by james]
james
parents: 870
diff changeset
60 END_C_DECLS
870
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
61
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
62 boolean XCDECL qxe_jpeg_finish_decompress (j_decompress_ptr cinfo);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
63 boolean XCDECL qxe_jpeg_start_decompress (j_decompress_ptr cinfo);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
64 JDIMENSION XCDECL qxe_jpeg_read_scanlines (j_decompress_ptr cinfo,
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
65 JSAMPARRAY scanlines,
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
66 JDIMENSION max_lines);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
67 int XCDECL qxe_jpeg_read_header (j_decompress_ptr cinfo, boolean require_image);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
68 #define qxe_jpeg_create_decompress(cinfo) \
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
69 qxe_jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
70 (size_t) sizeof(struct jpeg_decompress_struct))
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
71 void XCDECL qxe_jpeg_CreateDecompress (j_decompress_ptr cinfo, int version,
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
72 size_t structsize);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
73 struct jpeg_error_mgr * XCDECL qxe_jpeg_std_error (struct jpeg_error_mgr *err);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
74 void XCDECL qxe_jpeg_destroy_decompress (j_decompress_ptr cinfo);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
75 boolean XCDECL qxe_jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
76
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
77 #endif /* defined (HAVE_JPEG) && !defined (DONT_NEED_JPEG) */
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
78
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
79 #ifdef HAVE_XPM
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
80
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
81 #ifndef HAVE_GTK /* #### ????????????????????? No comprendo ni un poco.
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
82 This was here before, in a different file. --ben */
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
83 #include <X11/xpm.h>
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
84 #endif
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
85
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
86 void XCDECL qxe_XpmFreeXpmImage (XpmImage *image);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
87 void XCDECL qxe_XpmFreeXpmInfo (XpmInfo *info);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
88 int XCDECL qxe_XpmCreateXpmImageFromBuffer (char *buffer, XpmImage *image,
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
89 XpmInfo *info);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
90 void XCDECL qxe_XpmFree (void *ptr);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
91 int XCDECL qxe_XpmReadFileToData (char *filename, char ***data_return);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
92
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
93 #endif /* HAVE_XPM */
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
94
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
95 #ifdef HAVE_TIFF
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
96 #include "tiffio.h"
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
97
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
98 tdata_t XCDECL qxe_TIFFmalloc (tsize_t x1);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
99 void XCDECL qxe_TIFFfree (tdata_t x1);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
100 void XCDECL qxe_TIFFClose (TIFF *x1);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
101 int XCDECL qxe_TIFFGetField (TIFF *x1, ttag_t x2, uint32 *x3);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
102 TIFF * XCDECL qxe_TIFFClientOpen (const char *x1, const char *x2,
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
103 thandle_t x3, TIFFReadWriteProc x4,
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
104 TIFFReadWriteProc x5, TIFFSeekProc x6,
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
105 TIFFCloseProc x7, TIFFSizeProc x8,
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
106 TIFFMapFileProc x9, TIFFUnmapFileProc x10);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
107 TIFFErrorHandler XCDECL qxe_TIFFSetErrorHandler (TIFFErrorHandler x1);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
108 TIFFErrorHandler XCDECL qxe_TIFFSetWarningHandler (TIFFErrorHandler x1);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
109 int XCDECL qxe_TIFFReadRGBAImage (TIFF *x1, uint32 x2, uint32 x3, uint32 *x4,
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
110 int x5);
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
111
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
112 #endif /* HAVE_TIFF */
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
113
26a2f3423141 [xemacs-hg @ 2002-06-10 12:43:41 by ben]
ben
parents:
diff changeset
114 #endif /* INCLUDED_libinterface_h_ */