2 SuperCollider real time audio synthesis system
3 Copyright (c) 2002 James McCartney. All rights reserved.
4 http://www.audiosynth.com
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 Primitives for platform dependent directories, constants etc.
26 #include "SC_DirUtils.h"
27 #include "PyrPrimitive.h"
28 #include "PyrKernel.h"
30 #define PATH_CONSTANT_PRIM_BODY(func) \
32 char path[PATH_MAX]; \
33 func(path, PATH_MAX); \
34 PyrString* string = newPyrString(g->gc, path, 0, true); \
35 SetObject(a, string); \
38 static int prPlatform_systemAppSupportDir(struct VMGlobals
*g
, int numArgsPushed
)
40 PATH_CONSTANT_PRIM_BODY(sc_GetSystemAppSupportDirectory
);
43 static int prPlatform_userAppSupportDir(struct VMGlobals
*g
, int numArgsPushed
)
45 PATH_CONSTANT_PRIM_BODY(sc_GetUserAppSupportDirectory
);
48 static int prPlatform_systemExtensionDir(struct VMGlobals
*g
, int numArgsPushed
)
50 PATH_CONSTANT_PRIM_BODY(sc_GetSystemExtensionDirectory
);
53 static int prPlatform_userExtensionDir(struct VMGlobals
*g
, int numArgsPushed
)
55 PATH_CONSTANT_PRIM_BODY(sc_GetUserExtensionDirectory
);
58 static int prPlatform_userConfigDir(struct VMGlobals
*g
, int numArgsPushed
)
60 PATH_CONSTANT_PRIM_BODY(sc_GetUserConfigDirectory
);
63 static int prPlatform_ideName(struct VMGlobals
*g
, int numArgsPushed
)
66 PyrString
* string
= newPyrString(g
->gc
, gIdeName
, 0, true);
71 void initPlatformPrimitives();
72 void initPlatformPrimitives()
76 base
= nextPrimitiveIndex();
78 definePrimitive(base
, index
++, "_Platform_systemAppSupportDir", prPlatform_systemAppSupportDir
, 1, 0);
79 definePrimitive(base
, index
++, "_Platform_userAppSupportDir", prPlatform_userAppSupportDir
, 1, 0);
80 definePrimitive(base
, index
++, "_Platform_systemExtensionDir", prPlatform_systemExtensionDir
, 1, 0);
81 definePrimitive(base
, index
++, "_Platform_userExtensionDir", prPlatform_userExtensionDir
, 1, 0);
82 definePrimitive(base
, index
++, "_Platform_userConfigDir", prPlatform_userConfigDir
, 1, 0);
83 definePrimitive(base
, index
++, "_Platform_ideName", prPlatform_ideName
, 1, 0);