|
| 1 | +#pragma once |
| 2 | +/* |
| 3 | + * Copyright 2021, Tarantool AUTHORS, please see AUTHORS file. |
| 4 | + * |
| 5 | + * Redistribution and use in source and binary forms, with or |
| 6 | + * without modification, are permitted provided that the following |
| 7 | + * conditions are met: |
| 8 | + * |
| 9 | + * 1. Redistributions of source code must retain the above |
| 10 | + * copyright notice, this list of conditions and the |
| 11 | + * following disclaimer. |
| 12 | + * |
| 13 | + * 2. Redistributions in binary form must reproduce the above |
| 14 | + * copyright notice, this list of conditions and the following |
| 15 | + * disclaimer in the documentation and/or other materials |
| 16 | + * provided with the distribution. |
| 17 | + * |
| 18 | + * THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND |
| 19 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
| 20 | + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 | + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL |
| 22 | + * <COPYRIGHT HOLDER> OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
| 23 | + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 24 | + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 25 | + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 26 | + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 27 | + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
| 29 | + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 30 | + * SUCH DAMAGE. |
| 31 | + */ |
| 32 | + |
| 33 | +#include <c-dt/dt_core.h> |
| 34 | +#include <stdint.h> |
| 35 | +#include <stdbool.h> |
| 36 | + |
| 37 | +#if defined(__cplusplus) |
| 38 | +extern "C" { |
| 39 | +#endif /* defined(__cplusplus) */ |
| 40 | + |
| 41 | +/** |
| 42 | + * datetime structure consisting of: |
| 43 | + */ |
| 44 | +struct datetime_t { |
| 45 | + int64_t secs; ///< seconds since epoch |
| 46 | + int32_t nsec; ///< nanoseconds if any |
| 47 | + int32_t offset; ///< offset in minutes from GMT |
| 48 | +}; |
| 49 | + |
| 50 | +/** |
| 51 | + * Date/time delta structure |
| 52 | + */ |
| 53 | +struct datetime_interval_t { |
| 54 | + int64_t secs; ///< relative seconds delta |
| 55 | + int32_t nsec; ///< nanoseconds delta |
| 56 | +}; |
| 57 | + |
| 58 | +#if defined(__cplusplus) |
| 59 | +} /* extern "C" */ |
| 60 | +#endif /* defined(__cplusplus) */ |
| 61 | + |
0 commit comments