/* close Swiss Ephemeris */ static PyObject* astrology_swe_close(PyObject *self, PyObject *args) { swe_close(); Py_INCREF(Py_None); return Py_None; }
int PASCAL WinMain( HANDLE this_inst, HANDLE prev_inst, LPSTR cmdline, int cmdshow ) /*******************************/ { MSG msg; HWND hwnd; WNDCLASS wndclass; char *argv0 = ""; cmdline = cmdline; /* shut up compiler warning */ prev_inst = prev_inst; #ifdef __WINDOWS_386__ sprintf( classname,"SwewinClass%d", this_inst ); #else if( !prev_inst ) { #endif wndclass.style = CS_HREDRAW | CS_VREDRAW; wndclass.lpfnWndProc = (LPVOID) WindowProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 6 * sizeof( DWORD ); wndclass.hInstance = this_inst; wndclass.hIcon = LoadIcon(this_inst, IDI_APPLICATION); wndclass.hCursor = LoadCursor( NULL, IDC_ARROW ); wndclass.hbrBackground = (HBRUSH) COLOR_BACKGROUND; wndclass.lpszMenuName = "sweph_menu"; wndclass.lpszClassName = classname; RegisterClass( &wndclass ); #ifndef __WINDOWS_386__ } #endif hwnd = CreateWindow( classname, progname, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 340, 200, NULL, NULL, this_inst, NULL ); ShowWindow( hwnd, cmdshow ); UpdateWindow( hwnd ); init_data(); if (make_ephemeris_path(SEFLG_SWIEPH | SEFLG_SPEED, argv0) == ERR) { MessageBox(hwnd, "error in make_ephemeris_path()", progname, MB_OK); exit(1); } #if 0 { char serr[AS_MAXCH]; if (find_ephemeris_path(0, argv0, serr) == ERR) { MessageBox(hwnd, serr, progname, MB_OK); exit(1); } } #endif while( GetMessage( &msg, NULL, (UINT) NULL, (UINT) NULL ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } /* close open files and free allocated space */ swe_close(); return( msg.wParam ); } /* WinMain */
void placalc_close_files() { swe_close(); }
SweWrapper::~SweWrapper() { swe_close(); }