Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/msgpack/include/msgpack/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  timestamp.h

  Sprache: C
 

/*
 * MessagePack for C TimeStamp
 *
 * Copyright (C) 2018 KONDO Takatoshi
 *
 *    Distributed under the Boost Software License, Version 1.0.
 *    (See accompanying file LICENSE_1_0.txt or copy at
 *    http://www.boost.org/LICENSE_1_0.txt)
 */

#ifndef MSGPACK_TIMESTAMP_H
#define MSGPACK_TIMESTAMP_H

#include <msgpack/object.h>

#ifdef __cplusplus
extern "C" {
#endif


typedef struct msgpack_timestamp {
    int64_t tv_sec;
    uint32_t tv_nsec;
} msgpack_timestamp;

static inline bool msgpack_object_to_timestamp(const msgpack_object* obj, msgpack_timestamp* ts) {
    if (obj->type != MSGPACK_OBJECT_EXT) return false;
    if (obj->via.ext.type != -1return false;
    switch (obj->via.ext.size) {
    case 4:
        ts->tv_nsec = 0;
        _msgpack_load32(uint32_t, obj->via.ext.ptr, &ts->tv_sec);
        return true;
    case 8: {
        uint64_t value;
        _msgpack_load64(uint64_t, obj->via.ext.ptr, &value);
        ts->tv_nsec = (uint32_t)(value >> 34);
        ts->tv_sec = value & 0x00000003ffffffffL;
        return true;
    }
    case 12:
        _msgpack_load32(uint32_t, obj->via.ext.ptr, &ts->tv_nsec);
        _msgpack_load64(int64_t, obj->via.ext.ptr + 4, &ts->tv_sec);
        return true;
    default:
        return false;
    }
}


#ifdef __cplusplus
}
#endif

#endif /* msgpack/timestamp.h */

Messung V0.5 in Prozent
C=88 H=92 G=89

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-05) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.