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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/runtime/include/c-library.h
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (view) (download) (as text)

1 : monnier 249 /* c-library.h
2 :     *
3 :     * COPYRIGHT (c) 1994 AT&T Bell Laboratories.
4 :     */
5 :    
6 :     #ifndef _C_LIBRARY_
7 :     #define _C_LIBRARY_
8 :    
9 :     /* a pointer to a library initialization function; it is passed the
10 :     * list of command-line arguments.
11 :     */
12 :     typedef void (*clib_init_fn_t) (int, char **);
13 :    
14 :     /* a pointer to an ML callable C function */
15 :     typedef ml_val_t (*cfunc_t) (ml_state_t *, ml_val_t);
16 :    
17 :     /* an element in the table of name/function pairs. */
18 :     typedef struct {
19 :     const char *name;
20 :     cfunc_t cfunc;
21 :     } cfunc_binding_t;
22 :    
23 :     /* The representation of a library of ML callable C functions */
24 :     typedef struct {
25 :     const char *libName; /* the library name */
26 :     const char *version;
27 :     const char *date;
28 :     clib_init_fn_t initFn; /* an optional initialization function */
29 :     cfunc_binding_t *cfuns; /* the list of C function bindings, which is */
30 :     /* terminated by {0, 0}. */
31 :     } c_library_t;
32 :    
33 :    
34 :     /* A C function prototype declaration */
35 :     #define CFUNC_PROTO(NAME, FUNC, MLTYPE) \
36 :     extern ml_val_t FUNC (ml_state_t *msp, ml_val_t arg);
37 :    
38 :     /* A C function binding */
39 :     #define CFUNC_BIND(NAME, FUNC, MLTYPE) \
40 :     { NAME, FUNC },
41 :    
42 :     /* the terminator for a C function list */
43 :     #define CFUNC_NULL_BIND { NIL(const char *), NIL(cfunc_t) }
44 :    
45 :     #endif /* !_C_LIBRARY_ */

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