logo
Free, Micro AI Code Reviews That Run on Git Commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt

mtbl_fixed - Fixed-width encoding and decoding of 32 and 64 bit integers

Description

mtbl_fixed_encode32() and mtbl_fixed_encode64() write the 32 or 64 bit quantity, respectively, in the
       argument value to the buffer in the argument dst. The quantity will be written in little endian order,
       regardless of host architecture.

       mtbl_fixed_decode32() and mtbl_fixed_decode64() read and return the 32 or 64 bit quantity, respectively,
       in the argument ptr. The quantity will be read in little endian order, regardless of host architecture.

       Bounds checking must be performed by the caller.

Name

       mtbl_fixed - Fixed-width encoding and decoding of 32 and 64 bit integers

Return Value

mtbl_fixed_encode32() and mtbl_fixed_encode64() return the number of bytes written to the buffer. (4 or
       8, respectively.)

       mtbl_fixed_decode32() and mtbl_fixed_decode64() return the decoded quantity.

                                                   01/31/2014                                      MTBL_FIXED(3)

Synopsis

#include<mtbl.h>size_tmtbl_fixed_encode32(uint8_t*dst,uint32_tvalue);size_tmtbl_fixed_encode64(uint8_t*dst,uint64_tvalue);uint32_tmtbl_fixed_decode32(constuint8_t*ptr);uint64_tmtbl_fixed_decode64(constuint8_t*ptr);

See Also