ammer

Interface

The main points of interaction with ammer-core are:

Platform

A Platform represents one of ammer/ammer-core targets. It can be constructed by calling ammer.core.Platform.createCurrentPlatform, or by directly calling a constructor of one of the ammer.core.plat.* types. The constructor takes a platform configuration, which is a class that contains at least the fields defined in ammer.core.plat.BaseConfig, but may contain more (required) fields: see ammer.core.plat.(Platform).(Platform)Config.

Platforms are used to create libraries with the createLibrary method. Once a library is finished (all its types and functions are declared), it is given to the platform with addLibrary. Finally, the finalise method returns a build program to be used by the builder.

Library

A Library represents a set of types and functions that will be compiled as one unit into a dynamic library (.dll, .dylib, .so).

As mentioned above, a Library is obtained from a platform using createLibrary: this function takes a library configuration object. This is a class that contains at least the fields defined in ammer.core.LibraryConfig, but platforms may add more fields, see ammer.core.plat.(Platform).(Platform)LibraryConfig.

Libraries contain a reference to a marshal object, and can have code added to them using these functions:

Marshal

Marshal is the class that defines how values are marshalled (passed through) between Haxe and C. It has methods for each kind of type that ammer-core understands. These methods return instances of TypeMarshal, which can then be passed to functions such as addFunction to define signatures of functions.

Builder

A Builder represents a build system, such as GCC or MSVC, that is used to execute the build steps returned by finalising a platform, with the build function.

« Previous: ammer-core Next: Implementing new platforms »