| 1 |
(* M2Scaffold.def declare and create scaffold entities. |
| 2 |
|
| 3 |
Copyright (C) 2022-2025 Free Software Foundation, Inc. |
| 4 |
Contributed by Gaius Mulley <[email protected]>. |
| 5 |
|
| 6 |
This file is part of GNU Modula-2. |
| 7 |
|
| 8 |
GNU Modula-2 is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation; either version 3, or (at your option) |
| 11 |
any later version. |
| 12 |
|
| 13 |
GNU Modula-2 is distributed in the hope that it will be useful, but |
| 14 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 |
General Public License for more details. |
| 17 |
|
| 18 |
You should have received a copy of the GNU General Public License |
| 19 |
along with GNU Modula-2; see the file COPYING3. If not see |
| 20 |
<http://www.gnu.org/licenses/>. *) |
| 21 |
|
| 22 |
DEFINITION MODULE M2Scaffold ; |
| 23 |
|
| 24 |
|
| 25 |
VAR |
| 26 |
ctorArray, |
| 27 |
linkFunction, |
| 28 |
finiFunction, |
| 29 |
initFunction, |
| 30 |
mainFunction: CARDINAL ; |
| 31 |
|
| 32 |
|
| 33 |
(* |
| 34 |
DeclareScaffold - declare scaffold related entities. |
| 35 |
*) |
| 36 |
|
| 37 |
PROCEDURE DeclareScaffold (tokno: CARDINAL) ; |
| 38 |
|
| 39 |
|
| 40 |
(* |
| 41 |
DeclareArgEnvParams - declares (int argc, void *argv, void *envp) |
| 42 |
*) |
| 43 |
|
| 44 |
PROCEDURE DeclareArgEnvParams (tokno: CARDINAL; proc: CARDINAL) ; |
| 45 |
|
| 46 |
|
| 47 |
(* |
| 48 |
PopulateCtorArray - assign each element of the ctorArray to the external module ctor. |
| 49 |
This is only used to force the linker to pull in the ctors from |
| 50 |
a library. |
| 51 |
*) |
| 52 |
|
| 53 |
PROCEDURE PopulateCtorArray (tok: CARDINAL) ; |
| 54 |
|
| 55 |
|
| 56 |
(* |
| 57 |
ForeachModuleCallInit - precondition: the module list will be ordered. |
| 58 |
postcondition: foreach module in the application universe |
| 59 |
call _M2_module_init (argc, argv, envp); |
| 60 |
*) |
| 61 |
|
| 62 |
PROCEDURE ForeachModuleCallInit (tok: CARDINAL; argc, argv, envp: CARDINAL) ; |
| 63 |
|
| 64 |
|
| 65 |
(* |
| 66 |
ForeachModuleCallFinish - precondition: the module list will be ordered. |
| 67 |
postcondition: foreach module in the application universe |
| 68 |
call _M2_module_finish (argc, argv, envp); |
| 69 |
*) |
| 70 |
|
| 71 |
PROCEDURE ForeachModuleCallFinish (tok: CARDINAL; argc, argv, envp: CARDINAL) ; |
| 72 |
|
| 73 |
|
| 74 |
END M2Scaffold. |