1 | /* $Id: pathcpp.cpp,v 1.4 2000-08-24 09:32:42 sandervl Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Win32 SHELL32 for OS/2
|
---|
5 | *
|
---|
6 | * Copyright 1997 Marcus Meissner
|
---|
7 | * Copyright 1999 Patrick Haller (haller@zebra.fh-weingarten.de)
|
---|
8 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
9 | *
|
---|
10 | * Path Functions
|
---|
11 | *
|
---|
12 | * Many of this functions are in SHLWAPI.DLL also
|
---|
13 | *
|
---|
14 | * Corel WINE 20000324 level (without CRTDLL_* calls)
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*****************************************************************************
|
---|
18 | * Remark *
|
---|
19 | *****************************************************************************
|
---|
20 |
|
---|
21 | */
|
---|
22 |
|
---|
23 |
|
---|
24 | /*****************************************************************************
|
---|
25 | * Includes *
|
---|
26 | *****************************************************************************/
|
---|
27 |
|
---|
28 | #include <odin.h>
|
---|
29 | #include <odinwrap.h>
|
---|
30 | #include <os2sel.h>
|
---|
31 |
|
---|
32 | #include <string.h>
|
---|
33 | #include <ctype.h>
|
---|
34 | #include <wctype.h>
|
---|
35 | #include <wcstr.h>
|
---|
36 | #define HAVE_WCTYPE_H
|
---|
37 |
|
---|
38 | #include "debugtools.h"
|
---|
39 |
|
---|
40 | #include <winreg.h>
|
---|
41 |
|
---|
42 | #include <heapstring.h>
|
---|
43 |
|
---|
44 | ODINDEBUGCHANNEL(SHLWAPI-SHELLPATH)
|
---|
45 |
|
---|
46 | /*****************************************************************************
|
---|
47 | * Name : LPSTR PathSkipRootA
|
---|
48 | * Purpose : Parses a path, ignoring the drive letter or UNC server/share path parts.
|
---|
49 | * Parameters: LPCSTR pszPath
|
---|
50 | * Variables :
|
---|
51 | * Result : unknown
|
---|
52 | * Remark : SHLWAPI.PathSkipRootA
|
---|
53 | * Status : COMPLETELY IMPLEMENTED ? UNTESTED
|
---|
54 | *
|
---|
55 | * Author : Patrick Haller [Mon, 2000/01/31 23:02]
|
---|
56 | *****************************************************************************/
|
---|
57 |
|
---|
58 | ODINFUNCTION1(LPSTR, PathSkipRootA, LPCSTR, pszPath)
|
---|
59 | {
|
---|
60 | // check if "driveletter:\"
|
---|
61 | if (pszPath[1] == ':')
|
---|
62 | return (LPSTR)(pszPath + 2);
|
---|
63 |
|
---|
64 | // check if UNC-style path
|
---|
65 | if ( (pszPath[0] == '\\') &&
|
---|
66 | (pszPath[1] == '\\') )
|
---|
67 | {
|
---|
68 | LPSTR pszTemp = strchr(pszPath + 2, '\\');
|
---|
69 | if (NULL != pszTemp)
|
---|
70 | // return root part, skip server/share
|
---|
71 | return (LPSTR)pszTemp++;
|
---|
72 | else
|
---|
73 | // UNC syntax validation, return pszPath
|
---|
74 | return (LPSTR)pszTemp;
|
---|
75 | }
|
---|
76 |
|
---|
77 | // else ...
|
---|
78 | return (LPSTR)pszPath;
|
---|
79 | }
|
---|
80 |
|
---|
81 |
|
---|
82 | /*****************************************************************************
|
---|
83 | * Name : LPWSTR PathSkipRootW
|
---|
84 | * Purpose : Parses a path, ignoring the drive letter or UNC server/share path parts.
|
---|
85 | * Parameters: LPCWSTR pszPath
|
---|
86 | * Variables :
|
---|
87 | * Result : unknown
|
---|
88 | * Remark : SHLWAPI.PathSkipRootW
|
---|
89 | * Status : STUB UNTESTED
|
---|
90 | *
|
---|
91 | * Author : Patrick Haller [Mon, 2000/01/31 23:02]
|
---|
92 | *****************************************************************************/
|
---|
93 |
|
---|
94 | ODINFUNCTION1(LPWSTR, PathSkipRootW, LPCWSTR, pszPath)
|
---|
95 | {
|
---|
96 | dprintf(("not implemented"));
|
---|
97 |
|
---|
98 | return (LPWSTR)pszPath;
|
---|
99 | }
|
---|