protoverse

A metaverse protocol
git clone git://jb55.com/protoverse
Log | Files | Refs | README | LICENSE

varint.h (326B)


      1 
      2 #ifndef PROTOVERSE_VARINT_H
      3 #define PROTOVERSE_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 /* PROTOVERSE_VARINT_H */