~ubuntu-branches/ubuntu/lucid/libxml-libxml-perl/lucid

« back to all changes in this revision

Viewing changes to perl-libxml-mm.h

  • Committer: Bazaar Package Importer
  • Author(s): gregor herrmann
  • Date: 2009-05-31 14:36:13 UTC
  • mfrom: (4.1.7 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090531143613-xxpnwmrz62kwtejq
Tags: 1.69.ds-2
* Remove Florian Ragwitz from Uploaders (closes: #523275).
* Set Standards-Version to 3.8.1 (no changes).
* Remove duplicate fields from debian/control.
* Minimize debian/rules, bump quilt and debhelper build dependencies.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
2
 * perl-libxml-mm.h
3
 
 * $Id: perl-libxml-mm.h 703 2008-01-28 12:21:29Z pajas $
 
3
 * $Id: perl-libxml-mm.h 754 2008-11-04 14:16:54Z pajas $
4
4
 *
5
5
 * Basic concept:
6
6
 * perl varies in the implementation of UTF8 handling. this header (together
63
63
    xmlNodePtr owner;
64
64
    int count;
65
65
    int encoding;
66
 
    struct _ProxyNode * _registry;
67
66
};
68
67
 
69
68
/* helper type for the proxy structure */
73
72
typedef ProxyNode* ProxyNodePtr;
74
73
 
75
74
/* this my go only into the header used by the xs */
76
 
#define SvPROXYNODE(x) ((ProxyNodePtr)SvIV(SvRV(x)))
77
 
#define PmmPROXYNODE(x) ((ProxyNodePtr)x->_private)
78
 
#define SvNAMESPACE(x) ((xmlNsPtr)SvIV(SvRV(x)))
 
75
#define SvPROXYNODE(x) (INT2PTR(ProxyNodePtr,SvIV(SvRV(x))))
 
76
#define PmmPROXYNODE(x) (INT2PTR(ProxyNodePtr,x->_private))
 
77
#define SvNAMESPACE(x) (INT2PTR(xmlNsPtr,SvIV(SvRV(x))))
79
78
 
80
79
#define PmmREFCNT(node)      node->count
81
80
#define PmmREFCNT_inc(node)  node->count++
86
85
#define PmmNodeEncoding(node) ((ProxyNodePtr)(node->_private))->encoding
87
86
#define PmmDocEncoding(node) (node->charset)
88
87
 
 
88
#ifndef NO_XML_LIBXML_THREADS
 
89
#ifdef USE_ITHREADS
 
90
#define XML_LIBXML_THREADS
 
91
#endif
 
92
#endif
 
93
 
 
94
#ifdef XML_LIBXML_THREADS
 
95
 
 
96
/* structure for storing thread-local refcount */
 
97
struct _LocalProxyNode {
 
98
        ProxyNodePtr proxy;
 
99
        int count;
 
100
};
 
101
typedef struct _LocalProxyNode LocalProxyNode;
 
102
typedef LocalProxyNode* LocalProxyNodePtr;
 
103
 
 
104
#define PmmUSEREGISTRY          (PROXY_NODE_REGISTRY_MUTEX != NULL)
 
105
#define PmmREGISTRY             (INT2PTR(xmlHashTablePtr,SvIV(SvRV(get_sv("XML::LibXML::__PROXY_NODE_REGISTRY",0)))))
 
106
// #define PmmREGISTRY                  (INT2PTR(xmlHashTablePtr,SvIV(SvRV(PROXY_NODE_REGISTRY))))
 
107
 
 
108
void
 
109
PmmCloneProxyNodes();
 
110
int
 
111
PmmProxyNodeRegistrySize();
 
112
void
 
113
PmmDumpRegistry(xmlHashTablePtr r);
 
114
void
 
115
PmmRegistryREFCNT_dec(ProxyNodePtr proxy);
 
116
 
 
117
#endif
 
118
 
 
119
void
 
120
PmmFreeHashTable(xmlHashTablePtr table);
 
121
 
89
122
ProxyNodePtr
90
123
PmmNewNode(xmlNodePtr node);
91
124
 
216
249
PmmNodeTypeName( xmlNodePtr elem );
217
250
 
218
251
xmlChar*
219
 
PmmEncodeString( const char *encoding, const xmlChar *string );
 
252
PmmEncodeString( const char *encoding, const xmlChar *string, STRLEN len );
220
253
 
221
254
char*
222
 
PmmDecodeString( const char *encoding, const xmlChar *string);
 
255
PmmDecodeString( const char *encoding, const xmlChar *string, STRLEN* len);
223
256
 
224
257
/* string manipulation will go elsewhere! */
225
258