My Project
Loading...
Searching...
No Matches
Singular
feOpenWinntUrl.c
Go to the documentation of this file.
1
/****************************************
2
* Computer Algebra System SINGULAR *
3
****************************************/
4
/*
5
* ABSTRACT: encapsulation of call to Win32 ShellExecute call for opening
6
a URL
7
*/
8
9
/* you can try this out by compiling with -DTEST and runing:
10
a.exe file|url [not-local]*/
11
#ifdef WINNT
12
#include <windows.h>
13
14
#ifndef MAXPATHLEN
15
#define MAXPATHLEN 1024
16
#endif
17
18
void
heOpenWinntUrl
(
const
char
*
url
,
int
local
)
19
{
20
#ifdef TEST
21
printf
(
"url:%s:local:%d\n"
,
url
,
local
);
22
#endif
23
if
(
local
)
24
{
25
char
path
[
MAXPATHLEN
];
26
char
*
p
;
27
cygwin_conv_to_full_win32_path
(
url
,
path
);
28
/* seems like I can not open url's wit # at the end */
29
if
((
p
=
strchr
(
path
,
'#'
)) !=
NULL
) *
p
=
'\0'
;
30
#ifdef TEST
31
printf
(
"path:%s:local:%d\n"
,
path
,
local
);
32
#endif
33
ShellExecute
(
NULL
,
"open"
,
path
, 0, 0,
SW_SHOWNORMAL
);
34
}
35
else
36
{
37
// need to check whether this works
38
ShellExecute
(
NULL
,
"open"
,
url
, 0, 0,
SW_SHOWNORMAL
);
39
}
40
}
41
42
#ifdef TEST
43
int
main
(
int
argc,
char
*
argv
[])
44
{
45
heOpenWinntUrl
(
argv
[1], argc > 2 ? 0 : 1);
46
}
47
#endif
48
#endif
p
int p
Definition
cfModGcd.cc:4086
List
Definition
ftmpl_list.h:52
url
#define url
Definition
libparse.cc:1260
NULL
#define NULL
Definition
omList.c:12
MAXPATHLEN
#define MAXPATHLEN
Definition
omRet2Info.c:22
main
int main()
Definition
p_Procs_Generate.cc:219
Generated on Sun Dec 1 2024 16:01:24 for My Project by
doxygen 1.9.8
for
Singular