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: dk4timedk.ctr
12 */
13
14 /** @file dk4timedk.c The dk4timedk module.
15 */
16
17
18 #include "dk4conf.h"
19
20 #if DK4_HAVE_ASSERT_H
21 #ifndef ASSERT_H_INCLUDED
22 #include <assert.h>
23 #define ASSERT_H_INCLUDED 1
24 #endif
25 #endif
26
27 #include <libdk4c/dk4timedk.h>
28
29 #if DK4_CHAR_SIZE > 1
30 #ifndef DK4TIMEWC_H_INCLUDED
31 #include <libdk4c/dk4timewc.h>
32 #endif
33 #else
34 #ifndef DK4TIME08_H_INCLUDED
35 #include <libdk4c/dk4time08.h>
36 #endif
37 #endif
38
39
40
41 int
dk4time_to_text(dkChar * dptr,size_t dsz,int format,unsigned short year,unsigned short month,unsigned short mday,unsigned short hour,unsigned short min,unsigned short sec,dk4_er_t * erp)42 dk4time_to_text(
43 dkChar *dptr,
44 size_t dsz,
45 int format,
46 unsigned short year,
47 unsigned short month,
48 unsigned short mday,
49 unsigned short hour,
50 unsigned short min,
51 unsigned short sec,
52 dk4_er_t *erp
53 )
54 {
55 #if DK4_USE_ASSERT
56 assert(NULL != dptr);
57 assert(0 < dsz);
58 #endif
59 #if DK4_CHAR_SIZE > 1
60 return (dk4time_to_text_wc(dptr,dsz,format,year,month,mday,hour,min,sec,erp));
61 #else
62 return (dk4time_to_text_c8(dptr,dsz,format,year,month,mday,hour,min,sec,erp));
63 #endif
64 }
65
66
67
68 int
dk4time_convert_to_text(dkChar * dptr,size_t dsz,const struct tm * tm,dk4_er_t * erp)69 dk4time_convert_to_text(
70 dkChar *dptr, size_t dsz, const struct tm *tm, dk4_er_t *erp
71 )
72 {
73 #if DK4_USE_ASSERT
74 assert(NULL != dptr);
75 assert(0 < dsz);
76 assert(NULL != tm);
77 #endif
78 #if DK4_CHAR_SIZE > 1
79 return (dk4time_convert_to_text_wc(dptr, dsz, tm, erp));
80 #else
81 return (dk4time_convert_to_text_c8(dptr, dsz, tm, erp));
82 #endif
83 }
84
85
86
87 int
dk4time_as_text(dkChar * dptr,size_t dsz,const dk4_time_t * timer,dk4_er_t * erp)88 dk4time_as_text(
89 dkChar *dptr, size_t dsz, const dk4_time_t *timer, dk4_er_t *erp
90 )
91 {
92 #if DK4_USE_ASSERT
93 assert(NULL != dptr);
94 assert(0 < dsz);
95 assert(NULL != timer);
96 #endif
97 #if DK4_CHAR_SIZE > 1
98 return (dk4time_as_text_wc(dptr, dsz, timer, erp));
99 #else
100 return (dk4time_as_text_c8(dptr, dsz, timer, erp));
101 #endif
102 }
103
104