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
17struct entry_ref;
18
19namespace BPrivate {
20
21status_t get_app_path(team_id team, char *buffer);
22status_t get_app_path(char *buffer);
23status_t get_app_ref(team_id team, entry_ref *ref, bool traverse = true);
24status_t get_app_ref(entry_ref *ref, bool traverse = true);
25
26team_id current_team();
27thread_id main_thread_for(team_id team);
28
29bool 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*/
40inline int32 _get_object_token_(const BHandler* object)
41	{ return object->fToken; }
42
43#endif	// _APP_MISC_H
44