1 | /* $Id: ExtPackUtil.h 34073 2010-11-15 15:38:20Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox Main - Extension Pack Utilities and definitions, VBoxC, VBoxSVC, ++.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010 Oracle Corporation
|
---|
8 | *
|
---|
9 | * Oracle Corporation confidential
|
---|
10 | * All rights reserved
|
---|
11 | */
|
---|
12 |
|
---|
13 | #ifndef ____H_EXTPACKUTIL
|
---|
14 | #define ____H_EXTPACKUTIL
|
---|
15 |
|
---|
16 | #include <iprt/cpp/ministring.h>
|
---|
17 | #include <iprt/fs.h>
|
---|
18 |
|
---|
19 |
|
---|
20 | /** @name VBOX_EXTPACK_DESCRIPTION_NAME
|
---|
21 | * The name of the description file in an extension pack. */
|
---|
22 | #define VBOX_EXTPACK_DESCRIPTION_NAME "ExtPack.xml"
|
---|
23 | /** @name VBOX_EXTPACK_SUFFIX
|
---|
24 | * The suffix of a extension pack tarball. */
|
---|
25 | #define VBOX_EXTPACK_SUFFIX ".vbox-extpack"
|
---|
26 |
|
---|
27 | /** The minimum length (strlen) of a extension pack name. */
|
---|
28 | #define VBOX_EXTPACK_NAME_MIN_LEN 3
|
---|
29 | /** The max length (strlen) of a extension pack name. */
|
---|
30 | #define VBOX_EXTPACK_NAME_MAX_LEN 64
|
---|
31 |
|
---|
32 | /** The architecture-dependent application data subdirectory where the
|
---|
33 | * extension packs are installed. Relative to RTPathAppPrivateArch. */
|
---|
34 | #define VBOX_EXTPACK_INSTALL_DIR "ExtensionPacks"
|
---|
35 | /** The architecture-independent application data subdirectory where the
|
---|
36 | * certificates are installed. Relative to RTPathAppPrivateNoArch. */
|
---|
37 | #define VBOX_EXTPACK_CERT_DIR "ExtPackCertificates"
|
---|
38 |
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * Plug-in descriptor.
|
---|
42 | */
|
---|
43 | typedef struct VBOXEXTPACKPLUGINDESC
|
---|
44 | {
|
---|
45 | /** The name. */
|
---|
46 | iprt::MiniString strName;
|
---|
47 | /** The module name. */
|
---|
48 | iprt::MiniString strModule;
|
---|
49 | /** The description. */
|
---|
50 | iprt::MiniString strDescription;
|
---|
51 | /** The frontend or component which it plugs into. */
|
---|
52 | iprt::MiniString strFrontend;
|
---|
53 | } VBOXEXTPACKPLUGINDESC;
|
---|
54 | /** Pointer to a plug-in descriptor. */
|
---|
55 | typedef VBOXEXTPACKPLUGINDESC *PVBOXEXTPACKPLUGINDESC;
|
---|
56 |
|
---|
57 | /**
|
---|
58 | * Extension pack descriptor
|
---|
59 | *
|
---|
60 | * This is the internal representation of the ExtPack.xml.
|
---|
61 | */
|
---|
62 | typedef struct VBOXEXTPACKDESC
|
---|
63 | {
|
---|
64 | /** The name. */
|
---|
65 | iprt::MiniString strName;
|
---|
66 | /** The description. */
|
---|
67 | iprt::MiniString strDescription;
|
---|
68 | /** The version string. */
|
---|
69 | iprt::MiniString strVersion;
|
---|
70 | /** The internal revision number. */
|
---|
71 | uint32_t uRevision;
|
---|
72 | /** The name of the main module. */
|
---|
73 | iprt::MiniString strMainModule;
|
---|
74 | /** The number of plug-in descriptors. */
|
---|
75 | uint32_t cPlugIns;
|
---|
76 | /** Pointer to an array of plug-in descriptors. */
|
---|
77 | PVBOXEXTPACKPLUGINDESC paPlugIns;
|
---|
78 | } VBOXEXTPACKDESC;
|
---|
79 |
|
---|
80 | /** Pointer to a extension pack descriptor. */
|
---|
81 | typedef VBOXEXTPACKDESC *PVBOXEXTPACKDESC;
|
---|
82 | /** Pointer to a const extension pack descriptor. */
|
---|
83 | typedef VBOXEXTPACKDESC const *PCVBOXEXTPACKDESC;
|
---|
84 |
|
---|
85 |
|
---|
86 | iprt::MiniString *VBoxExtPackLoadDesc(const char *a_pszDir, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo);
|
---|
87 | iprt::MiniString *VBoxExtPackExtractNameFromTarballPath(const char *pszTarball);
|
---|
88 | void VBoxExtPackFreeDesc(PVBOXEXTPACKDESC a_pExtPackDesc);
|
---|
89 | bool VBoxExtPackIsValidName(const char *pszName);
|
---|
90 | bool VBoxExtPackIsValidVersionString(const char *pszName);
|
---|
91 | bool VBoxExtPackIsValidMainModuleString(const char *pszMainModule);
|
---|
92 |
|
---|
93 |
|
---|
94 | #endif
|
---|
95 |
|
---|