1 /***********************************************************************/
2 /* Open Visualization Data Explorer                                    */
3 /* (C) Copyright IBM Corp. 1989,1999                                   */
4 /* ALL RIGHTS RESERVED                                                 */
5 /* This code licensed under the                                        */
6 /*    "IBM PUBLIC LICENSE - Open Visualization Data Explorer"          */
7 /***********************************************************************/
8 
9 #include <dxconfig.h>
10 
11 
12 
13 #include "privateClass.h"
14 
15 static Private
_NewPrivate(Pointer data,Error (* pdelete)(Pointer),struct private_class * class)16 _NewPrivate(Pointer data, Error (*pdelete)(Pointer),
17 	    struct private_class *class)
18 {
19     Private p = (Private) _dxf_NewObject((struct object_class *)class);
20     if (!p)
21 	return NULL;
22     p->data = data;
23     p->delete = pdelete;
24     return p;
25 }
26 
27 Private
DXNewPrivate(Pointer data,Error (* pdelete)(Pointer))28 DXNewPrivate(Pointer data, Error (*pdelete)(Pointer))
29 {
30     return _NewPrivate(data, pdelete, &_dxdprivate_class);
31 }
32 
33 Error
_dxfPrivate_Delete(Private p)34 _dxfPrivate_Delete(Private p)
35 {
36     return p->delete? p->delete(p->data) : OK;
37 }
38 
39 Pointer
DXGetPrivateData(Private p)40 DXGetPrivateData(Private p)
41 {
42     return p? p->data : NULL;
43 }
44