38 lines
1.3 KiB
C
38 lines
1.3 KiB
C
// Emacs style mode select -*- C -*-
|
|
//-----------------------------------------------------------------------------
|
|
//
|
|
// $Id:$
|
|
//
|
|
// DESCRIPTION:
|
|
// macOS-specific system helpers: app-bundle detection and
|
|
// user-writable data directory lookup. Plain C; implemented
|
|
// with CoreFoundation in i_mac.c.
|
|
//
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#ifndef __I_MAC__
|
|
#define __I_MAC__
|
|
|
|
#include <stddef.h>
|
|
|
|
// Nonzero when running as a real .app bundle (has a bundle identifier).
|
|
// A loose command-line binary returns a bundle object without an
|
|
// identifier, so this reliably distinguishes the two cases.
|
|
int I_IsBundled (void);
|
|
|
|
// Absolute path of the bundle's Contents/Resources directory.
|
|
// Writes an empty string when not running from a bundle.
|
|
void I_GetBundleResourcesDir (char *out, size_t len);
|
|
|
|
// Absolute path of "~/Library/Application Support/DOOM" (created if
|
|
// missing). Writes an empty string if $HOME is unset.
|
|
void I_GetAppSupportDir (char *out, size_t len);
|
|
|
|
// When running bundled, make the app-support directory the working
|
|
// directory so relative-path writes (savegames, screenshots, PWAD
|
|
// resolution) land somewhere writable instead of "/" (a Finder-launched
|
|
// app's cwd). No-op for the command-line binary.
|
|
void I_PrepareAppEnvironment (void);
|
|
|
|
#endif
|