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

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