Skip to content

Commit a2c550a

Browse files
committed
use c14n definitions as-is
1 parent b6f33bd commit a2c550a

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

xmlua/c14n.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,5 @@ function C14n:c14n_save(nodes, mode, inclusive_ns_prefixes, with_comments)
102102
end
103103

104104

105+
105106
return C14n

xmlua/libxml2/c14n.lua

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
local ffi = require("ffi")
22

33
ffi.cdef[[
4-
typedef enum {
5-
XML_C14N_1_0 = 0, /* Original C14N 1.0 spec */
6-
XML_C14N_EXCLUSIVE_1_0 = 1, /* Exclusive C14N 1.0 spec */
7-
XML_C14N_1_1 = 2, /* C14N 1.1 spec */
8-
} xmlC14NMode;
9-
104
typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer, int len);
115
typedef int (*xmlOutputCloseCallback) (void * context);
126

@@ -30,10 +24,24 @@ ffi.cdef[[
3024
xmlOutputBufferPtr xmlOutputBufferCreateBuffer (xmlBufferPtr buffer, xmlCharEncodingHandlerPtr encoder);
3125
int xmlOutputBufferClose (xmlOutputBufferPtr out);
3226

33-
int xmlC14NDocSaveTo (xmlDocPtr doc,
34-
xmlNodeSetPtr nodes,
35-
int mode, /* a xmlC14NMode */
36-
xmlChar **inclusive_ns_prefixes,
37-
int with_comments,
38-
xmlOutputBufferPtr buf);
27+
28+
/*
29+
* xmlC14NMode:
30+
*
31+
* Predefined values for C14N modes
32+
*
33+
*/
34+
typedef enum {
35+
XML_C14N_1_0 = 0, /* Original C14N 1.0 spec */
36+
XML_C14N_EXCLUSIVE_1_0 = 1, /* Exclusive C14N 1.0 spec */
37+
XML_C14N_1_1 = 2 /* C14N 1.1 spec */
38+
} xmlC14NMode;
39+
40+
int
41+
xmlC14NDocSaveTo (xmlDocPtr doc,
42+
xmlNodeSetPtr nodes,
43+
int mode, /* a xmlC14NMode */
44+
xmlChar **inclusive_ns_prefixes,
45+
int with_comments,
46+
xmlOutputBufferPtr buf);
3947
]]

0 commit comments

Comments
 (0)