File: hpux-foreign.h

package info (click to toggle)
xlispstat 3.52.0-3
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 7,472 kB
  • ctags: 12,480
  • sloc: ansic: 89,534; lisp: 21,690; sh: 1,525; makefile: 520; csh: 1
file content (41 lines) | stat: -rw-r--r-- 903 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#define SHLIB_DYNLOAD

#define INTERNAL_CNAME_PATTERN "%s"
#define INTERNAL_FNAME_PATTERN "%s" /**** check this */
#define VERBDFLT TRUE

LOCAL VOID link_and_load _((char *fname, char *libs, int fort));
LOCAL char *get_caddress _((char *name));

#include <dl.h>

/**** This code ought to cache the addresses found, but I won't bother
until I revise the way dynamic loading works */

LOCAL VOID link_and_load(fname, libs, fort)
     char *fname, *libs;
     int fort;
{
  shl_t handle;
  
  handle = shl_load(fname, BIND_DEFERRED, 0L);
  if (handle == NULL) {
    sprintf(buf, "can't open %s", fname);
    xlfail(buf);
  }
}

LOCAL char *get_caddress(name)
     char *name;
{
  shl_t handle;
  char *f;

  handle = NULL;
  if (shl_findsym(&handle, name, TYPE_PROCEDURE, &f) != 0) {
    handle = PROG_HANDLE;
    if (shl_findsym(&handle, name, TYPE_PROCEDURE, &f) != 0)
      f = NULL;
  }
  return(f);
}