urbit/include/g/i.h

87 lines
2.0 KiB
C
Raw Normal View History

2014-09-04 07:44:53 +04:00
/* include/g/i.h
**
** This file is in the public domain.
*/
/* General constructors.
*/
2014-09-06 00:13:24 +04:00
/* u3_ci_words():
2014-09-04 07:44:53 +04:00
**
** Copy [a] words from [b] into an atom.
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_ci_words(c3_w a_w,
2014-09-04 07:44:53 +04:00
const c3_w* b_w);
2014-09-06 00:13:24 +04:00
/* u3_ci_bytes():
2014-09-04 07:44:53 +04:00
**
** Copy `a` bytes from `b` to an LSB first atom.
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_ci_bytes(c3_w a_w,
2014-09-04 07:44:53 +04:00
const c3_y* b_y);
2014-09-06 00:13:24 +04:00
/* u3_ci_mp():
2014-09-04 07:44:53 +04:00
**
** Copy the GMP integer `a` into an atom, and clear it.
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_ci_mp(mpz_t a_mp);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ci_vint():
2014-09-04 07:44:53 +04:00
**
** Create `a + 1`.
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_ci_vint(u3_noun a);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ci_cell():
2014-09-04 07:44:53 +04:00
**
** Produce the cell `[a b]`.
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_ci_cell(u3_noun a, u3_noun b);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ci_trel():
2014-09-04 07:44:53 +04:00
**
** Produce the triple `[a b c]`.
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_ci_trel(u3_noun a, u3_noun b, u3_noun c);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ci_qual():
2014-09-04 07:44:53 +04:00
**
** Produce the cell `[a b c d]`.
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_ci_qual(u3_noun a, u3_noun b, u3_noun c, u3_noun d);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ci_string():
2014-09-04 07:44:53 +04:00
**
** Produce an LSB-first atom from the C string `a`.
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_ci_string(const c3_c* a_c);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ci_molt():
2014-09-04 07:44:53 +04:00
**
** Mutate `som` with a 0-terminated list of axis, noun pairs.
** Axes must be cats (31 bit).
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_ci_molt(u3_noun som, ...);
2014-09-04 07:44:53 +04:00
2014-09-06 00:13:24 +04:00
/* u3_ci_chubs():
2014-09-04 07:44:53 +04:00
**
** Construct `a` double-words from `b`, LSD first, as an atom.
*/
2014-09-06 00:13:24 +04:00
u3_atom
u3_ci_chubs(c3_w a_w,
2014-09-04 07:44:53 +04:00
const c3_d* b_d);
2014-09-06 00:13:24 +04:00
/* u3_ci_tape(): from a C string, to a list of bytes.
2014-09-04 07:44:53 +04:00
*/
2014-09-06 00:13:24 +04:00
u3_atom
u3_ci_tape(const c3_c* txt_c);
2014-09-04 07:44:53 +04:00