/[guile]/guile/guile-core/libguile/dynl.c
ViewVC logotype

Diff of /guile/guile-core/libguile/dynl.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.75 by hanwen, Sun Aug 4 14:09:14 2002 UTC revision 1.76 by mvo, Thu Oct 3 22:44:48 2002 UTC
# Line 1  Line 1 
1  /* dynl.c - dynamic linking  /* dynl.c - dynamic linking
2   *   *
3   * Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc.   * Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc.
4   *   *
5   * This program is free software; you can redistribute it and/or modify   * This program is free software; you can redistribute it and/or modify
6   * it under the terms of the GNU General Public License as published by   * it under the terms of the GNU General Public License as published by
# Line 91  static void * Line 91  static void *
91  sysdep_dynl_link (const char *fname, const char *subr)  sysdep_dynl_link (const char *fname, const char *subr)
92  {  {
93    lt_dlhandle handle;    lt_dlhandle handle;
94    handle = lt_dlopenext (fname);    handle = scm_lt_dlopenext (fname);
95    if (NULL == handle)    if (NULL == handle)
96      {      {
97        SCM fn;        SCM fn;
98        SCM msg;        SCM msg;
99    
100        fn = scm_makfrom0str (fname);        fn = scm_makfrom0str (fname);
101        msg = scm_makfrom0str (lt_dlerror ());        msg = scm_makfrom0str (scm_lt_dlerror ());
102        scm_misc_error (subr, "file: ~S, message: ~S", scm_list_2 (fn, msg));        scm_misc_error (subr, "file: ~S, message: ~S", scm_list_2 (fn, msg));
103      }      }
104    return (void *) handle;    return (void *) handle;
# Line 107  sysdep_dynl_link (const char *fname, con Line 107  sysdep_dynl_link (const char *fname, con
107  static void  static void
108  sysdep_dynl_unlink (void *handle, const char *subr)  sysdep_dynl_unlink (void *handle, const char *subr)
109  {  {
110    if (lt_dlclose ((lt_dlhandle) handle))    if (scm_lt_dlclose ((lt_dlhandle) handle))
111      {      {
112        scm_misc_error (subr, (char *) lt_dlerror (), SCM_EOL);        scm_misc_error (subr, (char *) scm_lt_dlerror (), SCM_EOL);
113      }      }
114  }  }
115        
# Line 118  sysdep_dynl_func (const char *symb, void Line 118  sysdep_dynl_func (const char *symb, void
118  {  {
119    void *fptr;    void *fptr;
120    
121    fptr = lt_dlsym ((lt_dlhandle) handle, symb);    fptr = scm_lt_dlsym ((lt_dlhandle) handle, symb);
122    if (!fptr)    if (!fptr)
123      {      {
124        scm_misc_error (subr, (char *) lt_dlerror (), SCM_EOL);        scm_misc_error (subr, (char *) scm_lt_dlerror (), SCM_EOL);
125      }      }
126    return fptr;    return fptr;
127  }  }
# Line 129  sysdep_dynl_func (const char *symb, void Line 129  sysdep_dynl_func (const char *symb, void
129  static void  static void
130  sysdep_dynl_init ()  sysdep_dynl_init ()
131  {  {
132    lt_dlinit ();    scm_lt_dlinit ();
133  }  }
134    
135  scm_t_bits scm_tc16_dynamic_obj;  scm_t_bits scm_tc16_dynamic_obj;

Legend:
Removed from v.1.75  
changed lines
  Added in v.1.76

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26