VirtualBox

source: vbox/trunk/src/VBox/Additions/os2/VBoxService/VBoxServiceInternal.h@ 3655

Last change on this file since 3655 was 3655, checked in by vboxsync, 18 years ago

export

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1/** @file
2 * VBoxService - Guest Additions Services.
3 */
4
5/*
6 * Copyright (C) 2007 innotek GmbH
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License as published by the Free Software Foundation,
12 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13 * distribution. VirtualBox OSE is distributed in the hope that it will
14 * be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * If you received this file as part of a commercial VirtualBox
17 * distribution, then only the terms of your commercial VirtualBox
18 * license agreement apply instead of the previous paragraph.
19 */
20
21#ifndef ___VBoxServiceInternal_h___
22#define ___VBoxServiceInternal_h___
23
24/**
25 * A service descriptor.
26 */
27typedef struct
28{
29 /** The short service name. */
30 const char *pszName;
31 /** The longer service name. */
32 const char *pszDescription;
33 /** The usage options stuff for the --help screen. */
34 const char *pszUsage;
35 /** The option descriptions for the --help screen. */
36 const char *pszOptions;
37
38 /**
39 * Called before parsing arguments.
40 * @returns VBox status code.
41 */
42 DECLCALLBACKMEMBER(int, pfnPreInit)(void);
43
44 /**
45 * Tries to parse the given command line option.
46 *
47 * @returns 0 if we parsed, -1 if it didn't and anything else means exit.
48 * @param ppszShort If not NULL it points to the short option iterator. a short argument.
49 * If NULL examine argv[*pi].
50 * @param argc The argument count.
51 * @param argv The argument vector.
52 * @param pi The argument vector index. Update if any value(s) are eaten.
53 */
54 DECLCALLBACKMEMBER(int, pfnOption)(const char **ppszShort, int argc, char **argv, int *pi);
55
56 /**
57 * Called before parsing arguments.
58 * @returns VBox status code.
59 */
60 DECLCALLBACKMEMBER(int, pfnInit)(void);
61
62 /** Called from the worker thread.
63 *
64 * @returns VBox status code.
65 * @retval VINF_SUCCESS if exitting because *pfTerminate was set.
66 * @param pfTerminate Pointer to a per service termination flag to check
67 * before and after blocking.
68 */
69 DECLCALLBACKMEMBER(int, pfnWorker)(bool volatile *pfTerminate);
70
71 /**
72 * Stop an service.
73 */
74 DECLCALLBACKMEMBER(void, pfnStop)(void);
75
76 /**
77 * Does termination cleanups.
78 */
79 DECLCALLBACKMEMBER(void, pfnTerm)(void);
80} VBOXSERVICE;
81/** Pointer to a VBOXSERVICE. */
82typedef VBOXSERVICE *PVBOXSERVICE;
83/** Pointer to a const VBOXSERVICE. */
84typedef VBOXSERVICE const *PCVBOXSERVICE;
85
86
87__BEGIN_DECLS
88
89extern char *g_pszProgName;
90extern int g_cVerbosity;
91extern uint32_t g_DefaultInterval;
92
93extern int VBoxServiceSyntax(const char *pszFormat, ...);
94extern int VBoxServiceError(const char *pszFormat, ...);
95extern void VBoxServiceVerbose(int iLevel, const char *pszFormat, ...);
96extern int VBoxServiceArgUInt32(int argc, char **argv, const char *psz, int *pi, uint32_t *pu32, uint32_t u32Min, uint32_t u32Max);
97
98#ifdef __OS2__
99extern int daemon(int, int);
100#endif
101
102extern VBOXSERVICE g_TimeSync;
103extern VBOXSERVICE g_Clipboard;
104extern VBOXSERVICE g_Control;
105
106__END_DECLS
107
108#endif
109
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