1
/* $Xorg: free.c,v 1.4 2001/02/09 02:03:41 xorgcvs Exp $ */
5
Copyright 1993, 1998 The Open Group
7
Permission to use, copy, modify, distribute, and sell this software and its
8
documentation for any purpose is hereby granted without fee, provided that
9
the above copyright notice appear in all copies and that both that
10
copyright notice and this permission notice appear in supporting
13
The above copyright notice and this permission notice shall be included
14
in all copies or substantial portions of the Software.
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
OTHER DEALINGS IN THE SOFTWARE.
24
Except as contained in this notice, the name of The Open Group shall
25
not be used in advertising or otherwise to promote the sale, use or
26
other dealings in this Software without prior written authorization
30
/* $XFree86: xc/lib/XIE/free.c,v 1.5 2001/12/14 19:54:33 dawes Exp $ */
32
#include "XIElibint.h"
34
#define CHECK_AND_FREE(_ptr) if (_ptr) Xfree (_ptr)
38
XieFreeTechniques (XieTechnique *techs, unsigned int count)
44
for (i = 0; i < count; i++)
45
CHECK_AND_FREE (techs[i].name);
47
Xfree ((char *) techs);
53
XieFreePhotofloGraph (XiePhotoElement *elements, unsigned int count)
56
* NOTE: We do not free the technique parameters here.
57
* Most of the technique parameters should be freed by the
58
* client using Xfree (exception: EncodeJPEGBaseline and
59
* EncodeJPEGLossless, see functions below). This is so
60
* the client can reuse technique parameters between photoflos.
68
for (i = 0; i < count; i++)
70
switch (elements[i].elemType)
73
CHECK_AND_FREE ((char *) elements[i].data.Convolve.kernel);
76
CHECK_AND_FREE ((char *) elements[i].data.PasteUp.tiles);
83
Xfree ((char *) elements);
88
XieFreeEncodeJPEGBaseline (XieEncodeJPEGBaselineParam *param)
92
CHECK_AND_FREE ((char *) param->q_table);
93
CHECK_AND_FREE ((char *) param->ac_table);
94
CHECK_AND_FREE ((char *) param->dc_table);
95
Xfree ((char *) param);
101
XieFreeEncodeJPEGLossless (XieEncodeJPEGLosslessParam *param)
105
CHECK_AND_FREE ((char *) param->table);
106
Xfree ((char *) param);
112
XieFreePasteUpTiles (XiePhotoElement *element)
114
XieTile *tiles= element->data.PasteUp.tiles;
119
element->data.PasteUp.tiles=NULL;