xref: /haiku/src/kits/app/InitTerminateLibBe.cpp (revision 16d5c24e533eb14b7b8a99ee9f3ec9ba66335b1e)
1 /*
2  * Copyright 2001-2005, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Ingo Weinhold (bonefish@users.sf.net)
7  */
8 
9 //!	Global library initialization/termination routines.
10 
11 
12 #include <stdio.h>
13 
14 #include <ClipboardPrivate.h>
15 #include <MessagePrivate.h>
16 #include <RosterPrivate.h>
17 
18 
19 // debugging
20 //#define DBG(x) x
21 #define DBG(x)
22 #define OUT	printf
23 
24 
25 extern "C" void
26 initialize_before()
27 {
28 	DBG(OUT("initialize_before()\n"));
29 
30 	BMessage::Private::StaticInit();
31 	BRoster::Private::InitBeRoster();
32 
33 	DBG(OUT("initialize_before() done\n"));
34 }
35 
36 
37 extern "C" void
38 initialize_after()
39 {
40 	DBG(OUT("initialize_after()\n"));
41 
42 	BPrivate::init_clipboard();
43 		// needs to send a message, and that requires gDefaultTokens to be initialized
44 
45 	DBG(OUT("initialize_after() done\n"));
46 }
47 
48 
49 extern "C" void
50 terminate_after()
51 {
52 	DBG(OUT("terminate_after()\n"));
53 
54 	BRoster::Private::DeleteBeRoster();
55 	BMessage::Private::StaticCleanup();
56 	BMessage::Private::StaticCacheCleanup();
57 
58 	DBG(OUT("terminate_after() done\n"));
59 }
60 
61