3c99b42015-10-14Martin Nilsson /* -*- c -*- || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. */
a871e72012-10-28Arne Goedeke /* vim:syntax=c */
61017f2014-02-25Per Hedbor #ifdef PIKE_DEBUG
a871e72012-10-28Arne Goedeke #define DEBUG_CHECKS
61017f2014-02-25Per Hedbor #endif
a871e72012-10-28Arne Goedeke #include "common.h" #include "critbit/bignum2svalue.h" static inline void CB_PRINT_KEY(struct string_builder *buf, cb_key key) { struct svalue s; SET_SVAL(s, PIKE_T_OBJECT, 0, object, key.str); string_builder_sprintf(buf, "%O", &s); } #define CB_LOW_ASSIGN_SVALUE_KEY(key, s) do { \ struct svalue * __ = (s); \ SET_SVAL(*__, PIKE_T_OBJECT, 0, object, (key).str); \ add_ref((key).str); \ } while(0) #define CB_PUSH_KEY(key) ref_push_object((key).str); #define CB_STRING_FROM_SVALUE(v) ((v)->u.object) #define CB_LOW_KEY_FROM_SVALUE(x) CB_KEY_FROM_STRING(CB_STRING_FROM_SVALUE(x)) #include "tree_high.c" #define DEFAULT_CMOD_STORAGE static DECLARATIONS
ea1eb92013-11-01Tobias S. Josefowitz #cmod_undef DOCSTART #cmod_define DOCSTART() cmod___SLASH__*
a871e72012-10-28Arne Goedeke  PIKECLASS BigNumTree { #cmod_define iterator_class Iterator #cmod_define tree_class BigNumTree #cmod_define cmod_OBJ2_TREE OBJ2_BIGNUMTREE
79d5f62013-06-16Arne Goedeke #cmod_define T_KEY BIT_OBJECT
a871e72012-10-28Arne Goedeke #cmod_define key_ptype bignum #cmod_define sval_type object /* #cmod_define sample_key 12 #cmod_define sample_keys ({ 1025, 15000, 3 }) #cmod_define ordered_keys 3, 1025 and 15000 #cmod_define reverse_ordered_keys 15000, 1025 and 3 #cmod_define sample_value ({ 1, 2 ,3 }) #cmod_define extra_doc */ #cmod_include "redefine.H" #cmod_include "tree_header.H" #cmod_include "iterator_source.H" #undef THIS #define THIS THIS_BIGNUMTREE #cmod_include "tree_source.H" } PIKEFUN int(0..1) is_bignum(bignum i) { if (TYPEOF(*i) == PIKE_T_INT) { RETURN 0; } else { RETURN 1; } } void pike_init_bignumtree_module(void) { INIT } void pike_exit_bignumtree_module(void) { EXIT }