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/trunk/src/runtime/include/c-library.h
ViewVC logotype

View of /sml/trunk/src/runtime/include/c-library.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 250 - (download) (as text) (annotate)
Sat Apr 17 18:57:03 1999 UTC (20 years, 6 months ago) by monnier
File size: 1248 byte(s)
This commit was generated by cvs2svn to compensate for changes in r249,
which included commits to RCS files with non-trunk default branches.
/* c-library.h
 *
 * COPYRIGHT (c) 1994 AT&T Bell Laboratories.
 */

#ifndef _C_LIBRARY_
#define _C_LIBRARY_

/* a pointer to a library initialization function; it is passed the
 * list of command-line arguments.
 */
typedef void (*clib_init_fn_t) (int, char **);

/* a pointer to an ML callable C function */
typedef ml_val_t (*cfunc_t) (ml_state_t *, ml_val_t);

/* an element in the table of name/function pairs. */
typedef struct {
    const char	    *name;
    cfunc_t	    cfunc;
} cfunc_binding_t;

/* The representation of a library of ML callable C functions */
typedef struct {
    const char	    *libName;	/* the library name */
    const char	    *version;
    const char	    *date;
    clib_init_fn_t  initFn;	/* an optional initialization function */
    cfunc_binding_t *cfuns;	/* the list of C function bindings, which is */
				/* terminated by {0, 0}. */
} c_library_t;


/* A C function prototype declaration */
#define CFUNC_PROTO(NAME, FUNC, MLTYPE)	\
	extern ml_val_t FUNC (ml_state_t *msp, ml_val_t arg);

/* A C function binding */
#define CFUNC_BIND(NAME, FUNC, MLTYPE)	\
    { NAME, FUNC },

/* the terminator for a C function list */
#define CFUNC_NULL_BIND		{ NIL(const char *), NIL(cfunc_t) }

#endif /* !_C_LIBRARY_ */

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