lnsocket

A minimal C library for connecting to the lightning network
git clone git://jb55.com/lnsocket
Log | Files | Refs | Submodules | README | LICENSE

varint.h (320B)


      1 
      2 #ifndef LNSOCKET_VARINT_H
      3 #define LNSOCKET_VARINT_H
      4 
      5 #define VARINT_MAX_LEN 9
      6 
      7 #include <stddef.h>
      8 #include <stdint.h>
      9 
     10 size_t varint_put(unsigned char buf[VARINT_MAX_LEN], uint64_t v);
     11 size_t varint_size(uint64_t v);
     12 size_t varint_get(const unsigned char *p, size_t max, int64_t *val);
     13 
     14 #endif /* LNSOCKET_VARINT_H */