1 | /* $Id: ExtPackUtil.h 34391 2010-11-26 11:12:17Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox Main - Extension Pack Utilities and definitions, VBoxC, VBoxSVC, ++.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ____H_EXTPACKUTIL
|
---|
19 | #define ____H_EXTPACKUTIL
|
---|
20 |
|
---|
21 | #include <iprt/cpp/ministring.h>
|
---|
22 | #include <iprt/fs.h>
|
---|
23 |
|
---|
24 |
|
---|
25 | /** @name VBOX_EXTPACK_DESCRIPTION_NAME
|
---|
26 | * The name of the description file in an extension pack. */
|
---|
27 | #define VBOX_EXTPACK_DESCRIPTION_NAME "ExtPack.xml"
|
---|
28 | /** @name VBOX_EXTPACK_DESCRIPTION_NAME
|
---|
29 | * The name of the manifest file in an extension pack. */
|
---|
30 | #define VBOX_EXTPACK_MANIFEST_NAME "ExtPack.manifest"
|
---|
31 | /** @name VBOX_EXTPACK_SIGNATURE_NAME
|
---|
32 | * The name of the signature file in an extension pack. */
|
---|
33 | #define VBOX_EXTPACK_SIGNATURE_NAME "ExtPack.signature"
|
---|
34 | /** @name VBOX_EXTPACK_SUFFIX
|
---|
35 | * The suffix of a extension pack tarball. */
|
---|
36 | #define VBOX_EXTPACK_SUFFIX ".vbox-extpack"
|
---|
37 |
|
---|
38 | /** The minimum length (strlen) of a extension pack name. */
|
---|
39 | #define VBOX_EXTPACK_NAME_MIN_LEN 3
|
---|
40 | /** The max length (strlen) of a extension pack name. */
|
---|
41 | #define VBOX_EXTPACK_NAME_MAX_LEN 64
|
---|
42 |
|
---|
43 | /** The architecture-dependent application data subdirectory where the
|
---|
44 | * extension packs are installed. Relative to RTPathAppPrivateArch. */
|
---|
45 | #define VBOX_EXTPACK_INSTALL_DIR "ExtensionPacks"
|
---|
46 | /** The architecture-independent application data subdirectory where the
|
---|
47 | * certificates are installed. Relative to RTPathAppPrivateNoArch. */
|
---|
48 | #define VBOX_EXTPACK_CERT_DIR "ExtPackCertificates"
|
---|
49 |
|
---|
50 |
|
---|
51 | /**
|
---|
52 | * Plug-in descriptor.
|
---|
53 | */
|
---|
54 | typedef struct VBOXEXTPACKPLUGINDESC
|
---|
55 | {
|
---|
56 | /** The name. */
|
---|
57 | iprt::MiniString strName;
|
---|
58 | /** The module name. */
|
---|
59 | iprt::MiniString strModule;
|
---|
60 | /** The description. */
|
---|
61 | iprt::MiniString strDescription;
|
---|
62 | /** The frontend or component which it plugs into. */
|
---|
63 | iprt::MiniString strFrontend;
|
---|
64 | } VBOXEXTPACKPLUGINDESC;
|
---|
65 | /** Pointer to a plug-in descriptor. */
|
---|
66 | typedef VBOXEXTPACKPLUGINDESC *PVBOXEXTPACKPLUGINDESC;
|
---|
67 |
|
---|
68 | /**
|
---|
69 | * Extension pack descriptor
|
---|
70 | *
|
---|
71 | * This is the internal representation of the ExtPack.xml.
|
---|
72 | */
|
---|
73 | typedef struct VBOXEXTPACKDESC
|
---|
74 | {
|
---|
75 | /** The name. */
|
---|
76 | iprt::MiniString strName;
|
---|
77 | /** The description. */
|
---|
78 | iprt::MiniString strDescription;
|
---|
79 | /** The version string. */
|
---|
80 | iprt::MiniString strVersion;
|
---|
81 | /** The internal revision number. */
|
---|
82 | uint32_t uRevision;
|
---|
83 | /** The name of the main module. */
|
---|
84 | iprt::MiniString strMainModule;
|
---|
85 | /** The name of the VRDE module, empty if none. */
|
---|
86 | iprt::MiniString strVrdeModule;
|
---|
87 | /** The number of plug-in descriptors. */
|
---|
88 | uint32_t cPlugIns;
|
---|
89 | /** Pointer to an array of plug-in descriptors. */
|
---|
90 | PVBOXEXTPACKPLUGINDESC paPlugIns;
|
---|
91 | } VBOXEXTPACKDESC;
|
---|
92 |
|
---|
93 | /** Pointer to a extension pack descriptor. */
|
---|
94 | typedef VBOXEXTPACKDESC *PVBOXEXTPACKDESC;
|
---|
95 | /** Pointer to a const extension pack descriptor. */
|
---|
96 | typedef VBOXEXTPACKDESC const *PCVBOXEXTPACKDESC;
|
---|
97 |
|
---|
98 |
|
---|
99 | iprt::MiniString *VBoxExtPackLoadDesc(const char *a_pszDir, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo);
|
---|
100 | iprt::MiniString *VBoxExtPackExtractNameFromTarballPath(const char *pszTarball);
|
---|
101 | void VBoxExtPackFreeDesc(PVBOXEXTPACKDESC a_pExtPackDesc);
|
---|
102 | bool VBoxExtPackIsValidName(const char *pszName);
|
---|
103 | bool VBoxExtPackIsValidVersionString(const char *pszName);
|
---|
104 | bool VBoxExtPackIsValidModuleString(const char *pszModule);
|
---|
105 |
|
---|
106 |
|
---|
107 | #endif
|
---|
108 |
|
---|