github.com/aergoio/aergo@v1.3.1/contract/lgmp.h (about)

     1  #ifndef _LGMP_H_
     2  #define _LGMP_H_
     3  #include "gmp.h"
     4  
     5  typedef struct bn_struct *mp_num;
     6  
     7  typedef struct bn_struct
     8  {
     9  	int type;
    10  	void *mpptr;
    11  } bn_struct;
    12  
    13  #define MYNAME		"bignum"
    14  #define MYVERSION	MYNAME " library for " LUA_VERSION " / Apr 2010 / "\
    15  			"based on GNU bc-1.06"
    16  #define MYTYPE		MYNAME " bignumber"
    17  #define MPZ_BASE 10
    18  
    19  enum bn_type {
    20  	BN_Integer = 0,
    21  	BN_Float
    22  };
    23  
    24  int luaopen_gmp(lua_State *L);
    25  const char *lua_set_bignum(lua_State *L, char *s);
    26  mp_num Bgetbnum(lua_State *L, int i);
    27  int lua_isbignumber(lua_State *L, int i);
    28  char *lua_get_bignum_str(lua_State *L, int idx);
    29  long int lua_get_bignum_si(lua_State *L, int idx);
    30  int lua_bignum_is_zero(lua_State *L, int idx);
    31  const char *init_bignum();
    32  #endif /*_LGMP_H_*/