source: git/Singular/sing_win.cc @ b2aa08

spielwiese
Last change on this file since b2aa08 was 6ce030f, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
removal of the $Id$ svn tag from everywhere NOTE: the git SHA1 may be used instead (only on special places) NOTE: the libraries Singular/LIB/*.lib still contain the marker due to our current use of svn
  • Property mode set to 100644
File size: 2.4 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4
5/*
6* ABSTRACT: Windows specific routines
7*/
8
9#include "config.h"
10#include <kernel/mod2.h>
11#ifdef ix86_Win
12#include <windows.h>
13#include <winuser.h>
14#include <kernel/htmlhelp.h>
15#include <sys/cygwin.h>
16#include <stdio.h>
17#ifndef MAXPATHLEN
18#define MAXPATHLEN 1024
19#endif
20
21void heOpenWinHtmlHelp(const char* keyw, char* helppath )
22// API Call Sequence for Microsoft HTML Help System
23{
24  char path[MAXPATHLEN];
25#ifdef TEST
26  printf("keyw:%s\n", keyw);
27#endif
28  cygwin_conv_to_full_win32_path(helppath, path);
29#ifdef TEST
30  printf("path:%s\n", path);
31#endif
32HH_ALINKA link;
33   link.cbStruct =     sizeof(HH_ALINKA) ;
34   link.fReserved =    FALSE ;
35   link.pszKeywords =  keyw;
36   link.pszUrl =       NULL ;
37   link.pszMsgText =   NULL ;
38   link.pszMsgTitle =  NULL ;
39   link.pszWindow =    NULL ;
40   link.fIndexOnFail = TRUE ;
41  HtmlHelpA(NULL, path, HH_KEYWORD_LOOKUP, (DWORD)&link);
42}
43
44void heOpenWinntHlp(const char* keyw, char* helppath )
45{
46  char path[MAXPATHLEN];
47#ifdef TEST
48  printf("keyw:%s\n", keyw);
49#endif
50  cygwin_conv_to_full_win32_path(helppath, path);
51#ifdef TEST
52  printf("path:%s\n", path);
53#endif
54      WinHelp(NULL, path, HELP_PARTIALKEY,(DWORD)keyw);
55}
56
57void heOpenWinntUrl(const char* url, int local)
58{
59#ifdef TEST
60  printf("url:%s:local:%d\n", url, local);
61#endif
62  if (local)
63  {
64    char path[MAXPATHLEN];
65    char *p;
66    cygwin_conv_to_full_win32_path(url, path);
67    /* seems like I can not open url's wit # at the end */
68    if ((p=strchr(path, '#')) != NULL) *p = '\0';
69#ifdef TEST
70    printf("path:%s:local:%d\n", path, local);
71#endif
72    ShellExecute(NULL, "open", path, 0, 0, SW_SHOWNORMAL);
73  }
74  else
75  {
76    // need to check whether this works
77    ShellExecute(NULL, "open", url, 0, 0, SW_SHOWNORMAL);
78  }
79}
80
81void *dynl_open(char *filename)
82{
83  char path[MAXPATHLEN];
84  cygwin_conv_to_full_win32_path(filename, path);
85  HINSTANCE hLibrary = LoadLibrary( TEXT(path));
86
87  return(hLibrary);
88}
89
90void *dynl_sym(void *handle, char *symbol)
91{
92  FARPROC f;
93  f = GetProcAddress((HINSTANCE)handle, TEXT (symbol));
94  return((void*) f);
95}
96
97int dynl_close (void *handle)
98{
99  FreeLibrary((HINSTANCE)handle);
100  return(0);
101}
102
103const char *dynl_error()
104{
105  static char errmsg[] = "support for dynamic loading not implemented";
106
107  return errmsg;
108}
109
110#endif /*ix86_Win */
Note: See TracBrowser for help on using the repository browser.