PageRenderTime 267ms CodeModel.GetById 142ms app.highlight 9ms RepoModel.GetById 112ms app.codeStats 0ms

/PC/os2emx/dllentry.c

http://unladen-swallow.googlecode.com/
C | 42 lines | 27 code | 10 blank | 5 comment | 2 complexity | 7bc8833437056cd680854f7d3564dfca MD5 | raw file
 1/*
 2 * This is the entry point for the Python 2.3 core DLL.
 3 */
 4
 5#define NULL 0
 6
 7#define REF(s)	extern void s(); void *____ref_##s = &s;
 8
 9/* Make references to imported symbols to pull them from static library */
10REF(Py_Main);
11
12#include <signal.h>
13
14extern int _CRT_init(void);
15extern void _CRT_term(void);
16extern void __ctordtorInit(void);
17extern void __ctordtorTerm(void);
18
19unsigned long _DLL_InitTerm(unsigned long mod_handle, unsigned long flag)
20{
21	switch (flag)
22	{
23		case 0:
24			if (_CRT_init())
25				return 0;
26			__ctordtorInit();
27
28			/* Ignore fatal signals */
29			signal(SIGSEGV, SIG_IGN);
30			signal(SIGFPE, SIG_IGN);
31
32			return 1;
33
34		case 1:
35			__ctordtorTerm();
36			_CRT_term();
37			return 1;
38
39		default:
40			return 0;
41	}
42}