BPicture: Fix archive constructor.
[haiku.git] / src / kits / app / InitTerminateLibBe.cpp
blob03f4a02e4293311616c17cc104ba730d7d7beb39
1 /*
2 * Copyright 2001-2011, Haiku.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Ingo Weinhold (bonefish@users.sf.net)
7 */
9 //! Global library initialization/termination routines.
12 #include <stdio.h>
13 #include <stdlib.h>
15 #include <AppMisc.h>
16 #include <LooperList.h>
17 #include <MessagePrivate.h>
18 #include <RosterPrivate.h>
19 #include <TokenSpace.h>
22 extern void __initialize_locale_kit();
25 // debugging
26 //#define DBG(x) x
27 #define DBG(x)
28 #define OUT printf
31 static void
32 initialize_forked_child()
34 DBG(OUT("initialize_forked_child()\n"));
36 BMessage::Private::StaticReInitForkedChild();
37 BPrivate::gLooperList.InitAfterFork();
38 BPrivate::gDefaultTokens.InitAfterFork();
39 BPrivate::init_team_after_fork();
41 DBG(OUT("initialize_forked_child() done\n"));
45 extern "C" void
46 initialize_before()
48 DBG(OUT("initialize_before()\n"));
50 BMessage::Private::StaticInit();
51 BRoster::Private::InitBeRoster();
53 atfork(initialize_forked_child);
55 DBG(OUT("initialize_before() done\n"));
59 extern "C" void
60 initialize_after()
62 DBG(OUT("initialize_after()\n"));
64 __initialize_locale_kit();
66 DBG(OUT("initialize_after() done\n"));
70 extern "C" void
71 terminate_after()
73 DBG(OUT("terminate_after()\n"));
75 BRoster::Private::DeleteBeRoster();
76 BMessage::Private::StaticCleanup();
77 BMessage::Private::StaticCacheCleanup();
79 DBG(OUT("terminate_after() done\n"));