src/lib/serial.c
void serial_uint64(uint8_t * * const ptr, const uint64_t v)
{
    if (bigendian()) {
        memcpy(*ptr, &v, sizeof(uint64_t));
    } else {
        int i;
        uint8_t rv[sizeof(uint64_t)];
        uint8_t *pv = (uint8_t *) &v;

        for (i = 0; i < 8; i++) {
            rv[i] = pv[7 - i];
        }
        memcpy(*ptr, &rv, sizeof(uint64_t));
    }
    *ptr += sizeof(uint64_t);
}
/*  serial_uint64  --  Serialise an unsigned 64 bit integer.  */
serial_uint64  --  Serialise an unsigned 64 bit integer.
serial_uint64 -- Serialise an unsigned 64 bit integer .
void serial_uint64(uint8_t * * const ptr, const uint64_t v)
{
    if (bigendian()) {
        memcpy(*ptr, &v, sizeof(uint64_t));
    } else {
        int i;
        uint8_t rv[sizeof(uint64_t)];
        uint8_t *pv = (uint8_t *) &v;
        for (i = 0; i < 8; i++) {
            rv[i] = pv[7 - i];
        }
        memcpy(*ptr, &rv, sizeof(uint64_t));
    }
    *ptr += sizeof(uint64_t);
}
void serial_uint64 ( uint8_t * * const ptr , const uint64_t v ) { if ( bigendian ( ) ) { memcpy ( * ptr , & v , sizeof ( uint64_t ) ) ; } else { int i ; uint8_t rv [ sizeof ( uint64_t ) ] ; uint8_t * pv = ( uint8_t * ) & v ; for ( i = 0 ; i < 8 ; i ++ ) { rv [ i ] = pv [ 7 - i ] ; } memcpy ( * ptr , & rv , sizeof ( uint64_t ) ) ; } * ptr += sizeof ( uint64_t ) ; }
serial_uint64  --  Serialise an unsigned 64 bit integer.
serial_uint64 -- Serialise an unsigned 64 bit integer .