summaryrefslogtreecommitdiff
path: root/src/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/file.c')
-rw-r--r--src/file.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/file.c b/src/file.c
index 72d3a50..6e1e8c6 100644
--- a/src/file.c
+++ b/src/file.c
@@ -1,7 +1,6 @@
/*
- * $XFree86: xc/lib/Xcursor/file.c,v 1.1tsi Exp $
*
- * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2002 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -61,6 +60,7 @@ XcursorImagesCreate (int size)
return 0;
images->nimage = 0;
images->images = (XcursorImage **) (images + 1);
+ images->name = 0;
return images;
}
@@ -71,9 +71,24 @@ XcursorImagesDestroy (XcursorImages *images)
for (n = 0; n < images->nimage; n++)
XcursorImageDestroy (images->images[n]);
+ if (images->name)
+ free (images->name);
free (images);
}
+void
+XcursorImagesSetName (XcursorImages *images, const char *name)
+{
+ char *new = malloc (strlen (name) + 1);
+
+ if (!new)
+ return;
+ strcpy (new, name);
+ if (images->name)
+ free (images->name);
+ images->name = new;
+}
+
XcursorComment *
XcursorCommentCreate (XcursorUInt comment_type, int length)
{
@@ -185,7 +200,7 @@ _XcursorFileHeaderCreate (int ntoc)
return 0;
fileHeader->magic = XCURSOR_MAGIC;
fileHeader->header = XCURSOR_FILE_HEADER_LEN;
- fileHeader->version = XCURSOR_VERSION;
+ fileHeader->version = XCURSOR_FILE_VERSION;
fileHeader->ntoc = ntoc;
fileHeader->tocs = (XcursorFileToc *) (fileHeader + 1);
return fileHeader;