static XcursorImage *
XcursorImageCreate(int width, int height)
{
- XcursorImage *image;
+ XcursorImage *image;
if (width < 0 || height < 0)
return NULL;
static XcursorImages *
XcursorImagesCreate(int size)
{
- XcursorImages *images;
+ XcursorImages *images;
images = malloc(sizeof(XcursorImages) +
size * sizeof(XcursorImage *));
void
XcursorImagesDestroy(XcursorImages *images)
{
- int n;
+ int n;
if (!images)
return;
static void
XcursorImagesSetName(XcursorImages *images, const char *name)
{
- char *new;
+ char *new;
if (!images || !name)
return;
static bool
_XcursorReadUInt(XcursorFile *file, uint32_t *u)
{
- unsigned char bytes[4];
+ unsigned char bytes[4];
if (!file || !u)
return false;
static XcursorFileHeader *
_XcursorFileHeaderCreate(uint32_t ntoc)
{
- XcursorFileHeader *fileHeader;
+ XcursorFileHeader *fileHeader;
if (ntoc > 0x10000)
return NULL;
static XcursorFileHeader *
_XcursorReadFileHeader(XcursorFile *file)
{
- XcursorFileHeader head, *fileHeader;
- uint32_t skip;
- unsigned int n;
+ XcursorFileHeader head, *fileHeader;
+ uint32_t skip;
+ unsigned int n;
if (!file)
return NULL;
int *nsizesp)
{
unsigned int n;
- int nsizes = 0;
- uint32_t bestSize = 0;
- uint32_t thisSize;
+ int nsizes = 0;
+ uint32_t bestSize = 0;
+ uint32_t thisSize;
if (!fileHeader || !nsizesp)
return 0;
uint32_t size,
int count)
{
- unsigned int toc;
- uint32_t thisSize;
+ unsigned int toc;
+ uint32_t thisSize;
if (!fileHeader)
return 0;
XcursorFileHeader *fileHeader,
int toc)
{
- XcursorChunkHeader chunkHeader;
- XcursorImage head;
- XcursorImage *image;
- int n;
- uint32_t *p;
+ XcursorChunkHeader chunkHeader;
+ XcursorImage head;
+ XcursorImage *image;
+ int n;
+ uint32_t *p;
if (!file || !fileHeader)
return NULL;
static XcursorImages *
XcursorXcFileLoadImages(XcursorFile *file, int size)
{
- XcursorFileHeader *fileHeader;
- uint32_t bestSize;
- int nsize;
- XcursorImages *images;
- int n;
- int toc;
+ XcursorFileHeader *fileHeader;
+ uint32_t bestSize;
+ int nsize;
+ XcursorImages *images;
+ int n;
+ int toc;
if (!file || size < 0)
return NULL;
static int
_XcursorStdioFileRead(XcursorFile *file, unsigned char *buf, int len)
{
- FILE *f = file->closure;
+ FILE *f = file->closure;
return fread(buf, 1, len, f);
}
static int
_XcursorStdioFileWrite(XcursorFile *file, unsigned char *buf, int len)
{
- FILE *f = file->closure;
+ FILE *f = file->closure;
return fwrite(buf, 1, len, f);
}
static int
_XcursorStdioFileSeek(XcursorFile *file, long offset, int whence)
{
- FILE *f = file->closure;
+ FILE *f = file->closure;
return fseek(f, offset, whence);
}
static XcursorImages *
XcursorFileLoadImages(FILE *file, int size)
{
- XcursorFile f;
+ XcursorFile f;
if (!file)
return NULL;
static char *
XcursorLibraryPath(void)
{
- const char *env_var;
- char *path = NULL;
- int pathlen = 0;
+ const char *env_var;
+ char *path = NULL;
+ int pathlen = 0;
env_var = getenv("XCURSOR_PATH");
if (env_var)
static void
_XcursorAddPathElt(char *path, const char *elt, int len)
{
- int pathlen = strlen(path);
+ int pathlen = strlen(path);
/* append / if the path doesn't currently have one */
if (path[0] == '\0' || path[pathlen - 1] != '/')
static char *
_XcursorBuildThemeDir(const char *dir, const char *theme)
{
- const char *colon;
- const char *tcolon;
- char *full;
- char *home;
- int dirlen;
- int homelen;
- int themelen;
- int len;
+ const char *colon;
+ const char *tcolon;
+ char *full;
+ char *home;
+ int dirlen;
+ int homelen;
+ int themelen;
+ int len;
if (!dir || !theme)
return NULL;
static char *
_XcursorBuildFullname(const char *dir, const char *subdir, const char *file)
{
- char *full;
+ char *full;
if (!dir || !subdir || !file)
return NULL;
static const char *
_XcursorNextPath(const char *path)
{
- char *colon = strchr(path, ':');
+ char *colon = strchr(path, ':');
if (!colon)
return NULL;
static char *
_XcursorThemeInherits(const char *full)
{
- char line[8192];
- char *result = NULL;
- FILE *f;
+ char line[8192];
+ char *result = NULL;
+ FILE *f;
if (!full)
return NULL;