created datatype for the denormalized process data block
[reactos.git] / posix / include / psx / path.h
1 /* $Id: path.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
2 */
3 /*
4 * psx/path.h
5 *
6 * POSIX+ subsystem path functions
7 *
8 * This file is part of the ReactOS Operating System.
9 *
10 * Contributors:
11 * Created by KJK::Hyperion <noog@libero.it>
12 *
13 * THIS SOFTWARE IS NOT COPYRIGHTED
14 *
15 * This source code is offered for use in the public domain. You may
16 * use, modify or distribute it freely.
17 *
18 * This code is distributed in the hope that it will be useful but
19 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
20 * DISCLAMED. This includes but is not limited to warranties of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 *
23 */
24 #ifndef __PSX_PATH_H_INCLUDED__
25 #define __PSX_PATH_H_INCLUDED__
26
27 /* INCLUDES */
28 #include <ddk/ntddk.h>
29
30 /* OBJECTS */
31
32 /* TYPES */
33
34 /* CONSTANTS */
35
36 /* PROTOTYPES */
37 BOOLEAN
38 __PdxPosixPathGetNextComponent_U
39 (
40 IN UNICODE_STRING PathName,
41 IN OUT PUNICODE_STRING PathComponent,
42 OUT PBOOLEAN TrailingDelimiter OPTIONAL
43 );
44
45 BOOLEAN
46 __PdxPosixPathResolve_U
47 (
48 IN UNICODE_STRING PathName,
49 OUT PUNICODE_STRING ResolvedPathName,
50 IN WCHAR PathDelimiter OPTIONAL
51 );
52
53 BOOLEAN
54 __PdxPosixPathGetNextComponent_A
55 (
56 IN ANSI_STRING PathName,
57 IN OUT PANSI_STRING PathComponent,
58 OUT PBOOLEAN TrailingDelimiter OPTIONAL
59 );
60
61 BOOLEAN
62 __PdxPosixPathResolve_A
63 (
64 IN ANSI_STRING PathName,
65 OUT PANSI_STRING ResolvedPathName,
66 IN CHAR PathDelimiter OPTIONAL
67 );
68
69 BOOLEAN
70 __PdxPosixPathNameToNtPathName
71 (
72 IN PWCHAR PosixPath,
73 OUT PUNICODE_STRING NativePath,
74 IN PUNICODE_STRING CurDir OPTIONAL,
75 IN PUNICODE_STRING RootDir OPTIONAL
76 );
77
78 /* MACROS */
79 /* returns non-zero if the argument is a path delimiter */
80 #define IS_CHAR_DELIMITER_U(WCH) (((WCH) == L'/') || ((WCH) == L'\\'))
81 #define IS_CHAR_DELIMITER_A(CH) (((CH) == '/') || ((CH) == '\\'))
82
83 /* returns non-zero if the argument is an empty path component */
84 #define IS_COMPONENT_EMPTY_U(WCOMPONENT) (WCOMPONENT.Length == 0)
85 #define IS_COMPONENT_EMPTY_A(COMPONENT) (COMPONENT.Length == 0)
86
87 /* returns non-zero if the argument is "." */
88 #define IS_COMPONENT_DOT_U(WCOMPONENT) \
89 ((WCOMPONENT.Length == sizeof(WCHAR)) && (WCOMPONENT.Buffer[0] == L'.'))
90
91 #define IS_COMPONENT_DOT_A(COMPONENT) \
92 ((COMPONENT.Length == 1) && (COMPONENT.Buffer[0] == '.'))
93
94 /* returns non-zero if the argument is ".." */
95 #define IS_COMPONENT_DOTDOT_U(WCOMPONENT) \
96 ( \
97 (WCOMPONENT.Length == (sizeof(WCHAR) * 2)) && \
98 (WCOMPONENT.Buffer[0] == L'.') && \
99 (WCOMPONENT.Buffer[1] == L'.') \
100 )
101
102 #define IS_COMPONENT_DOTDOT_A(COMPONENT) \
103 ( \
104 (COMPONENT.Length == 2) && \
105 (COMPONENT.Buffer[0] == '.') && \
106 (COMPONENT.Buffer[1] == '.') \
107 )
108
109 #endif /* __PSX_PATH_H_INCLUDED__ */
110
111 /* EOF */
112