00001 00008 #include <stdlib.h> 00009 #include <stdio.h> 00010 #include <errno.h> 00011 #include <math.h> 00012 #include "residential.h" 00013 00014 #include "house.h" 00015 #include "clotheswasher.h" 00016 #include "dishwasher.h" 00017 #include "lights.h" 00018 #include "microwave.h" 00019 #include "occupantload.h" 00020 #include "plugload.h" 00021 #include "range.h" 00022 #include "refrigerator.h" 00023 #include "waterheater.h" 00024 00025 //CDECL CLASS *house_class; 00026 00027 EXPORT CLASS *init(CALLBACKS *fntable, MODULE *module, int argc, char *argv[]) 00028 { 00029 if (set_callback(fntable)==NULL) 00030 { 00031 errno = EINVAL; 00032 return NULL; 00033 } 00034 00035 house *house_class = new house(module); 00036 new waterheater(module); 00037 new lights(module); 00038 // new refrigerator(module); // Model not implemented 00039 new clotheswasher(module); 00040 new dishwasher(module); 00041 new occupantload(module); 00042 new plugload(module); 00043 new microwave(module); 00044 new range(module); 00045 00046 00047 /* always return the first class registered */ 00048 return house_class->oclass; 00049 } 00050 00051 CDECL int do_kill() 00052 { 00053 /* if global memory needs to be released, this is a good time to do it */ 00054 return 0; 00055 } 00056 00057 EXPORT int check(){ 00058 return 0; 00059 } 00060 00061