MCPcopy Create free account
hub / github.com/ElementsProject/lightning / pull_uint

Function pull_uint

common/bolt11.c:88–101  ·  view source on GitHub ↗

Helper for pulling a variable-length big-endian int. */

Source from the content-addressed store, hash-verified

86
87/* Helper for pulling a variable-length big-endian int. */
88static bool pull_uint(struct hash_u5 *hu5,
89 u5 **data, size_t *data_len,
90 u64 *val, size_t databits)
91{
92 be64 be_val;
93
94 /* Too big. */
95 if (databits > sizeof(be_val) * CHAR_BIT)
96 return false;
97 if (!pull_bits(hu5, data, data_len, &be_val, databits, true))
98 return false;
99 *val = be64_to_cpu(be_val) >> (sizeof(be_val) * CHAR_BIT - databits);
100 return true;
101}
102
103static size_t num_u8(size_t num_u5)
104{

Callers 4

decode_xFunction · 0.85
decode_cFunction · 0.85
decode_fFunction · 0.85
bolt11_decode_nosigFunction · 0.85

Calls 2

pull_bitsFunction · 0.85
be64_to_cpuFunction · 0.85

Tested by

no test coverage detected