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