qr_reader-native 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE-mruby.txt +22 -0
- data/LICENSE-spinel.txt +19 -0
- data/LICENSE.txt +21 -0
- data/README.md +61 -0
- data/ext/qr_reader_native/SPINEL_VERSION +1 -0
- data/ext/qr_reader_native/extconf.rb +8 -0
- data/ext/qr_reader_native/mruby/error.h +13 -0
- data/ext/qr_reader_native/mruby/internal.h +145 -0
- data/ext/qr_reader_native/mruby/string.h +22 -0
- data/ext/qr_reader_native/mruby.h +93 -0
- data/ext/qr_reader_native/mruby_shim.h +118 -0
- data/ext/qr_reader_native/qr_reader_native.c +13513 -0
- data/ext/qr_reader_native/qr_reader_native.h +29 -0
- data/ext/qr_reader_native/qr_reader_native_ext.c +598 -0
- data/ext/qr_reader_native/re_cased.h +71 -0
- data/ext/qr_reader_native/re_compile.c +5784 -0
- data/ext/qr_reader_native/re_ctype.h +3540 -0
- data/ext/qr_reader_native/re_exec.c +2190 -0
- data/ext/qr_reader_native/re_internal.h +671 -0
- data/ext/qr_reader_native/re_prop.h +4629 -0
- data/ext/qr_reader_native/re_spinel.c +363 -0
- data/ext/qr_reader_native/re_spinel.h +22 -0
- data/ext/qr_reader_native/re_spinel_utf8.inc +97 -0
- data/ext/qr_reader_native/re_utf8.c +156 -0
- data/ext/qr_reader_native/sp_alloc.c +1447 -0
- data/ext/qr_reader_native/sp_alloc.h +1196 -0
- data/ext/qr_reader_native/sp_argf.h +33 -0
- data/ext/qr_reader_native/sp_array.c +1052 -0
- data/ext/qr_reader_native/sp_array.h +456 -0
- data/ext/qr_reader_native/sp_bigint.c +5826 -0
- data/ext/qr_reader_native/sp_bigint.h +117 -0
- data/ext/qr_reader_native/sp_cold.c +5259 -0
- data/ext/qr_reader_native/sp_compat.h +402 -0
- data/ext/qr_reader_native/sp_core.c +818 -0
- data/ext/qr_reader_native/sp_core.h +56 -0
- data/ext/qr_reader_native/sp_crypto.c +877 -0
- data/ext/qr_reader_native/sp_crypto.h +169 -0
- data/ext/qr_reader_native/sp_dtoa.c +1533 -0
- data/ext/qr_reader_native/sp_dtoa.h +29 -0
- data/ext/qr_reader_native/sp_encoding_names.h +172 -0
- data/ext/qr_reader_native/sp_enum.h +86 -0
- data/ext/qr_reader_native/sp_exc.c +1185 -0
- data/ext/qr_reader_native/sp_exc.h +186 -0
- data/ext/qr_reader_native/sp_exc_ctx.h +56 -0
- data/ext/qr_reader_native/sp_fiber.c +889 -0
- data/ext/qr_reader_native/sp_fiber.h +162 -0
- data/ext/qr_reader_native/sp_fiber_ctx.h +84 -0
- data/ext/qr_reader_native/sp_format.c +695 -0
- data/ext/qr_reader_native/sp_format.h +83 -0
- data/ext/qr_reader_native/sp_gc.c +1793 -0
- data/ext/qr_reader_native/sp_gc.h +762 -0
- data/ext/qr_reader_native/sp_hash.c +131 -0
- data/ext/qr_reader_native/sp_hash.h +131 -0
- data/ext/qr_reader_native/sp_inspect.c +215 -0
- data/ext/qr_reader_native/sp_inspect.h +128 -0
- data/ext/qr_reader_native/sp_io.c +1676 -0
- data/ext/qr_reader_native/sp_io.h +272 -0
- data/ext/qr_reader_native/sp_iobuffer.c +1014 -0
- data/ext/qr_reader_native/sp_iobuffer.h +167 -0
- data/ext/qr_reader_native/sp_marshal.c +487 -0
- data/ext/qr_reader_native/sp_marshal.h +60 -0
- data/ext/qr_reader_native/sp_net.c +1029 -0
- data/ext/qr_reader_native/sp_net.h +205 -0
- data/ext/qr_reader_native/sp_pack.c +1254 -0
- data/ext/qr_reader_native/sp_poly_cold.c +1220 -0
- data/ext/qr_reader_native/sp_proc.c +410 -0
- data/ext/qr_reader_native/sp_proc.h +327 -0
- data/ext/qr_reader_native/sp_process.c +547 -0
- data/ext/qr_reader_native/sp_process_status.c +211 -0
- data/ext/qr_reader_native/sp_process_status.h +66 -0
- data/ext/qr_reader_native/sp_random.c +287 -0
- data/ext/qr_reader_native/sp_random.h +52 -0
- data/ext/qr_reader_native/sp_range.h +144 -0
- data/ext/qr_reader_native/sp_re.c +1379 -0
- data/ext/qr_reader_native/sp_re.h +186 -0
- data/ext/qr_reader_native/sp_re_names.h +59 -0
- data/ext/qr_reader_native/sp_sched.c +4044 -0
- data/ext/qr_reader_native/sp_sched.h +295 -0
- data/ext/qr_reader_native/sp_slab.c +1507 -0
- data/ext/qr_reader_native/sp_str.c +1462 -0
- data/ext/qr_reader_native/sp_str.h +306 -0
- data/ext/qr_reader_native/sp_str_crypt.c +23 -0
- data/ext/qr_reader_native/sp_string.c +92 -0
- data/ext/qr_reader_native/sp_string.h +253 -0
- data/ext/qr_reader_native/sp_system.c +78 -0
- data/ext/qr_reader_native/sp_system.h +18 -0
- data/ext/qr_reader_native/sp_time.c +860 -0
- data/ext/qr_reader_native/sp_time.h +100 -0
- data/ext/qr_reader_native/sp_types.h +292 -0
- data/ext/qr_reader_native/spinel_rt.h +19017 -0
- data/ext/qr_reader_native/unicase.c +399 -0
- data/ext/qr_reader_native/unicase.h +901 -0
- data/lib/qr_reader/native.rb +6 -0
- metadata +153 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#ifndef SP_FORMAT_H
|
|
2
|
+
#define SP_FORMAT_H
|
|
3
|
+
/* sp_format.h -- cold value-type display helpers, split out of spinel_rt.h
|
|
4
|
+
into libspinel_rt.a.
|
|
5
|
+
|
|
6
|
+
Each formats a small value type (Complex / Rational / Range) into a freshly
|
|
7
|
+
GC-allocated string. They need only the shared types (sp_types.h) and the
|
|
8
|
+
shared string allocator (sp_alloc.h), and are only ever reached on a cold
|
|
9
|
+
inspect/to_s path, so they compile once in the archive instead of being
|
|
10
|
+
re-parsed and re-codegen'd in every generated translation unit. */
|
|
11
|
+
#include "sp_types.h" /* sp_Complex, sp_Rational, sp_Range */
|
|
12
|
+
#include "sp_time.h" /* sp_Time */
|
|
13
|
+
#include "sp_gc.h" /* sp_RbVal, for the boxed Complex#abs/abs2 wrappers below */
|
|
14
|
+
|
|
15
|
+
const char *sp_complex_inspect(sp_Complex c);
|
|
16
|
+
const char *sp_complex_to_s(sp_Complex c);
|
|
17
|
+
const char *sp_rational_inspect(sp_Rational r);
|
|
18
|
+
const char *sp_rational_to_s(sp_Rational r);
|
|
19
|
+
const char *sp_Range_inspect(sp_Range *r);
|
|
20
|
+
const char *sp_Time_inspect(sp_Time *t);
|
|
21
|
+
const char *sp_Time_to_s(sp_Time *t);
|
|
22
|
+
|
|
23
|
+
/* Value-type arithmetic (cold: only reached when a program actually uses
|
|
24
|
+
Complex / Rational; optcarrot touches Complex only under --nestopia-palette).
|
|
25
|
+
Emitted by codegen via the sp_complex_%s / sp_rational_%s operator dispatch. */
|
|
26
|
+
sp_Complex sp_complex_polar(sp_float m, sp_float a, int m_is_f);
|
|
27
|
+
sp_Complex sp_complex_add(sp_Complex a, sp_Complex b);
|
|
28
|
+
sp_Complex sp_complex_sub(sp_Complex a, sp_Complex b);
|
|
29
|
+
sp_Complex sp_complex_mul(sp_Complex a, sp_Complex b);
|
|
30
|
+
sp_Complex sp_complex_div(sp_Complex a, sp_Complex b);
|
|
31
|
+
sp_Complex sp_complex_div_real(sp_Complex a, sp_float b);
|
|
32
|
+
sp_Complex sp_complex_div_int(sp_Complex a, sp_int b);
|
|
33
|
+
sp_Complex sp_complex_neg(sp_Complex a);
|
|
34
|
+
sp_Complex sp_complex_conjugate(sp_Complex a);
|
|
35
|
+
sp_Complex sp_complex_pow(sp_Complex a, sp_int e);
|
|
36
|
+
sp_Complex sp_complex_pow_c(sp_Complex z, sp_Complex w); /* z ** w (general) */
|
|
37
|
+
sp_Complex sp_complex_pow_rational(sp_Complex z, sp_Rational w); /* z ** Rational (#2962) */
|
|
38
|
+
sp_float sp_complex_abs(sp_Complex a);
|
|
39
|
+
sp_float sp_complex_abs2(sp_Complex a);
|
|
40
|
+
sp_bool sp_complex_eq(sp_Complex a, sp_Complex b);
|
|
41
|
+
|
|
42
|
+
sp_Rational sp_rational_new(sp_int n, sp_int d);
|
|
43
|
+
sp_Rational sp_rational_new_i64(int64_t n, int64_t d); /* reduced before it is narrowed to sp_int: Time#to_r on a 32-bit sp_int */
|
|
44
|
+
sp_Rational sp_str_to_r(const char *s);
|
|
45
|
+
sp_Rational sp_str_to_r_strict(const char *s); /* Kernel#Rational(String) */
|
|
46
|
+
/* Kernel's `exception: false`: while set, an unparseable string sets
|
|
47
|
+
sp_convert_failed instead of raising (defined in lib/sp_cold.c). */
|
|
48
|
+
extern sp_bool sp_convert_soft;
|
|
49
|
+
extern sp_bool sp_convert_failed;
|
|
50
|
+
sp_Rational sp_rational_add(sp_Rational a, sp_Rational b);
|
|
51
|
+
sp_Rational sp_rational_sub(sp_Rational a, sp_Rational b);
|
|
52
|
+
sp_Rational sp_rational_mul(sp_Rational a, sp_Rational b);
|
|
53
|
+
sp_Rational sp_rational_div(sp_Rational a, sp_Rational b);
|
|
54
|
+
sp_Rational sp_rational_neg(sp_Rational a);
|
|
55
|
+
sp_Rational sp_rational_abs(sp_Rational a);
|
|
56
|
+
sp_Rational sp_rational_pow(sp_Rational a, sp_int e);
|
|
57
|
+
sp_int sp_rational_round_i(sp_Rational a); /* Rational#round (no digits) */
|
|
58
|
+
sp_int sp_rational_round_i_even(sp_Rational a); /* Rational#round(half: :even) */
|
|
59
|
+
sp_int sp_rational_round_i_down(sp_Rational a); /* Rational#round(half: :down) */
|
|
60
|
+
sp_int sp_rational_idiv(sp_Rational a, sp_Rational b); /* Rational#div (floor) */
|
|
61
|
+
sp_int sp_rational_floor_i(sp_Rational a); /* Rational#floor (no digits) */
|
|
62
|
+
sp_int sp_rational_ceil_i(sp_Rational a); /* Rational#ceil (no digits) */
|
|
63
|
+
sp_int sp_rational_round_i_mode(sp_Rational a, int md); /* 0 even / 1 up / 2 down */
|
|
64
|
+
sp_Rational sp_rational_round_prec_mode(sp_Rational a, sp_int nd, int md);
|
|
65
|
+
sp_Rational sp_rational_round_prec(sp_Rational a, sp_int nd);
|
|
66
|
+
sp_Rational sp_rational_truncate_prec(sp_Rational a, sp_int nd);
|
|
67
|
+
sp_Rational sp_rational_mod(sp_Rational a, sp_Rational b); /* Rational#% (floor) */
|
|
68
|
+
sp_Rational sp_rational_rem(sp_Rational a, sp_Rational b); /* Rational#remainder */
|
|
69
|
+
sp_Rational sp_rational_floor_prec(sp_Rational a, sp_int nd);
|
|
70
|
+
sp_Rational sp_rational_ceil_prec(sp_Rational a, sp_int nd);
|
|
71
|
+
sp_int sp_rational_cmp(sp_Rational a, sp_Rational b);
|
|
72
|
+
sp_bool sp_rational_eq(sp_Rational a, sp_Rational b);
|
|
73
|
+
sp_float sp_rational_to_f(sp_Rational a);
|
|
74
|
+
sp_Rational sp_float_to_rational(sp_float f); /* Float#to_r (exact) */
|
|
75
|
+
sp_Rational sp_float_rationalize(sp_float f, sp_float eps); /* Float#rationalize(eps) */
|
|
76
|
+
sp_Rational sp_float_rationalize0(sp_float f); /* Float#rationalize (no arg) */
|
|
77
|
+
/* ---- more Complex ops relocated from spinel_rt.h (sp_box_int/float in
|
|
78
|
+
sp_alloc.h, sp_complex_abs/abs2 already declared above). ---- */
|
|
79
|
+
sp_RbVal sp_complex_comp_v(sp_float v, int is_f);
|
|
80
|
+
sp_RbVal sp_complex_abs_v(sp_Complex a);
|
|
81
|
+
sp_RbVal sp_complex_abs2_v(sp_Complex a);
|
|
82
|
+
|
|
83
|
+
#endif /* SP_FORMAT_H */
|