Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/branches/num64/runtime/c-libs/dl/dlclose.c
ViewVC logotype

View of /sml/branches/num64/runtime/c-libs/dl/dlclose.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5253 - (download) (as text) (annotate)
Sat Jun 1 21:11:08 2019 UTC (2 months, 3 weeks ago) by jhr
File size: 730 byte(s)
Word64 as LargeWord
/*! \file dlclose.c
 *
 * COPYRIGHT (c) 2019 The Fellowship of SML/NJ (http://www.smlnj.org)
 * All rights reserved.
 */

#ifdef OPSYS_WIN32
# include <windows.h>
#else
# include "ml-unixdep.h"
# include <dlfcn.h>
#endif
#include "ml-base.h"
#include "ml-values.h"
#include "ml-objects.h"
#include "ml-c.h"
#include "cfun-proto-list.h"

/* 64BIT: Need SML type that represents machine address */
/* _ml_P_Dynload_dlclose : Word32.word -> unit
 *
 * Close dynamically loaded library.
 */
ml_val_t _ml_U_Dynload_dlclose (ml_state_t *msp, ml_val_t ml_handle)
{
    void *handle = (void *) (WORD_MLtoC (ml_handle));

#ifdef OPSYS_WIN32
    (void) FreeLibrary (handle);
#else
    (void) dlclose (handle);
#endif

    return ML_unit;
}

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0