source: git/Singular/sing_win.cc @ b38bc9

spielwiese
Last change on this file since b38bc9 was ba5e9e, checked in by Oleksandr Motsak <motsak@…>, 11 years ago
Changed configure-scripts to generate individual public config files for each package: resources, libpolys, singular (main) fix: sources should include correct corresponding config headers.
  • 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#ifdef HAVE_CONFIG_H
10#include "singularconfig.h"
11#endif /* HAVE_CONFIG_H */
12#include <kernel/mod2.h>
13#ifdef ix86_Win
14#include <windows.h>
15#include <winuser.h>
16#include <kernel/htmlhelp.h>
17#include <sys/cygwin.h>
18#include <stdio.h>
19#ifndef MAXPATHLEN
20#define MAXPATHLEN 1024
21#endif
22
23void heOpenWinHtmlHelp(const char* keyw, char* helppath )
24// API Call Sequence for Microsoft HTML Help System
25{
26  char path[MAXPATHLEN];
27#ifdef TEST
28  printf("keyw:%s\n", keyw);
29#endif
30  cygwin_conv_to_full_win32_path(helppath, path);
31#ifdef TEST
32  printf("path:%s\n", path);
33#endif
34HH_ALINKA link;
35   link.cbStruct =     sizeof(HH_ALINKA) ;
36   link.fReserved =    FALSE ;
37   link.pszKeywords =  keyw;
38   link.pszUrl =       NULL ;
39   link.pszMsgText =   NULL ;
40   link.pszMsgTitle =  NULL ;
41   link.pszWindow =    NULL ;
42   link.fIndexOnFail = TRUE ;
43  HtmlHelpA(NULL, path, HH_KEYWORD_LOOKUP, (DWORD)&link);
44}
45
46void heOpenWinntHlp(const char* keyw, char* helppath )
47{
48  char path[MAXPATHLEN];
49#ifdef TEST
50  printf("keyw:%s\n", keyw);
51#endif
52  cygwin_conv_to_full_win32_path(helppath, path);
53#ifdef TEST
54  printf("path:%s\n", path);
55#endif
56      WinHelp(NULL, path, HELP_PARTIALKEY,(DWORD)keyw);
57}
58
59void heOpenWinntUrl(const char* url, int local)
60{
61#ifdef TEST
62  printf("url:%s:local:%d\n", url, local);
63#endif
64  if (local)
65  {
66    char path[MAXPATHLEN];
67    char *p;
68    cygwin_conv_to_full_win32_path(url, path);
69    /* seems like I can not open url's wit # at the end */
70    if ((p=strchr(path, '#')) != NULL) *p = '\0';
71#ifdef TEST
72    printf("path:%s:local:%d\n", path, local);
73#endif
74    ShellExecute(NULL, "open", path, 0, 0, SW_SHOWNORMAL);
75  }
76  else
77  {
78    // need to check whether this works
79    ShellExecute(NULL, "open", url, 0, 0, SW_SHOWNORMAL);
80  }
81}
82
83void *dynl_open(char *filename)
84{
85  char path[MAXPATHLEN];
86  cygwin_conv_to_full_win32_path(filename, path);
87  HINSTANCE hLibrary = LoadLibrary( TEXT(path));
88
89  return(hLibrary);
90}
91
92void *dynl_sym(void *handle, char *symbol)
93{
94  FARPROC f;
95  f = GetProcAddress((HINSTANCE)handle, TEXT (symbol));
96  return((void*) f);
97}
98
99int dynl_close (void *handle)
100{
101  FreeLibrary((HINSTANCE)handle);
102  return(0);
103}
104
105const char *dynl_error()
106{
107  static char errmsg[] = "support for dynamic loading not implemented";
108
109  return errmsg;
110}
111
112#endif /*ix86_Win */
Note: See TracBrowser for help on using the repository browser.