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: dk4ufi08.ctr
12 */
13 
14 #ifndef DK4UFI08_H_INCLUDED
15 /** Avoid multiple inclusions. */
16 #define DK4UFI08_H_INCLUDED 1
17 
18 
19 /**	@file
20 	Obtain unique file identifier for path specified as char string.
21 	On non-Windows systems the UFI consists of inode number and
22 	device number. On Windows systems the volume serial number,
23 	higher index number and lower index number are used.
24 
25 	CRT on Windows: Not used.
26 */
27 
28 #ifndef	DK4CONF_H_INCLUDED
29 #if DK4_BUILDING_DKTOOLS4
30 #include "dk4conf.h"
31 #else
32 #include <dktools-4/dk4conf.h>
33 #endif
34 #endif
35 
36 #ifndef DK4UFI_H_INCLUDED
37 #if DK4_BUILDING_DKTOOLS4
38 #include <libdk4c/dk4ufit.h>
39 #else
40 #include <dktools-4/dk4ufit.h>
41 #endif
42 #endif
43 
44 #ifndef DK4ERROR_H_INCLUDED
45 #if DK4_BUILDING_DKTOOLS4
46 #include <libdk4base/dk4error.h>
47 #else
48 #include <dktools-4/dk4error.h>
49 #endif
50 #endif
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 /**	Retrieve unique file identifier.
57 	For symbolic links on non-Windows systems, retrieve
58 	information about the link target.
59 	@param	dptr	Destination buffer.
60 	@param	fn	File name.
61 	@param	erp	Error report, may be NULL.
62 	@return	1 on success, 0 on error.
63 
64 	Error codes:
65 	- DK4_E_INVALID_ARGUMENTS<br>
66 	  if dptr or fn is NULL,
67 	- DK4_E_SYSTEM<br>
68 	  with errno value stored in iDetails1 if the stat() function fails on
69 	  non-Windows systems,
70 	- DK4_E_CREATE_FILE_FAILED<br>
71 	  with GetLastError() result in lDetails1 if the CreateFile() function
72 	  fails on Windows,
73 	- DK4_E_FILE_INFORMATION_FAILED<br>
74 	  with GetLastError() result in lDetails1 if the
75 	  GetFileInformationByHandle() function fails on Windows.
76 	- DK4_E_NOT_FOUND<br>
77 	  if the GetFileAttributes() function fails to retrieve file
78 	  attributes on Windows.
79 
80 
81 */
82 int
83 dk4ufi_get_c8(dk4_ufi_t *dptr, const char *fn, dk4_er_t *erp);
84 
85 /**	Retrieve unique file identifier.
86 	For symbolic links on non-Windows systems, retrieve
87 	information about the link.
88 	@param	dptr	Destination buffer.
89 	@param	fn	File name.
90 	@param	erp	Error report, may be NULL.
91 	@return	1 on success, 0 on error.
92 
93 	Error codes:
94 	- DK4_E_INVALID_ARGUMENTS<br>
95 	  if dptr or fn is NULL,
96 	- DK4_E_SYSTEM<br>
97 	  with errno value stored in iDetails1 if the lstat() function fails
98 	  on non-Windows systems,
99 	- DK4_E_CREATE_FILE_FAILED<br>
100 	  with GetLastError() result in lDetails1 if the CreateFile() function
101 	  fails on Windows,
102 	- DK4_E_FILE_INFORMATION_FAILED<br>
103 	  with GetLastError() result in lDetails1 if the
104 	  GetFileInformationByHandle() function fails on Windows.
105 	- DK4_E_NOT_FOUND<br>
106 	  if the GetFileAttributes() function fails to retrieve
107 	  file attributes on Windows.
108 
109 */
110 int
111 dk4ufi_get_l_c8(dk4_ufi_t *dptr, const char *fn, dk4_er_t *erp);
112 
113 #ifdef __cplusplus
114 }
115 #endif
116 
117 
118 #endif
119