source: trunk/testapp/console/fullpath/fullpath.c

Last change on this file was 21999, checked in by dmik, 13 years ago

kernel32: Make SEH work in OS/2 context.

See #82 for details.

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1#include <stdio.h>
2#include <windows.h>
3#include <tchar.h>
4
5#ifndef _MSC_VER
6
7#include <odinlx.h>
8
9#include <minivcrt.h>
10
11int _main();
12int _argc;
13char **_argv;
14
15int WIN32API WinMain(HANDLE hInstance,
16 HANDLE hPrevInstance,
17 LPSTR lpCmdLine,
18 int nCmdShow)
19{
20 return _main(_argc, _argv);
21}
22
23int main(int argc, char **argv)
24{
25 _argc = argc;
26 _argv = argv;
27#ifdef ODIN_FORCE_WIN32_TIB
28 ForceWin32TIB();
29#endif
30 RegisterLxExe(WinMain, NULL);
31}
32
33#else
34#define _main main
35#endif
36
37static void test_fullpath(const char *path)
38{
39 char fullPath[MAX_PATH];
40 _fullpath(fullPath, path, sizeof(fullPath));
41 printf("### [%s] => [%s]\n", path, fullPath);
42}
43
44static void do_test_fullpath()
45{
46 test_fullpath("");
47 test_fullpath("\\");
48 test_fullpath("\\\\\\\\");
49 test_fullpath(".");
50 test_fullpath(".\\");
51 test_fullpath("\\.");
52 test_fullpath("\\.\\");
53 test_fullpath("..");
54 test_fullpath("..\\");
55 test_fullpath("\\..");
56 test_fullpath("\\..\\");
57 test_fullpath("a\\b");
58 test_fullpath("\\a\\b");
59 test_fullpath("a\\b\\");
60 test_fullpath("\\a\\b\\");
61 test_fullpath("d:\\a\\b");
62 test_fullpath("d:\\a\\b\\");
63 test_fullpath("d:\\a\\b\\\\");
64 test_fullpath("d:\\a\\\\b\\c\\\\d");
65 test_fullpath("d:\\a\\.\\.\\b\\c\\.\\.\\.\\d");
66 test_fullpath("d:\\..\\..\\.\\");
67 test_fullpath("d:\\a\\\\b\\c\\\\d\\..\\e");
68 test_fullpath("d:\\a\\\\b\\c\\\\d\\..\\..\\e");
69 test_fullpath("d:\\a\\\\b\\c\\\\d\\..\\..\\..\\e");
70 test_fullpath("d:\\a\\\\b\\c\\\\d\\..\\..\\\\..\\e");
71 test_fullpath("d:\\a\\\\b\\c\\\\d\\..\\..\\..\\..\\e");
72 test_fullpath("d:\\a\\\\b\\c\\\\d\\..\\..\\..\\..\\..\\e");
73 test_fullpath("d\\a\\\\b\\c\\\\d\\..\\..\\..\\..\\..\\e");
74}
75
76int _main(int argc, char **argv)
77{
78 do_test_fullpath();
79
80 return 0;
81}
Note: See TracBrowser for help on using the repository browser.