VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/VBoxClient/VBoxClient.h@ 81040

Last change on this file since 81040 was 81040, checked in by vboxsync, 6 years ago

Additions/VBoxClient: Revamped and unified local logging infrastructure; cleaned up a lot of different logging styles / ways. Fixed logging memory leaks.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/* $Id: VBoxClient.h 81040 2019-09-27 09:45:46Z vboxsync $ */
2/** @file
3 *
4 * VirtualBox additions user session daemon.
5 */
6
7/*
8 * Copyright (C) 2006-2019 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.215389.xyz. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef GA_INCLUDED_SRC_x11_VBoxClient_VBoxClient_h
20#define GA_INCLUDED_SRC_x11_VBoxClient_VBoxClient_h
21#ifndef RT_WITHOUT_PRAGMA_ONCE
22# pragma once
23#endif
24
25#include <VBox/log.h>
26#include <iprt/cpp/utils.h>
27#include <iprt/string.h>
28
29void VBClLogInfo(const char *pszFormat, ...);
30void VBClLogError(const char *pszFormat, ...);
31void VBClLogFatalError(const char *pszFormat, ...);
32
33/** Call clean-up for the current service and exit. */
34extern void VBClCleanUp(bool fExit = true);
35
36/** A simple interface describing a service. VBoxClient will run exactly one
37 * service per invocation. */
38struct VBCLSERVICE
39{
40 /** Get the services default path to pidfile, relative to $HOME */
41 /** @todo Should this also have a component relative to the X server number?
42 */
43 const char *(*getPidFilePath)(void);
44 /** Special initialisation, if needed. @a pause and @a resume are
45 * guaranteed not to be called until after this returns. */
46 int (*init)(struct VBCLSERVICE **ppInterface);
47 /** Run the service main loop */
48 int (*run)(struct VBCLSERVICE **ppInterface, bool fDaemonised);
49 /** Clean up any global resources before we shut down hard. The last calls
50 * to @a pause and @a resume are guaranteed to finish before this is called.
51 */
52 void (*cleanup)(struct VBCLSERVICE **ppInterface);
53};
54
55/** Default handler for various struct VBCLSERVICE member functions. */
56DECLINLINE(int) VBClServiceDefaultHandler(struct VBCLSERVICE **pSelf)
57{
58 RT_NOREF1(pSelf);
59 return VINF_SUCCESS;
60}
61
62/** Default handler for the struct VBCLSERVICE clean-up member function.
63 * Usually used because the service is cleaned up automatically when the user
64 * process/X11 exits. */
65DECLINLINE(void) VBClServiceDefaultCleanup(struct VBCLSERVICE **ppInterface)
66{
67 NOREF(ppInterface);
68}
69
70extern struct VBCLSERVICE **VBClGetClipboardService();
71extern struct VBCLSERVICE **VBClGetSeamlessService();
72extern struct VBCLSERVICE **VBClGetDisplayService();
73extern struct VBCLSERVICE **VBClGetHostVersionService();
74#ifdef VBOX_WITH_DRAG_AND_DROP
75extern struct VBCLSERVICE **VBClGetDragAndDropService();
76#endif /* VBOX_WITH_DRAG_AND_DROP */
77extern struct VBCLSERVICE **VBClCheck3DService();
78extern struct VBCLSERVICE **VBClDisplaySVGAService();
79extern struct VBCLSERVICE **VBClDisplaySVGAX11Service();
80
81#endif /* !GA_INCLUDED_SRC_x11_VBoxClient_VBoxClient_h */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette