1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
78
  
/* -*- 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. 
*/ 
 
/* vim:syntax=c 
 */ 
#ifdef PIKE_DEBUG 
#define DEBUG_CHECKS 
#endif 
#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 
 
#cmod_undef DOCSTART 
#cmod_define DOCSTART() cmod___SLASH__* 
 
PIKECLASS BigNumTree { 
#cmod_define iterator_class Iterator 
#cmod_define tree_class BigNumTree 
#cmod_define cmod_OBJ2_TREE OBJ2_BIGNUMTREE 
#cmod_define T_KEY BIT_OBJECT 
#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 
}