diff options
author | Norbert Preining <norbert@preining.info> | 2020-10-12 03:04:00 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-10-12 03:04:00 +0000 |
commit | 0ce40abb18ec02ec6fd6bcc5f21612c88daa7578 (patch) | |
tree | 416289fe1448873fd8ca33051f50ad85bffa8aaa /support/dktools/dk4fileia.c | |
parent | fdb18507cd80dc17f5a5256153d34668b4f4e61c (diff) |
CTAN sync 202010120303
Diffstat (limited to 'support/dktools/dk4fileia.c')
-rw-r--r-- | support/dktools/dk4fileia.c | 216 |
1 files changed, 0 insertions, 216 deletions
diff --git a/support/dktools/dk4fileia.c b/support/dktools/dk4fileia.c deleted file mode 100644 index 9811a40d4b..0000000000 --- a/support/dktools/dk4fileia.c +++ /dev/null @@ -1,216 +0,0 @@ -/* -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: dk4fileia.ctr -*/ - -/** @file dk4fileia.c The dk4fileia module. -*/ - - -#line 81 "dk4fileia.ctr" - -#include "dk4conf.h" -#include "dk4const.h" - -#if DK4_ON_WINDOWS -#ifndef WINDOWS_H_INCLUDED -#include <windows.h> -#define WINDOWS_H_INCLUDED 1 -#endif -#endif - -#if DK4_HAVE_ERRNO_H -#ifndef ERRNO_H_INCLUDED -#include <errno.h> -#define ERRNO_H_INCLUDED 1 -#endif -#endif - -#include "dk4filei.h" -#include "dk4fileia.h" -#include "dk4error.h" -#include "dk4mem.h" - -#if DK4_ON_WINDOWS -#include "dk4maodd.h" -#include "dk4maodh.h" -#endif - -#if DK4_HAVE_ASSERT_H -#ifndef ASSERT_H_INCLUDED -#include <assert.h> -#define ASSERT_H_INCLUDED 1 -#endif -#endif - - - - -#line 118 "dk4fileia.ctr" - - - -#if DK4_ON_WINDOWS -void -dk4fileinfo_report_win_failed(dk4_app_t *app, const dkChar *path, long errc) -{ - dkChar eb1[8 * sizeof(DWORD) + 16]; - dkChar eb2[8 * sizeof(DWORD) + 16]; - int res = 0; - int found = 0; - - if (ERROR_FILE_NOT_FOUND == errc) { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 51, path); - found = 1; - goto finished; - } - if (ERROR_PATH_NOT_FOUND == errc) { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 51, path); - found = 1; - goto finished; - } - if (ERROR_ACCESS_DENIED == errc) { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 55, path); - found = 1; - goto finished; - } - if (ERROR_BAD_NET_NAME == errc) { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 74, path); - found = 1; - goto finished; - } - if (ERROR_BAD_NETPATH == errc) { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 75, path); - found = 1; - goto finished; - } - if (ERROR_SHARING_VIOLATION == errc) { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 151, path); - found = 1; - goto finished; - } - if (0 == found) { - res = dk4ma_write_decimal_unsigned( - eb1, DK4_SIZEOF(eb1,dkChar), (dk4_um_t)(errc), 0, NULL - ); - if (0 != res) { - res = dk4ma_write_hex_unsigned( - eb2, DK4_SIZEOF(eb2,dkChar), (dk4_um_t)(errc), - 0, NULL - ); - } - if (0 != res) { - dk4app_log_base7(app,DK4_LL_ERROR,149,69,70,71,path,eb1,eb2); - } else { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 40, path); - } - } - finished: ; -} -#endif - - - -void -dk4fileinfo_report_stat_failed(dk4_app_t *app, const dkChar *path, int errc) -{ - - -#line 186 "dk4fileia.ctr" - switch (errc) { -#ifdef EACCES - case EACCES : { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 138, path); - } break; -#endif -#ifdef EFAULT - case EFAULT : { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 123, path); - } break; -#endif -#ifdef ELOOP - case ELOOP : { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 61, path); - } break; -#endif -#ifdef ENAMETOOLONG - case ENAMETOOLONG : { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 42, path); - } break; -#endif -#ifdef ENOENT - case ENOENT : { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 51, path); - } break; -#endif -#ifdef ENOMEM - case ENOMEM : { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 142, path); - } break; -#endif -#ifdef ENOTDIR - case ENOTDIR : { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 150, path); - } break; -#endif -#ifdef EOVERFLOW - case EOVERFLOW : { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 117, path); - } break; -#endif -#ifdef EIO - case EIO : { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 126, path); - } break; -#endif - default : { - dk4app_log_base3(app, DK4_LL_ERROR, 149, 101, path); - } break; - } - - -#line 237 "dk4fileia.ctr" -} - - - -int -dk4fileinfo_app(dk4_file_info_t *dptr, const dkChar *fn, dk4_app_t *app) -{ - dk4_er_t er; - int back = 0; -#if DK4_USE_ASSERT - assert(NULL != dptr); - assert(NULL != fn); -#endif - if ((NULL != dptr) && (NULL != fn)) { - dk4error_init(&er); - back = dk4fileinfo(dptr, fn, &er); - if (0 == back) { - switch (er.ec) { -#if DK4_ON_WINDOWS - case DK4_E_CREATE_FILE_FAILED : - case DK4_E_FILE_INFORMATION_FAILED : - case DK4_E_FINDFIRSTFILE_FAILED : - case DK4_E_SYSTEM : { - dk4fileinfo_report_win_failed(app, fn, er.dt.lDetails1); - } break; -#else - case DK4_E_SYSTEM : { - dk4fileinfo_report_stat_failed(app, fn, er.dt.iDetails1); - } break; -#endif - } - } - } - return back; -} - |