/usr/lib/mlton/include/common-main.h is in mlton-basis 20100608-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | /* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
* Copyright (C) 1997-2000 NEC Research Institute.
*
* MLton is released under a BSD-style license.
* See the file MLton-LICENSE for details.
*/
#ifndef _COMMON_MAIN_H_
#define _COMMON_MAIN_H_
#include "mlton-main.h"
#define MLTON_GC_INTERNAL_TYPES
#define MLTON_GC_INTERNAL_BASIS
#include "platform.h"
/* The label must be declared as weak because gcc's optimizer may prove that
* the code that declares the label is dead and hence eliminate the declaration.
*/
#define DeclareProfileLabel(l) \
extern char l __attribute__ ((weak))
#define BeginIntInfInits static struct GC_intInfInit intInfInits[] = {
#define IntInfInitElem(g, n) { g, n },
#define EndIntInfInits };
#define BeginVectorInits static struct GC_vectorInit vectorInits[] = {
#define VectorInitElem(a, b, c, d) { (pointer)a, b, c, d },
#define EndVectorInits };
#define LoadArray(a, f) if (fread (a, sizeof(*a), cardof(a), f) != cardof(a)) return -1;
#define SaveArray(a, f) if (fwrite(a, sizeof(*a), cardof(a), f) != cardof(a)) return -1;
PRIVATE Pointer gcStateAddress;
#define Initialize(al, mg, mfs, mmc, pk, ps) \
gcStateAddress = (pointer)&gcState; \
gcState.alignment = al; \
gcState.atMLtons = atMLtons; \
gcState.atMLtonsLength = cardof(atMLtons); \
gcState.frameLayouts = frameLayouts; \
gcState.frameLayoutsLength = cardof(frameLayouts); \
gcState.globals = (objptr*)globalObjptr; \
gcState.globalsLength = cardof(globalObjptr); \
gcState.intInfInits = intInfInits; \
gcState.intInfInitsLength = cardof(intInfInits); \
gcState.loadGlobals = loadGlobals; \
gcState.magic = mg; \
gcState.maxFrameSize = mfs; \
gcState.mutatorMarksCards = mmc; \
gcState.objectTypes = objectTypes; \
gcState.objectTypesLength = cardof(objectTypes); \
gcState.returnAddressToFrameIndex = returnAddressToFrameIndex; \
gcState.saveGlobals = saveGlobals; \
gcState.vectorInits = vectorInits; \
gcState.vectorInitsLength = cardof(vectorInits); \
gcState.sourceMaps.frameSources = frameSources; \
gcState.sourceMaps.frameSourcesLength = cardof(frameSources); \
gcState.sourceMaps.sourceLabels = sourceLabels; \
gcState.sourceMaps.sourceLabelsLength = cardof(sourceLabels); \
gcState.sourceMaps.sourceNames = sourceNames; \
gcState.sourceMaps.sourceNamesLength = cardof(sourceNames); \
gcState.sourceMaps.sourceSeqs = sourceSeqs; \
gcState.sourceMaps.sourceSeqsLength = cardof(sourceSeqs); \
gcState.sourceMaps.sources = sources; \
gcState.sourceMaps.sourcesLength = cardof(sources); \
gcState.profiling.kind = pk; \
gcState.profiling.stack = ps; \
MLton_init (argc, argv, &gcState); \
#define LIB_PASTE(x,y) x ## y
#define LIB_OPEN(x) LIB_PASTE(x, _open)
#define LIB_CLOSE(x) LIB_PASTE(x, _close)
static void MLton_callFromC ();
#endif /* #ifndef _COMMON_MAIN_H_ */
|