source: git/Singular/sing_win.cc @ 84a6a7

spielwiese
Last change on this file since 84a6a7 was 0500da, checked in by Oliver Wienand <wienand@…>, 19 years ago
sing_win.cc: ---> Hardcoded path entfernt run.c: ---> Besonderheit von Cygwin entfernt git-svn-id: file:///usr/local/Singular/svn/trunk@8470 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.2 KB
Line 
1#include "mod2.h"
2#ifdef ix86_Win
3#include <windows.h>
4#include <winuser.h>
5#include <htmlhelp.h>
6#include <sys/cygwin.h>
7#include <stdio.h>
8#ifndef MAXPATHLEN
9#define MAXPATHLEN 1024
10#endif
11
12void heOpenWinHtmlHelp(const char* keyw, char* helppath )
13// API Call Sequence for Microsoft HTML Help System
14{
15  char path[MAXPATHLEN];
16#ifdef TEST
17  printf("keyw:%s\n", keyw);
18#endif
19  cygwin_conv_to_full_win32_path(helppath, path);
20#ifdef TEST
21  printf("path:%s\n", path);
22#endif
23HH_AKLINK link;
24   link.cbStruct =     sizeof(HH_AKLINK) ;
25   link.fReserved =    FALSE ;
26   link.pszKeywords =  keyw;
27   link.pszUrl =       NULL ;
28   link.pszMsgText =   NULL ;
29   link.pszMsgTitle =  NULL ;
30   link.pszWindow =    NULL ;
31   link.fIndexOnFail = TRUE ;
32  HtmlHelp(NULL, path, HH_KEYWORD_LOOKUP, (DWORD)&link);
33}
34
35void heOpenWinntHlp(const char* keyw, char* helppath )
36{
37  char path[MAXPATHLEN];
38#ifdef TEST
39  printf("keyw:%s\n", keyw);
40#endif
41  cygwin_conv_to_full_win32_path(helppath, path);
42#ifdef TEST
43  printf("path:%s\n", path);
44#endif
45      WinHelp(NULL, path, HELP_PARTIALKEY,(DWORD)keyw);
46}
47
48void heOpenWinntUrl(const char* url, int local)
49{
50#ifdef TEST
51  printf("url:%s:local:%d\n", url, local);
52#endif
53  if (local)
54  {
55    char path[MAXPATHLEN];
56    char *p;
57    cygwin_conv_to_full_win32_path(url, path);
58    /* seems like I can not open url's wit # at the end */
59    if ((p=strchr(path, '#')) != NULL) *p = '\0';
60#ifdef TEST
61    printf("path:%s:local:%d\n", path, local);
62#endif
63    ShellExecute(NULL, "open", path, 0, 0, SW_SHOWNORMAL);
64  }
65  else
66  {
67    // need to check whether this works
68    ShellExecute(NULL, "open", url, 0, 0, SW_SHOWNORMAL);
69  }
70}
71
72void *dynl_open(char *filename)
73{
74  char path[MAXPATHLEN];
75  cygwin_conv_to_full_win32_path(filename, path);
76  HINSTANCE hLibrary = LoadLibrary( TEXT(path));
77
78  return(hLibrary);
79}
80
81void *dynl_sym(void *handle, char *symbol)
82{
83  FARPROC f;
84  f = GetProcAddress((HINSTANCE)handle, TEXT (symbol));
85  return((void*) f);
86}
87
88int dynl_close (void *handle)
89{
90  FreeLibrary((HINSTANCE)handle);
91  return(0);
92}
93
94const char *dynl_error()
95{
96  static char errmsg[] = "support for dynamic loading not implemented";
97
98  return errmsg;
99}
100
101#endif /*ix86_Win */
Note: See TracBrowser for help on using the repository browser.