1 /* 2 Copyright (C) 2015-2021, Dirk Krause 3 SPDX-License-Identifier: BSD-3-Clause 4 */ 5 6 /* 7 WARNING: This file was generated by the dkct program (see 8 http://dktools.sourceforge.net/ for details). 9 Changes you make here will be lost if dkct is run again! 10 You should modify the original source and run dkct on it. 11 Original source: dk4time.ctr 12 */ 13 14 #ifndef DK4TIME_H_INCLUDED 15 /** Avoid multiple inclusions. */ 16 #define DK4TIME_H_INCLUDED 1 17 18 19 /** @file 20 Retrieve current timestamp using CRT functions. 21 22 23 CRT on Windows: Required. 24 */ 25 26 #ifndef DK4CONF_H_INCLUDED 27 #if DK4_BUILDING_DKTOOLS4 28 #include "dk4conf.h" 29 #else 30 #include <dktools-4/dk4conf.h> 31 #endif 32 #endif 33 34 #ifndef DK4TYPES_H_INCLUDED 35 #if DK4_BUILDING_DKTOOLS4 36 #include <libdk4base/dk4types.h> 37 #else 38 #include <dktools-4/dk4types.h> 39 #endif 40 #endif 41 42 #ifndef DK4ERROR_H_INCLUDED 43 #if DK4_BUILDING_DKTOOLS4 44 #include <libdk4base/dk4error.h> 45 #else 46 #include <dktools-4/dk4error.h> 47 #endif 48 #endif 49 50 #if DK4_TIME_WITH_SYS_TIME 51 #ifndef SYS_TIME_H_INCLUDED 52 #include <sys/time.h> 53 #define SYS_TIME_H_INCLUDED 1 54 #endif 55 #ifndef TIME_H_INCLUDED 56 #include <time.h> 57 #define TIME_H_INCLUDED 1 58 #endif 59 #else 60 #if DK4_HAVE_TIME_H 61 #ifndef TIME_H_INCLUDED 62 #include <time.h> 63 #define TIME_H_INCLUDED 1 64 #endif 65 #else 66 #if DK4_HAVE_SYS_TIME_H 67 #ifndef SYS_TIME_H_INCLUDED 68 #include <sys/time.h> 69 #define SYS_TIME_H_INCLUDED 1 70 #endif 71 #endif 72 #endif 73 #endif 74 75 76 #if DK4_ON_WINDOWS 77 /** Timestamp. 78 */ 79 typedef __time64_t dk4_time_t; 80 #else 81 /** Timestamp. 82 */ 83 typedef time_t dk4_time_t; 84 #endif 85 86 #ifdef __cplusplus 87 extern "C" { 88 #endif 89 90 /** Retrieve current time. 91 @param timer Address of result variable. 92 */ 93 void 94 dk4time_get(dk4_time_t *timer); 95 96 #ifdef __cplusplus 97 } 98 #endif 99 100 101 #endif 102