summaryrefslogtreecommitdiff
path: root/src/main/Overload.c
blob: a6b7e50feb0d1a90b63c44d7c967da9f67b80686 (plain)
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
79
80
81
82
83
 /*@@
   @file      Overload.c
   @date      Thu Feb  4 09:01:18 1999
   @author    Tom Goodale
   @desc 
   Contains routines to overload the main functions.
   Uses the overload macros to make sure of consistency and
   to save typing !
   @enddesc 
 @@*/

#include <stdio.h>
#include <stdlib.h>

#include "flesh.h"
#include "OverloadMacros.h"

static char *rcsid="$Header$";

/* Define the prototypes for the dummy functions. */
#define OVERLOADABLE(name) OVERLOADABLE_DUMMYPROTOTYPE(name)

  /* These ones actually have defaults. */
#define CCTK_DummyInitialise  CactusDefaultInitialise
#define CCTK_DummyEvolve      CactusDefaultEvolve
#define CCTK_DummyShutdown    CactusDefaultShutdown

#include "MainOverloadables.h"

  /* Reset the #define to prevent complications. */
#undef CCTK_DummyInitialise 
#undef CCTK_DummyEvolve     
#undef CCTK_DummyShutdown   

#undef OVERLOADABLE(name)


/* Create the overloadable function variables and the 
 * functions allowing the variables to be set.
 */
#define OVERLOADABLE(name) OVERLOADABLE_FUNCTION(name)

#include "MainOverloadables.h"

#undef OVERLOADABLE(name)

 /*@@
   @routine    SetupMainFunctions
   @date       Thu Feb  4 09:02:49 1999
   @author     Tom Goodale
   @desc 
   Set any main function which hasn't been overloaded to the default.
   @enddesc 
   @calls     
   @calledby   
   @history 
 
   @endhistory 

@@*/
int SetupMainFunctions(void)
{

#define OVERLOADABLE(name) OVERLOADABLE_CHECK(name)

  /* These ones actually have defaults. */
#define CCTK_DummyInitialise  CactusDefaultInitialise
#define CCTK_DummyEvolve      CactusDefaultEvolve
#define CCTK_DummyShutdown    CactusDefaultShutdown

#include "MainOverloadables.h"

  /* Reset the #define to prevent complications. */
#undef CCTK_DummyInitialise 
#undef CCTK_DummyEvolve     
#undef CCTK_DummyShutdown   

#undef OVERLOADABLE(name)

  return 0;
}