/ src / gmpy2_binary.h
gmpy2_binary.h
 1  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 2   * gmpy2_binary.c                                                          *
 3   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 4   * Python interface to the GMP or MPIR, MPFR, and MPC multiple precision   *
 5   * libraries.                                                              *
 6   *                                                                         *
 7   * Copyright 2000 - 2009 Alex Martelli                                     *
 8   *                                                                         *
 9   * Copyright 2008 - 2021 Case Van Horsen                                   *
10   *                                                                         *
11   * This file is part of GMPY2.                                             *
12   *                                                                         *
13   * GMPY2 is free software: you can redistribute it and/or modify it under  *
14   * the terms of the GNU Lesser General Public License as published by the  *
15   * Free Software Foundation, either version 3 of the License, or (at your  *
16   * option) any later version.                                              *
17   *                                                                         *
18   * GMPY2 is distributed in the hope that it will be useful, but WITHOUT    *
19   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or   *
20   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public    *
21   * License for more details.                                               *
22   *                                                                         *
23   * You should have received a copy of the GNU Lesser General Public        *
24   * License along with GMPY2; if not, see <http://www.gnu.org/licenses/>    *
25   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
26  
27  #ifndef GMPY_BINARY_H
28  #define GMPY_BINARY_H
29  
30  #ifdef __cplusplus
31  extern "C" {
32  #endif
33  
34  /* Conversion routines between GMPY2 objects and a compact, portable
35   * binary representation. The binary format of GMPY2 is not compatible
36   * with GMPY 1.x. Methods to read the old format are provided.
37   */
38  
39  static PyObject * GMPy_MPZ_From_Old_Binary(PyObject *self, PyObject *other);
40  static PyObject * GMPy_MPQ_From_Old_Binary(PyObject *self, PyObject *other);
41  static PyObject * GMPy_MPFR_From_Old_Binary(PyObject *self, PyObject *other);
42  
43  static PyObject * GMPy_MPANY_From_Binary(PyObject *self, PyObject *other);
44  static PyObject * GMPy_MPANY_To_Binary(PyObject *self, PyObject *other);
45  
46  static PyObject * GMPy_MPZ_To_Binary(MPZ_Object *self);
47  static PyObject * GMPy_XMPZ_To_Binary(XMPZ_Object *self);
48  static PyObject * GMPy_MPQ_To_Binary(MPQ_Object *self);
49  static PyObject * GMPy_MPFR_To_Binary(MPFR_Object *self);
50  static PyObject * GMPy_MPC_To_Binary(MPC_Object *self);
51  
52  #ifdef __cplusplus
53  }
54  #endif
55  #endif