![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||
AROS Application Development ManualModulesIntroductionModules are shared binaries. Their main purpose is to deliver tables of functions and classes for object oriented access to GUI elements and multimedia data. Building modules consists of two parts. First is a macro to use in mmakefile.src files. Another is a configuration file that describes the contents of the module. MetamakeThe build system has the macro "build_module" for the task of creating modules. The parameters are:
Module Types
Configuration FileThe build system calls the tool "genmodule" in order to create some additional C source and header files. This tool is driven be a configuration file which allows to set a lot of options for the fine tuning if the generated files. Configuration files contain named sections with definitions: ##begin <sectionname> <definitions> ##end <sectionname> Sectionname can be "config", "class", "cdefprivate", "cdef", "functionlist" or "methodlist". Section "config"The lines in this section have all the same format: optionname string with the string starting from the first non white-space after optionname to the last non white-space character on that line.
section "class"You need "class" sections only when you want to define additional classes in your module. If you create a module for e.g. a gadget a class for a gadget is automatically created. This means you can use the definitions below in the "config" section.
Section "cdef"In this section all the C code has to be written that will declare all the type of the arguments of the function listed in the function. All valid C code is possible including the use of #include. Section "cdefprivate"Like "cdef" but for all declarations which must not be visible for the module user. Section "functionlist"In this section are all the functions that are externally accessible by programs. For stack based argument passing only a list of the functions has to be given: ##begin functionlist void func1(LONG a, LONG b) int func2(char *s, ULONG a) ##end functionlist For register based argument passing the names of the register have to be given between rounded brackets: ##begin functionlist ULONG func5(ULONG a, STRPTR b) (D0,A0) ##end functionlist There are some tags which influence the previously defined function.
Section "methodlist"Here you can list all you methods for an automatic creation of a dispatcher. The real function name for a method "name" must become <basename>__<name> in the source code. There are some tags which influence the previously defined method.
DefaultsModules
Classes
|
Copyright © 1995-2009, L'équipe de développement AROS. Tous droits réservés. Amiga®, AmigaOS®, Workbench et Intuition sont des marques de Amiga Inc. Les autres marques appartiennent à leur propritaires respectifs. |