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: dk4fne.ctr
12 */
13 
14 #ifndef DK4FNE_H_INCLUDED
15 /** Avoid multiple inclusions. */
16 #define DK4FNE_H_INCLUDED 1
17 
18 
19 /**	@file
20 	File name expander.
21 
22 	CRT on Windows: Optional.
23 */
24 
25 #ifndef DK4CONF_H_INCLUDED
26 #if DK4_BUILDING_DKTOOLS4
27 #include "dk4conf.h"
28 #else
29 #include <dktools-4/dk4conf.h>
30 #endif
31 #endif
32 
33 #ifndef DK4DIR_H_INCLUDED
34 #if DK4_BUILDING_DKTOOLS4
35 #include <libdk4c/dk4dir.h>
36 #else
37 #include <dktools-4/dk4dir.h>
38 #endif
39 #endif
40 
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /**	Expand a file name.
47 	@param	pattern	File name pattern, may optionally include
48 	a directory part.
49 	@param	erp	Error report, may be NULL.
50 	@return	Directory structure on success, NULL on error.
51 	On success the path component in the returned directory structure
52 	is NULL if the pattern did not contain a directory part.
53 
54 	Error codes:
55 	- DK4_E_INVALID_ARGUMENTS<br>
56 	  if path is NULL,
57 	- DK4_E_NOT_SUPPORTED<br>
58 	  if no function to traverse directories was found during build
59 	  process or the function is called on a non-Windows system,
60 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
61 	  if a memory allocation failed,
62 	- DK4_E_MATH_OVERFLOW<br>
63 	  if a mathematical overflow occured in a size calculation,
64 	- DK4_E_BUFFER_TOO_SMALL<br>
65 	  if one of the involved directory or file names is too long for an
66 	  internal buffer,
67 	- DK4_E_OPENDIR_FAILED<br>
68 	  with errno value in iDetails1 if the attempt to open the directory
69 	  failed,
70 	- DK4_E_FINDFIRSTFILE_FAILED<br>
71 	  with GetLastError() value in lDetails1 if the FindFirstFile()
72 	  function failed on Windows,
73 	- DK4_E_SYSTEM<br>
74 	  if the stat() or lstat() function failed for one of the directory
75 	  items.
76 */
77 dk4_dir_t *
78 dk4fne_open(const dkChar *pattern, dk4_er_t *erp);
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 
85 
86 
87 #endif
88