blob: 58f36dc096d02d7d730afc65adf39fa6d43a5cf0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2010 Blender Foundation. All rights reserved. */
/** \file
* \ingroup GHOST
*/
#include <cstdio>
#include "GHOST_ISystemPaths.h"
#include "GHOST_Path-api.h"
#include "GHOST_Types.h"
#include "intern/GHOST_Debug.h"
GHOST_TSuccess GHOST_CreateSystemPaths(void)
{
return GHOST_ISystemPaths::create();
}
GHOST_TSuccess GHOST_DisposeSystemPaths(void)
{
return GHOST_ISystemPaths::dispose();
}
const char *GHOST_getSystemDir(int version, const char *versionstr)
{
GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
return systemPaths ? systemPaths->getSystemDir(version, versionstr) : nullptr;
}
const char *GHOST_getUserDir(int version, const char *versionstr)
{
GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
/* Shouldn't be `nullptr`. */
return systemPaths ? systemPaths->getUserDir(version, versionstr) : nullptr;
}
const char *GHOST_getUserSpecialDir(GHOST_TUserSpecialDirTypes type)
{
GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
/* Shouldn't be `nullptr`. */
return systemPaths ? systemPaths->getUserSpecialDir(type) : nullptr;
}
const char *GHOST_getBinaryDir()
{
GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
/* Shouldn't be `nullptr`. */
return systemPaths ? systemPaths->getBinaryDir() : nullptr;
}
void GHOST_addToSystemRecentFiles(const char *filepath)
{
GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
if (systemPaths) {
systemPaths->addToSystemRecentFiles(filepath);
}
}
|