/* Copyright (C) 2015-2020, Dirk Krause SPDX-License-Identifier: BSD-3-Clause */ /* WARNING: This file was generated by the dkct program (see http://dktools.sourceforge.net/ for details). Changes you make here will be lost if dkct is run again! You should modify the original source and run dkct on it. Original source: dk4ftimewc.ctr */ /** @file dk4ftimewc.c The dk4ftimewc module. */ #line 10 "dk4ftimewc.ctr" #include "dk4conf.h" #if DK4_HAVE_ASSERT_H #ifndef ASSERT_H_INCLUDED #include #define ASSERT_H_INCLUDED 1 #endif #endif #include "dk4ftime.h" #ifndef DK4TIMEWC_H_INCLUDED #include "dk4timewc.h" #endif int dk4filetime_to_text_wc( wchar_t *dptr, size_t dsz, const dk4_file_time_t *fit, dk4_er_t *erp ) { #if DK4_ON_WINDOWS SYSTEMTIME st1; SYSTEMTIME st2; int back = 0; #if DK4_USE_ASSERT assert(NULL != dptr); assert(0 < dsz); assert(NULL != fit); #endif if ((NULL != dptr) && (NULL != fit) && (0 < dsz)) { if (FileTimeToSystemTime(fit, &st1)) { if (SystemTimeToTzSpecificLocalTime(NULL, &st1, &st2)) { back = dk4time_to_text_wc( dptr, dsz, DK4_TIMEFORMAT_DATE_TIME, st2.wYear, st2.wMonth, st2.wDay, st2.wHour, st2.wMinute, st2.wSecond, erp ); } else { /* Error: Conversion to local time failed */ dk4error_set_simple_error_code(erp, DK4_E_BUG); } } else { /* Error: Time conversion failed */ dk4error_set_simple_error_code(erp, DK4_E_BUG); } } else { dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS); } return back; #else #if DK4_USE_ASSERT assert(NULL != dptr); assert(0 < dsz); assert(NULL != fit); #endif return (dk4time_as_text_wc(dptr, dsz, fit, erp)); #endif }