source: git/kernel/sing_win.cc @ 6b9532

spielwiese
Last change on this file since 6b9532 was 35aab3, checked in by Hans Schönemann <hannes@…>, 21 years ago
This commit was generated by cvs2svn to compensate for changes in r6879, which included commits to RCS files with non-trunk default branches. git-svn-id: file:///usr/local/Singular/svn/trunk@6880 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.5 KB
Line 
1#include "mod2.h"
2#ifdef ix86_Win
3#include <windows.h>
4#include <winuser.h>
5#include <sys/cygwin.h>
6#include <stdio.h>
7#ifndef MAXPATHLEN
8#define MAXPATHLEN 1024
9#endif
10
11void heOpenWinntHlp(const char* keyw, char* helppath )
12{
13  char path[MAXPATHLEN];
14#ifdef TEST
15  printf("keyw:%s\n", keyw);
16#endif
17  cygwin_conv_to_full_win32_path(helppath, path);
18#ifdef TEST
19  printf("path:%s\n", path);
20#endif
21      WinHelp(NULL, path, HELP_PARTIALKEY,(DWORD)keyw);
22}
23
24void heOpenWinntUrl(const char* url, int local)
25{
26#ifdef TEST
27  printf("url:%s:local:%d\n", url, local);
28#endif
29  if (local)
30  {
31    char path[MAXPATHLEN];
32    char *p;
33    cygwin_conv_to_full_win32_path(url, path);
34    /* seems like I can not open url's wit # at the end */
35    if ((p=strchr(path, '#')) != NULL) *p = '\0';
36#ifdef TEST
37    printf("path:%s:local:%d\n", path, local);
38#endif
39    ShellExecute(NULL, "open", path, 0, 0, SW_SHOWNORMAL);
40  }
41  else
42  {
43    // need to check whether this works
44    ShellExecute(NULL, "open", url, 0, 0, SW_SHOWNORMAL);
45  }
46}
47
48void *dynl_open(char *filename)
49{
50  char path[MAXPATHLEN];
51  cygwin_conv_to_full_win32_path(filename, path);
52  HINSTANCE hLibrary = LoadLibrary( TEXT(path));
53
54  return(hLibrary);
55}
56
57void *dynl_sym(void *handle, char *symbol)
58{
59  FARPROC f;
60  f = GetProcAddress((HINSTANCE)handle, TEXT (symbol));
61  return(f);
62}
63
64int dynl_close (void *handle)
65{
66  FreeLibrary((HINSTANCE)handle);
67  return(0);
68}
69
70const char *dynl_error()
71{
72  static char errmsg[] = "support for dynamic loading not implemented";
73
74  return errmsg;
75}
76
77#endif /*ix86_Win */
Note: See TracBrowser for help on using the repository browser.