tuxpaint-pencil-sharpener/src/macos.c
Bill Kendrick 4e3a9fbc8c Re-ran indent on .c files
Also, added a few places where indent is disabled
(via `/* *INDENT-OFF* */`).

See https://sourceforge.net/p/tuxpaint/mailman/message/36077409/
from Oct. 2017.
2019-04-13 12:00:44 -07:00

64 lines
1 KiB
C

/*
* FIXME
*/
#include <stdlib.h>
#include "macos.h"
#define MACOS_FONTS_PATH "%s/Library/Fonts"
#define MACOS_PREFERENCES_PATH "%s/Library/Application Support/TuxPaint"
#define MACOS_GLOBAL_PREFERENCES_PATH "/Library/Application Support/TuxPaint"
/**
* FIXME
*/
const char *macos_fontsPath()
{
static char *p = NULL;
if (!p)
{
const char *home = getenv("HOME");
p = malloc(strlen(home) + strlen(MACOS_FONTS_PATH) + 1);
if (p)
sprintf(p, MACOS_FONTS_PATH, getenv("HOME"));
else
perror("macos_fontsPath");
}
return p;
}
/**
* FIXME
*/
const char *macos_preferencesPath()
{
static char *p = NULL;
if (!p)
{
const char *home = getenv("HOME");
p = malloc(strlen(home) + strlen(MACOS_PREFERENCES_PATH) + 1);
if (p)
sprintf(p, MACOS_PREFERENCES_PATH, getenv("HOME"));
else
perror("macos_preferencesPath");
}
return p;
}
/**
* FIXME
*/
const char *macos_globalPreferencesPath()
{
return MACOS_GLOBAL_PREFERENCES_PATH;
}