1XpmMisc(3) libXpm functions XpmMisc(3)
2
3
4
6 XpmMisc - xpm misc functions to free used memory and handle errors
7
9 int XpmFreeXpmImage(XpmImage *image);
10
11 int XpmFreeXpmInfo(XpmInfo *info);
12
13 int XpmFreeAttributes(XpmAttributes *attributes);
14
15 int XpmAttributesSize(void);
16
17
18 int XpmFreeExtensions(XpmExtension *extensions, int nextensions);
19
20 int XpmFree(char *ptr);
21
22 char *XpmGetErrorString(int errorcode);
23
24 int XpmLibraryVersion(void);
25
26
28 image Specifies the structure to free
29
30 info Specifies the structure to free
31
32 ptr Specifies the data to free
33
34 errorcode
35 Specifies the XPM error
36
37 extensions
38 Specifies the array to free
39
40 nextensions
41 Specifies the number of extensions
42
43 attributes
44 Specifies the structure to free
45
46
48 To free possible data stored into an XpmImage structure use XpmFreeXp‐
49 mImage(). The XpmFreeXpmImage() function frees the structure members
50 which are not NULL, but not the structure itself.
51
52 To free possible data stored into an XpmInfo structure use XpmFreeXp‐
53 mInfo().
54
55 To free data possibly stored into an array of XpmExtension use XpmFree‐
56 Extensions().
57
58 To free any data allocated by an XPM function use the XpmFree() func‐
59 tion. The current distribution of the XPM library uses the standard
60 memory allocation functions and thus XpmFree() is nothing else than a
61 define to the standard free(3). However since these functions may be
62 redefined in specific environments it is wise to use XpmFree()
63
64 To free possible data stored into an XpmAttributes structure use Xpm‐
65 FreeAttributes(). The XpmFreeAttributes() function frees the structure
66 members which have been malloc’ed such as the pixels list.
67
68 To dynamically allocate an XpmAttributes structure use the XpmAt‐
69 tributesSize() function. The XpmAttributesSize() function provides ap‐
70 plications using dynamic libraries with a safe way to allocate and then
71 refer to an XpmAttributes structure, disregarding whether the XpmAt‐
72 tributes structure size has changed or not since compiled.
73
74 To get data when building an error message, one can use XpmGetEr‐
75 rorString(). XpmGetErrorString() returns a string related to the given
76 XPM error code.
77
78 The XpmLibraryVersion() function can be used when one needs to figure
79 out which version of the library is in use. The value returned by Xpm‐
80 LibraryVersion() can be compared to the value of XpmIncludeVersion
81 which is defined in the header file "xpm.h". These numbers are com‐
82 puted with the following formula:
83
84 (XpmFormat * 100 + XpmVersion) * 100 + XpmRevision
85
86 where XpmFormat is the version number of the format, XpmVersion is the
87 library version number (which changes only if the API changes), and
88 XpmRevision is the library minor version number.
89
90 The XpmFreeExtensions() function frees all data stored in every exten‐
91 sion and the array itself. Note that XpmFreeAttributes() calls this
92 function and thus most of the time it should not need to be explicitly
93 called.
94
95
97 XpmCreateBuffer(3), XpmCreateData(3), XpmCreateImage(3),
98 XpmCreatePixmap(3), XpmCreateXpmImage(3), XpmRead(3), XpmWrite(3)
99
100
101
102X Version 11 libXpm 3.5.15 XpmMisc(3)