VirtualBox

source: vbox/trunk/include/VBox/com/utils.h@ 79899

Last change on this file since 79899 was 79899, checked in by vboxsync, 5 years ago

VBox/com/com.h,Dhcpd: Split out the logging and home directory functions into utils.h so they can be used by Dhcpd without dragging in any COM stuff via com/defs.h. bugref:9288 bugref:9511

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/** @file
2 * MS COM / XPCOM Abstraction Layer - COM initialization / shutdown.
3 */
4
5/*
6 * Copyright (C) 2005-2019 Oracle Corporation
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 (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef VBOX_INCLUDED_com_utils_h
27#define VBOX_INCLUDED_com_utils_h
28#ifndef RT_WITHOUT_PRAGMA_ONCE
29# pragma once
30#endif
31
32#include "iprt/types.h"
33
34/** @addtogroup grp_com
35 * @{
36 */
37
38namespace com
39{
40
41/**
42 * Returns the VirtualBox user home directory.
43 *
44 * On failure, this function will return a path that caused a failure (or
45 * NULL if the failure is not path-related).
46 *
47 * On success, this function will try to create the returned directory if it
48 * doesn't exist yet. This may also fail with the corresponding status code.
49 *
50 * If @a aDirLen is smaller than RTPATH_MAX then there is a great chance that
51 * this method will return VERR_BUFFER_OVERFLOW.
52 *
53 * @param aDir Buffer to store the directory string in UTF-8 encoding.
54 * @param aDirLen Length of the supplied buffer including space for the
55 * terminating null character, in bytes.
56 * @param fCreateDir Flag whether to create the returned directory on success
57 * if it doesn't exist.
58 * @returns VBox status code.
59 */
60int GetVBoxUserHomeDirectory(char *aDir, size_t aDirLen, bool fCreateDir = true);
61
62/**
63 * Creates a release log file, used both in VBoxSVC and in API clients.
64 *
65 * @param pszEntity Human readable name of the program.
66 * @param pszLogFile Name of the release log file.
67 * @param fFlags Logger instance flags.
68 * @param pszGroupSettings Group logging settings.
69 * @param pszEnvVarBase Base environment variable name for the logger.
70 * @param fDestFlags Logger destination flags.
71 * @param cMaxEntriesPerGroup Limit for log entries per group. UINT32_MAX for no limit.
72 * @param cHistory Number of old log files to keep.
73 * @param uHistoryFileTime Maximum amount of time to put in a log file.
74 * @param uHistoryFileSize Maximum size of a log file before rotating.
75 * @param pErrInfo Where to return extended error information.
76 * Optional.
77 *
78 * @returns VBox status code.
79 */
80int VBoxLogRelCreate(const char *pszEntity, const char *pszLogFile,
81 uint32_t fFlags, const char *pszGroupSettings,
82 const char *pszEnvVarBase, uint32_t fDestFlags,
83 uint32_t cMaxEntriesPerGroup, uint32_t cHistory,
84 uint32_t uHistoryFileTime, uint64_t uHistoryFileSize,
85 PRTERRINFO pErrInfo);
86
87} /* namespace com */
88
89/** @} */
90#endif /* !VBOX_INCLUDED_com_utils_h */
91
Note: See TracBrowser for help on using the repository browser.

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