github.com/aergoio/aergo@v1.3.1/libtool/src/gmp-6.1.2/mpz/dump.c (about)

     1  /* mpz_dump - Dump an integer to stdout.
     2  
     3     THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE.  IT IS NOT SAFE TO
     4     CALL THIS FUNCTION DIRECTLY.  IN FACT, IT IS ALMOST GUARANTEED THAT THIS
     5     FUNCTION WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
     6  
     7  
     8  Copyright 1999-2001 Free Software Foundation, Inc.
     9  
    10  This file is part of the GNU MP Library.
    11  
    12  The GNU MP Library is free software; you can redistribute it and/or modify
    13  it under the terms of either:
    14  
    15    * the GNU Lesser General Public License as published by the Free
    16      Software Foundation; either version 3 of the License, or (at your
    17      option) any later version.
    18  
    19  or
    20  
    21    * the GNU General Public License as published by the Free Software
    22      Foundation; either version 2 of the License, or (at your option) any
    23      later version.
    24  
    25  or both in parallel, as here.
    26  
    27  The GNU MP Library is distributed in the hope that it will be useful, but
    28  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    29  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    30  for more details.
    31  
    32  You should have received copies of the GNU General Public License and the
    33  GNU Lesser General Public License along with the GNU MP Library.  If not,
    34  see https://www.gnu.org/licenses/.  */
    35  
    36  #include <stdio.h>
    37  #include <string.h> /* for strlen */
    38  #include "gmp.h"
    39  #include "gmp-impl.h"
    40  
    41  void
    42  mpz_dump (mpz_srcptr u)
    43  {
    44    char *str;
    45  
    46    str = mpz_get_str (0, 10, u);
    47    printf ("%s\n", str);
    48    (*__gmp_free_func) (str, strlen (str) + 1);
    49  }