00001
00010 #include <stdlib.h>
00011 #include <stdio.h>
00012 #include <errno.h>
00013 #include <math.h>
00014
00015
00016 #define _NETWORK_GLOBALS
00017 #include "network.h"
00018 #undef _NETWORK_GLOBALS
00019
00020 EXPORT CLASS *init(CALLBACKS *fntable, MODULE *module, int argc, char *argv[])
00021 {
00022 #ifdef _DEBUG
00023
00024 #endif // _DEBUG
00025
00026 if (set_callback(fntable)==NULL)
00027 {
00028 errno = EINVAL;
00029 return NULL;
00030 }
00031
00032 #ifdef HAVE_POWERWORLD
00033 #ifndef PWX64
00034 int status = gl_global_setvar("run_powerworld=true");
00035 CLASS *first = (new pw_model(module))->oclass;
00036 new pw_load(module);
00037 new pw_recorder(module);
00038
00039 #else
00040 CLASS *first = NULL;
00041 #endif
00042 #else
00043 CLASS *first = NULL;
00044 #endif
00045 return first;
00046
00047 }
00048
00049
00050
00051
00052 EXPORT void term(void)
00053 {
00054 #ifdef HAVE_POWERWORLD
00055 #ifndef PWX64
00056 pw_model *temp_model;
00057
00058 if (startedCOM)
00059 {
00060
00061 temp_model = OBJECTDATA(initiatorCOM,pw_model);
00062
00063
00064 temp_model->pw_close_COM();
00065
00066 gl_verbose("network: closed out COM connection");
00067 }
00068 #endif //PWX64
00069 #endif //HAVE_POWERWORLD
00070 }
00071
00072 CDECL int do_kill()
00073 {
00074
00075 return 0;
00076 }
00077