xref: /haiku/headers/build/private/app/AppMisc.h (revision 2846db2e997b3bcd4e8e22fce7e5ac55ce8baa18)
1 /*
2  * Copyright 2001-2019 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Ingo Weinhold, bonefish@users.sf.net
7  *		Jacob Secunda
8  */
9 
10 #ifndef _APP_MISC_H
11 #define _APP_MISC_H
12 
13 #include <Handler.h>
14 #include <OS.h>
15 #include <SupportDefs.h>
16 
17 struct entry_ref;
18 
19 namespace BPrivate {
20 
21 status_t get_app_path(team_id team, char *buffer);
22 status_t get_app_path(char *buffer);
23 status_t get_app_ref(team_id team, entry_ref *ref, bool traverse = true);
24 status_t get_app_ref(entry_ref *ref, bool traverse = true);
25 
26 team_id current_team();
27 thread_id main_thread_for(team_id team);
28 
29 bool is_running_on_haiku();
30 
31 } // namespace BPrivate
32 
33 // _get_object_token_
34 /*!	Return the token of a BHandler.
35 
36 	\param handler The BHandler.
37 	\return the token.
38 
39 */
_get_object_token_(const BHandler * object)40 inline int32 _get_object_token_(const BHandler* object)
41 	{ return object->fToken; }
42 
43 #endif	// _APP_MISC_H
44