My Project
Loading...
Searching...
No Matches
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
18void 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
43int main(int argc, char* argv[])
44{
45 heOpenWinntUrl(argv[1], argc > 2 ? 0 : 1);
46}
47#endif
48#endif
int p
Definition: cfModGcd.cc:4078
#define url
Definition: libparse.cc:1260
#define NULL
Definition: omList.c:12
#define MAXPATHLEN
Definition: omRet2Info.c:22
int main()