content_server 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. data/bin/backup_server +8 -20
  2. data/bin/content_server +8 -20
  3. data/bin/testing_memory +60 -0
  4. data/bin/testing_server +57 -0
  5. data/ext/run_in_background/mkrf_conf.rb +34 -0
  6. data/lib/content_data/content_data.rb +613 -0
  7. data/lib/content_data/version.rb +3 -0
  8. data/lib/content_data.rb +6 -0
  9. data/lib/content_server/backup_server.rb +65 -86
  10. data/lib/content_server/content_server.rb +47 -77
  11. data/lib/content_server/file_streamer.rb +27 -33
  12. data/lib/content_server/queue_copy.rb +154 -49
  13. data/lib/content_server/queue_indexer.rb +19 -11
  14. data/lib/content_server/remote_content.rb +41 -23
  15. data/lib/content_server/server.rb +91 -0
  16. data/lib/content_server/version.rb +1 -1
  17. data/lib/content_server.rb +0 -15
  18. data/lib/email/email.rb +87 -0
  19. data/lib/email/version.rb +3 -0
  20. data/lib/email.rb +4 -0
  21. data/lib/file_copy/copy.rb +68 -0
  22. data/lib/file_copy/version.rb +4 -0
  23. data/lib/file_copy.rb +4 -0
  24. data/lib/file_indexing/index_agent.rb +170 -0
  25. data/lib/file_indexing/indexer_patterns.rb +72 -0
  26. data/lib/file_indexing/version.rb +3 -0
  27. data/lib/file_indexing.rb +9 -0
  28. data/lib/file_monitoring/file_monitoring.rb +105 -0
  29. data/lib/file_monitoring/monitor_path.rb +304 -0
  30. data/lib/file_monitoring/version.rb +3 -0
  31. data/lib/file_monitoring.rb +29 -0
  32. data/lib/file_utils/file_generator/README +97 -0
  33. data/lib/file_utils/file_generator/file_generator.rb +156 -0
  34. data/lib/file_utils/file_utils.rb +260 -0
  35. data/lib/file_utils/version.rb +3 -0
  36. data/lib/file_utils.rb +4 -0
  37. data/lib/log/version.rb +3 -0
  38. data/lib/log.rb +188 -0
  39. data/lib/networking/tcp.rb +213 -0
  40. data/lib/networking/version.rb +3 -0
  41. data/lib/networking.rb +4 -0
  42. data/lib/params/version.rb +3 -0
  43. data/lib/params.rb +419 -0
  44. data/lib/process_monitoring/monitoring.rb +85 -0
  45. data/lib/process_monitoring/monitoring_info.rb +79 -0
  46. data/lib/process_monitoring/send_email.rb +40 -0
  47. data/lib/process_monitoring/thread_safe_hash.rb +77 -0
  48. data/lib/process_monitoring/version.rb +3 -0
  49. data/lib/process_monitoring.rb +6 -0
  50. data/lib/run_in_background/version.rb +3 -0
  51. data/lib/run_in_background.rb +432 -0
  52. data/lib/testing_memory/testing_memory.rb +187 -0
  53. data/lib/testing_server/testing_server.rb +236 -0
  54. data/lib/testing_server/version.rb +3 -0
  55. data/lib/testing_server.rb +12 -0
  56. data/lib/validations/index_validations.rb +106 -0
  57. data/lib/validations/version.rb +3 -0
  58. data/lib/validations.rb +4 -0
  59. data/spec/content_data/validations_spec.rb +113 -0
  60. data/spec/file_copy/copy_spec.rb +54 -0
  61. data/spec/file_indexing/index_agent_spec.rb +53 -0
  62. data/spec/networking/tcp_spec.rb +95 -0
  63. data/spec/validations/index_validations_spec.rb +77 -0
  64. data/test/content_data/content_data_test.rb +290 -0
  65. data/test/file_generator/file_generator_spec.rb +84 -0
  66. data/test/file_indexing/index_agent_test/New.txt +0 -0
  67. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/libexslt.dll +0 -0
  68. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/libxslt.dll +0 -0
  69. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/xsltproc.exe +0 -0
  70. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exslt.h +102 -0
  71. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exsltconfig.h +73 -0
  72. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exsltexports.h +140 -0
  73. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/libexslt.h +29 -0
  74. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/attributes.h +38 -0
  75. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/documents.h +93 -0
  76. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/extensions.h +262 -0
  77. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/extra.h +80 -0
  78. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/functions.h +78 -0
  79. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/imports.h +75 -0
  80. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/keys.h +53 -0
  81. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/libxslt.h +30 -0
  82. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/namespaces.h +68 -0
  83. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/numbersInternals.h +69 -0
  84. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/pattern.h +81 -0
  85. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/preproc.h +43 -0
  86. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/security.h +104 -0
  87. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/templates.h +77 -0
  88. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/transform.h +207 -0
  89. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/trio.h +216 -0
  90. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/triodef.h +220 -0
  91. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/variables.h +91 -0
  92. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/win32config.h +101 -0
  93. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xslt.h +103 -0
  94. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltInternals.h +1967 -0
  95. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltconfig.h +172 -0
  96. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltexports.h +142 -0
  97. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltlocale.h +57 -0
  98. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltutils.h +309 -0
  99. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltwin32config.h +105 -0
  100. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libexslt.lib +0 -0
  101. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libexslt_a.lib +0 -0
  102. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libxslt.lib +0 -0
  103. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libxslt_a.lib +0 -0
  104. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/readme.txt +22 -0
  105. data/test/file_indexing/index_agent_test/patterns.input +3 -0
  106. data/test/file_indexing/index_agent_test.rb +51 -0
  107. data/test/file_monitoring/file_monitoring_test/conf.yml +4 -0
  108. data/test/file_monitoring/file_monitoring_test/conf_win32.yml +5 -0
  109. data/test/file_monitoring/file_monitoring_test/log +56 -0
  110. data/test/file_monitoring/file_monitoring_test.rb +0 -0
  111. data/test/file_monitoring/monitor_path_test/dir1000/test_file.1000 +1000 -0
  112. data/test/file_monitoring/monitor_path_test/dir1000/test_file.1000.0 +1000 -0
  113. data/test/file_monitoring/monitor_path_test/dir1000/test_file.1000.1 +1000 -0
  114. data/test/file_monitoring/monitor_path_test/dir1500/test_file.1500 +1500 -0
  115. data/test/file_monitoring/monitor_path_test/dir1500/test_file.1500.0 +1500 -0
  116. data/test/file_monitoring/monitor_path_test/dir1500/test_file.1500.1 +1500 -0
  117. data/test/file_monitoring/monitor_path_test/test_file.500 +500 -0
  118. data/test/file_monitoring/monitor_path_test/test_file.500.0 +500 -0
  119. data/test/file_monitoring/monitor_path_test/test_file.500.1 +500 -0
  120. data/test/file_monitoring/monitor_path_test.rb +153 -0
  121. data/test/file_utils/fileutil_mksymlink_test/dir1000/dir1500/test_file.1500 +1500 -0
  122. data/test/file_utils/fileutil_mksymlink_test/dir1000/dir1500/test_file.1500.0 +1500 -0
  123. data/test/file_utils/fileutil_mksymlink_test/dir1000/dir1500/test_file.1500.1 +1500 -0
  124. data/test/file_utils/fileutil_mksymlink_test/dir1000/test_file.1000 +1000 -0
  125. data/test/file_utils/fileutil_mksymlink_test/dir1000/test_file.1000.0 +1000 -0
  126. data/test/file_utils/fileutil_mksymlink_test/dir1000/test_file.1000.1 +1000 -0
  127. data/test/file_utils/fileutil_mksymlink_test/test_file.500 +500 -0
  128. data/test/file_utils/fileutil_mksymlink_test/test_file.500.0 +500 -0
  129. data/test/file_utils/fileutil_mksymlink_test/test_file.500.1 +500 -0
  130. data/test/file_utils/fileutil_mksymlink_test.rb +125 -0
  131. data/test/file_utils/time_modification_test.rb +132 -0
  132. data/test/params/params_spec.rb +280 -0
  133. data/test/params/params_test.rb +43 -0
  134. data/test/run_in_background/run_in_background_test.rb +122 -0
  135. data/test/run_in_background/test_app +57 -0
  136. metadata +272 -132
  137. data/lib/content_server/globals.rb +0 -10
@@ -0,0 +1,78 @@
1
+ /*
2
+ * Summary: interface for the XSLT functions not from XPath
3
+ * Description: a set of extra functions coming from XSLT but not in XPath
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard and Bjorn Reese <breese@users.sourceforge.net>
8
+ */
9
+
10
+ #ifndef __XML_XSLT_FUNCTIONS_H__
11
+ #define __XML_XSLT_FUNCTIONS_H__
12
+
13
+ #include <libxml/xpath.h>
14
+ #include <libxml/xpathInternals.h>
15
+ #include "xsltexports.h"
16
+ #include "xsltInternals.h"
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /**
23
+ * XSLT_REGISTER_FUNCTION_LOOKUP:
24
+ *
25
+ * Registering macro, not general purpose at all but used in different modules.
26
+ */
27
+ #define XSLT_REGISTER_FUNCTION_LOOKUP(ctxt) \
28
+ xmlXPathRegisterFuncLookup((ctxt)->xpathCtxt, \
29
+ (xmlXPathFuncLookupFunc) xsltXPathFunctionLookup, \
30
+ (void *)(ctxt->xpathCtxt));
31
+
32
+ XSLTPUBFUN xmlXPathFunction XSLTCALL
33
+ xsltXPathFunctionLookup (xmlXPathContextPtr ctxt,
34
+ const xmlChar *name,
35
+ const xmlChar *ns_uri);
36
+
37
+ /*
38
+ * Interfaces for the functions implementations.
39
+ */
40
+
41
+ XSLTPUBFUN void XSLTCALL
42
+ xsltDocumentFunction (xmlXPathParserContextPtr ctxt,
43
+ int nargs);
44
+ XSLTPUBFUN void XSLTCALL
45
+ xsltKeyFunction (xmlXPathParserContextPtr ctxt,
46
+ int nargs);
47
+ XSLTPUBFUN void XSLTCALL
48
+ xsltUnparsedEntityURIFunction (xmlXPathParserContextPtr ctxt,
49
+ int nargs);
50
+ XSLTPUBFUN void XSLTCALL
51
+ xsltFormatNumberFunction (xmlXPathParserContextPtr ctxt,
52
+ int nargs);
53
+ XSLTPUBFUN void XSLTCALL
54
+ xsltGenerateIdFunction (xmlXPathParserContextPtr ctxt,
55
+ int nargs);
56
+ XSLTPUBFUN void XSLTCALL
57
+ xsltSystemPropertyFunction (xmlXPathParserContextPtr ctxt,
58
+ int nargs);
59
+ XSLTPUBFUN void XSLTCALL
60
+ xsltElementAvailableFunction (xmlXPathParserContextPtr ctxt,
61
+ int nargs);
62
+ XSLTPUBFUN void XSLTCALL
63
+ xsltFunctionAvailableFunction (xmlXPathParserContextPtr ctxt,
64
+ int nargs);
65
+
66
+ /*
67
+ * And the registration
68
+ */
69
+
70
+ XSLTPUBFUN void XSLTCALL
71
+ xsltRegisterAllFunctions (xmlXPathContextPtr ctxt);
72
+
73
+ #ifdef __cplusplus
74
+ }
75
+ #endif
76
+
77
+ #endif /* __XML_XSLT_FUNCTIONS_H__ */
78
+
@@ -0,0 +1,75 @@
1
+ /*
2
+ * Summary: interface for the XSLT import support
3
+ * Description: macros and fuctions needed to implement and
4
+ * access the import tree
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_XSLT_IMPORTS_H__
12
+ #define __XML_XSLT_IMPORTS_H__
13
+
14
+ #include <libxml/tree.h>
15
+ #include "xsltexports.h"
16
+ #include "xsltInternals.h"
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /**
23
+ * XSLT_GET_IMPORT_PTR:
24
+ *
25
+ * A macro to import pointers from the stylesheet cascading order.
26
+ */
27
+ #define XSLT_GET_IMPORT_PTR(res, style, name) { \
28
+ xsltStylesheetPtr st = style; \
29
+ res = NULL; \
30
+ while (st != NULL) { \
31
+ if (st->name != NULL) { res = st->name; break; } \
32
+ st = xsltNextImport(st); \
33
+ }}
34
+
35
+ /**
36
+ * XSLT_GET_IMPORT_INT:
37
+ *
38
+ * A macro to import intergers from the stylesheet cascading order.
39
+ */
40
+ #define XSLT_GET_IMPORT_INT(res, style, name) { \
41
+ xsltStylesheetPtr st = style; \
42
+ res = -1; \
43
+ while (st != NULL) { \
44
+ if (st->name != -1) { res = st->name; break; } \
45
+ st = xsltNextImport(st); \
46
+ }}
47
+
48
+ /*
49
+ * Module interfaces
50
+ */
51
+ XSLTPUBFUN int XSLTCALL
52
+ xsltParseStylesheetImport(xsltStylesheetPtr style,
53
+ xmlNodePtr cur);
54
+ XSLTPUBFUN int XSLTCALL
55
+ xsltParseStylesheetInclude
56
+ (xsltStylesheetPtr style,
57
+ xmlNodePtr cur);
58
+ XSLTPUBFUN xsltStylesheetPtr XSLTCALL
59
+ xsltNextImport (xsltStylesheetPtr style);
60
+ XSLTPUBFUN int XSLTCALL
61
+ xsltNeedElemSpaceHandling(xsltTransformContextPtr ctxt);
62
+ XSLTPUBFUN int XSLTCALL
63
+ xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt,
64
+ xmlNodePtr node);
65
+ XSLTPUBFUN xsltTemplatePtr XSLTCALL
66
+ xsltFindTemplate (xsltTransformContextPtr ctxt,
67
+ const xmlChar *name,
68
+ const xmlChar *nameURI);
69
+
70
+ #ifdef __cplusplus
71
+ }
72
+ #endif
73
+
74
+ #endif /* __XML_XSLT_IMPORTS_H__ */
75
+
@@ -0,0 +1,53 @@
1
+ /*
2
+ * Summary: interface for the key matching used in key() and template matches.
3
+ * Description: implementation of the key mechanims.
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_XSLT_KEY_H__
11
+ #define __XML_XSLT_KEY_H__
12
+
13
+ #include <libxml/xpath.h>
14
+ #include "xsltexports.h"
15
+ #include "xsltInternals.h"
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ /**
22
+ * NODE_IS_KEYED:
23
+ *
24
+ * check for bit 15 set
25
+ */
26
+ #define NODE_IS_KEYED (1 >> 15)
27
+
28
+ XSLTPUBFUN int XSLTCALL
29
+ xsltAddKey (xsltStylesheetPtr style,
30
+ const xmlChar *name,
31
+ const xmlChar *nameURI,
32
+ const xmlChar *match,
33
+ const xmlChar *use,
34
+ xmlNodePtr inst);
35
+ XSLTPUBFUN xmlNodeSetPtr XSLTCALL
36
+ xsltGetKey (xsltTransformContextPtr ctxt,
37
+ const xmlChar *name,
38
+ const xmlChar *nameURI,
39
+ const xmlChar *value);
40
+ XSLTPUBFUN void XSLTCALL
41
+ xsltInitCtxtKeys (xsltTransformContextPtr ctxt,
42
+ xsltDocumentPtr doc);
43
+ XSLTPUBFUN void XSLTCALL
44
+ xsltFreeKeys (xsltStylesheetPtr style);
45
+ XSLTPUBFUN void XSLTCALL
46
+ xsltFreeDocumentKeys (xsltDocumentPtr doc);
47
+
48
+ #ifdef __cplusplus
49
+ }
50
+ #endif
51
+
52
+ #endif /* __XML_XSLT_H__ */
53
+
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Summary: internal header only used during the compilation of libxslt
3
+ * Description: internal header only used during the compilation of libxslt
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XSLT_LIBXSLT_H__
11
+ #define __XSLT_LIBXSLT_H__
12
+
13
+ #if defined(WIN32) && !defined (__CYGWIN__) && !defined (__MINGW32__)
14
+ #include <win32config.h>
15
+ #else
16
+ #include "config.h"
17
+ #endif
18
+
19
+ #include <libxslt/xsltconfig.h>
20
+ #include <libxml/xmlversion.h>
21
+
22
+ #if !defined LIBXSLT_PUBLIC
23
+ #if (defined (__CYGWIN__) || defined _MSC_VER) && !defined IN_LIBXSLT && !defined LIBXSLT_STATIC
24
+ #define LIBXSLT_PUBLIC __declspec(dllimport)
25
+ #else
26
+ #define LIBXSLT_PUBLIC
27
+ #endif
28
+ #endif
29
+
30
+ #endif /* ! __XSLT_LIBXSLT_H__ */
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Summary: interface for the XSLT namespace handling
3
+ * Description: set of function easing the processing and generation
4
+ * of namespace nodes in XSLT.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_XSLT_NAMESPACES_H__
12
+ #define __XML_XSLT_NAMESPACES_H__
13
+
14
+ #include <libxml/tree.h>
15
+ #include "xsltexports.h"
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ /*
22
+ * Used within nsAliases hashtable when the default namespace is required
23
+ * but it's not been explicitly defined
24
+ */
25
+ /**
26
+ * UNDEFINED_DEFAULT_NS:
27
+ *
28
+ * Special value for undefined namespace, internal
29
+ */
30
+ #define UNDEFINED_DEFAULT_NS (const xmlChar *) -1L
31
+
32
+ XSLTPUBFUN void XSLTCALL
33
+ xsltNamespaceAlias (xsltStylesheetPtr style,
34
+ xmlNodePtr node);
35
+ XSLTPUBFUN xmlNsPtr XSLTCALL
36
+ xsltGetNamespace (xsltTransformContextPtr ctxt,
37
+ xmlNodePtr cur,
38
+ xmlNsPtr ns,
39
+ xmlNodePtr out);
40
+ XSLTPUBFUN xmlNsPtr XSLTCALL
41
+ xsltGetPlainNamespace (xsltTransformContextPtr ctxt,
42
+ xmlNodePtr cur,
43
+ xmlNsPtr ns,
44
+ xmlNodePtr out);
45
+ XSLTPUBFUN xmlNsPtr XSLTCALL
46
+ xsltGetSpecialNamespace (xsltTransformContextPtr ctxt,
47
+ xmlNodePtr cur,
48
+ const xmlChar *URI,
49
+ const xmlChar *prefix,
50
+ xmlNodePtr out);
51
+ XSLTPUBFUN xmlNsPtr XSLTCALL
52
+ xsltCopyNamespace (xsltTransformContextPtr ctxt,
53
+ xmlNodePtr elem,
54
+ xmlNsPtr ns);
55
+ XSLTPUBFUN xmlNsPtr XSLTCALL
56
+ xsltCopyNamespaceList (xsltTransformContextPtr ctxt,
57
+ xmlNodePtr node,
58
+ xmlNsPtr cur);
59
+ XSLTPUBFUN void XSLTCALL
60
+ xsltFreeNamespaceAliasHashes
61
+ (xsltStylesheetPtr style);
62
+
63
+ #ifdef __cplusplus
64
+ }
65
+ #endif
66
+
67
+ #endif /* __XML_XSLT_NAMESPACES_H__ */
68
+
@@ -0,0 +1,69 @@
1
+ /*
2
+ * Summary: Implementation of the XSLT number functions
3
+ * Description: Implementation of the XSLT number functions
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Bjorn Reese <breese@users.sourceforge.net> and Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_XSLT_NUMBERSINTERNALS_H__
11
+ #define __XML_XSLT_NUMBERSINTERNALS_H__
12
+
13
+ #include <libxml/tree.h>
14
+ #include "xsltexports.h"
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif
19
+
20
+ /**
21
+ * xsltNumberData:
22
+ *
23
+ * This data structure is just a wrapper to pass xsl:number data in.
24
+ */
25
+ typedef struct _xsltNumberData xsltNumberData;
26
+ typedef xsltNumberData *xsltNumberDataPtr;
27
+
28
+ struct _xsltNumberData {
29
+ const xmlChar *level;
30
+ const xmlChar *count;
31
+ const xmlChar *from;
32
+ const xmlChar *value;
33
+ const xmlChar *format;
34
+ int has_format;
35
+ int digitsPerGroup;
36
+ int groupingCharacter;
37
+ int groupingCharacterLen;
38
+ xmlDocPtr doc;
39
+ xmlNodePtr node;
40
+
41
+ /*
42
+ * accelerators
43
+ */
44
+ };
45
+
46
+ /**
47
+ * xsltFormatNumberInfo,:
48
+ *
49
+ * This data structure lists the various parameters needed to format numbers.
50
+ */
51
+ typedef struct _xsltFormatNumberInfo xsltFormatNumberInfo;
52
+ typedef xsltFormatNumberInfo *xsltFormatNumberInfoPtr;
53
+
54
+ struct _xsltFormatNumberInfo {
55
+ int integer_hash; /* Number of '#' in integer part */
56
+ int integer_digits; /* Number of '0' in integer part */
57
+ int frac_digits; /* Number of '0' in fractional part */
58
+ int frac_hash; /* Number of '#' in fractional part */
59
+ int group; /* Number of chars per display 'group' */
60
+ int multiplier; /* Scaling for percent or permille */
61
+ char add_decimal; /* Flag for whether decimal point appears in pattern */
62
+ char is_multiplier_set; /* Flag to catch multiple occurences of percent/permille */
63
+ char is_negative_pattern;/* Flag for processing -ve prefix/suffix */
64
+ };
65
+
66
+ #ifdef __cplusplus
67
+ }
68
+ #endif
69
+ #endif /* __XML_XSLT_NUMBERSINTERNALS_H__ */
@@ -0,0 +1,81 @@
1
+ /*
2
+ * Summary: interface for the pattern matching used in template matches.
3
+ * Description: the implementation of the lookup of the right template
4
+ * for a given node must be really fast in order to keep
5
+ * decent performances.
6
+ *
7
+ * Copy: See Copyright for the status of this software.
8
+ *
9
+ * Author: Daniel Veillard
10
+ */
11
+
12
+ #ifndef __XML_XSLT_PATTERN_H__
13
+ #define __XML_XSLT_PATTERN_H__
14
+
15
+ #include "xsltInternals.h"
16
+ #include "xsltexports.h"
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /**
23
+ * xsltCompMatch:
24
+ *
25
+ * Data structure used for the implementation of patterns.
26
+ * It is kept private (in pattern.c).
27
+ */
28
+ typedef struct _xsltCompMatch xsltCompMatch;
29
+ typedef xsltCompMatch *xsltCompMatchPtr;
30
+
31
+ /*
32
+ * Pattern related interfaces.
33
+ */
34
+
35
+ XSLTPUBFUN xsltCompMatchPtr XSLTCALL
36
+ xsltCompilePattern (const xmlChar *pattern,
37
+ xmlDocPtr doc,
38
+ xmlNodePtr node,
39
+ xsltStylesheetPtr style,
40
+ xsltTransformContextPtr runtime);
41
+ XSLTPUBFUN void XSLTCALL
42
+ xsltFreeCompMatchList (xsltCompMatchPtr comp);
43
+ XSLTPUBFUN int XSLTCALL
44
+ xsltTestCompMatchList (xsltTransformContextPtr ctxt,
45
+ xmlNodePtr node,
46
+ xsltCompMatchPtr comp);
47
+ XSLTPUBFUN void XSLTCALL
48
+ xsltNormalizeCompSteps (void *payload,
49
+ void *data,
50
+ const xmlChar *name);
51
+
52
+ /*
53
+ * Template related interfaces.
54
+ */
55
+ XSLTPUBFUN int XSLTCALL
56
+ xsltAddTemplate (xsltStylesheetPtr style,
57
+ xsltTemplatePtr cur,
58
+ const xmlChar *mode,
59
+ const xmlChar *modeURI);
60
+ XSLTPUBFUN xsltTemplatePtr XSLTCALL
61
+ xsltGetTemplate (xsltTransformContextPtr ctxt,
62
+ xmlNodePtr node,
63
+ xsltStylesheetPtr style);
64
+ XSLTPUBFUN void XSLTCALL
65
+ xsltFreeTemplateHashes (xsltStylesheetPtr style);
66
+ XSLTPUBFUN void XSLTCALL
67
+ xsltCleanupTemplates (xsltStylesheetPtr style);
68
+
69
+ #if 0
70
+ int xsltMatchPattern (xsltTransformContextPtr ctxt,
71
+ xmlNodePtr node,
72
+ const xmlChar *pattern,
73
+ xmlDocPtr ctxtdoc,
74
+ xmlNodePtr ctxtnode);
75
+ #endif
76
+ #ifdef __cplusplus
77
+ }
78
+ #endif
79
+
80
+ #endif /* __XML_XSLT_PATTERN_H__ */
81
+
@@ -0,0 +1,43 @@
1
+ /*
2
+ * Summary: precomputing stylesheets
3
+ * Description: this is the compilation phase, where most of the
4
+ * stylesheet is "compiled" into faster to use data.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_XSLT_PRECOMP_H__
12
+ #define __XML_XSLT_PRECOMP_H__
13
+
14
+ #include <libxml/tree.h>
15
+ #include "xsltexports.h"
16
+ #include "xsltInternals.h"
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ /*
23
+ * Interfaces
24
+ */
25
+ extern const xmlChar *xsltExtMarker;
26
+
27
+ XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
28
+ xsltDocumentComp (xsltStylesheetPtr style,
29
+ xmlNodePtr inst,
30
+ xsltTransformFunction function);
31
+
32
+ XSLTPUBFUN void XSLTCALL
33
+ xsltStylePreCompute (xsltStylesheetPtr style,
34
+ xmlNodePtr inst);
35
+ XSLTPUBFUN void XSLTCALL
36
+ xsltFreeStylePreComps (xsltStylesheetPtr style);
37
+
38
+ #ifdef __cplusplus
39
+ }
40
+ #endif
41
+
42
+ #endif /* __XML_XSLT_PRECOMP_H__ */
43
+
@@ -0,0 +1,104 @@
1
+ /*
2
+ * Summary: interface for the libxslt security framework
3
+ * Description: the libxslt security framework allow to restrict
4
+ * the access to new resources (file or URL) from
5
+ * the stylesheet at runtime.
6
+ *
7
+ * Copy: See Copyright for the status of this software.
8
+ *
9
+ * Author: Daniel Veillard
10
+ */
11
+
12
+ #ifndef __XML_XSLT_SECURITY_H__
13
+ #define __XML_XSLT_SECURITY_H__
14
+
15
+ #include <libxml/tree.h>
16
+ #include "xsltexports.h"
17
+ #include "xsltInternals.h"
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+ /**
24
+ * xsltSecurityPref:
25
+ *
26
+ * structure to indicate the preferences for security in the XSLT
27
+ * transformation.
28
+ */
29
+ typedef struct _xsltSecurityPrefs xsltSecurityPrefs;
30
+ typedef xsltSecurityPrefs *xsltSecurityPrefsPtr;
31
+
32
+ /**
33
+ * xsltSecurityOption:
34
+ *
35
+ * the set of option that can be configured
36
+ */
37
+ typedef enum {
38
+ XSLT_SECPREF_READ_FILE = 1,
39
+ XSLT_SECPREF_WRITE_FILE,
40
+ XSLT_SECPREF_CREATE_DIRECTORY,
41
+ XSLT_SECPREF_READ_NETWORK,
42
+ XSLT_SECPREF_WRITE_NETWORK
43
+ } xsltSecurityOption;
44
+
45
+ /**
46
+ * xsltSecurityCheck:
47
+ *
48
+ * User provided function to check the value of a string like a file
49
+ * path or an URL ...
50
+ */
51
+ typedef int (*xsltSecurityCheck) (xsltSecurityPrefsPtr sec,
52
+ xsltTransformContextPtr ctxt,
53
+ const char *value);
54
+
55
+ /*
56
+ * Module interfaces
57
+ */
58
+ XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
59
+ xsltNewSecurityPrefs (void);
60
+ XSLTPUBFUN void XSLTCALL
61
+ xsltFreeSecurityPrefs (xsltSecurityPrefsPtr sec);
62
+ XSLTPUBFUN int XSLTCALL
63
+ xsltSetSecurityPrefs (xsltSecurityPrefsPtr sec,
64
+ xsltSecurityOption option,
65
+ xsltSecurityCheck func);
66
+ XSLTPUBFUN xsltSecurityCheck XSLTCALL
67
+ xsltGetSecurityPrefs (xsltSecurityPrefsPtr sec,
68
+ xsltSecurityOption option);
69
+
70
+ XSLTPUBFUN void XSLTCALL
71
+ xsltSetDefaultSecurityPrefs (xsltSecurityPrefsPtr sec);
72
+ XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL
73
+ xsltGetDefaultSecurityPrefs (void);
74
+
75
+ XSLTPUBFUN int XSLTCALL
76
+ xsltSetCtxtSecurityPrefs (xsltSecurityPrefsPtr sec,
77
+ xsltTransformContextPtr ctxt);
78
+
79
+ XSLTPUBFUN int XSLTCALL
80
+ xsltSecurityAllow (xsltSecurityPrefsPtr sec,
81
+ xsltTransformContextPtr ctxt,
82
+ const char *value);
83
+ XSLTPUBFUN int XSLTCALL
84
+ xsltSecurityForbid (xsltSecurityPrefsPtr sec,
85
+ xsltTransformContextPtr ctxt,
86
+ const char *value);
87
+ /*
88
+ * internal interfaces
89
+ */
90
+ XSLTPUBFUN int XSLTCALL
91
+ xsltCheckWrite (xsltSecurityPrefsPtr sec,
92
+ xsltTransformContextPtr ctxt,
93
+ const xmlChar *URL);
94
+ XSLTPUBFUN int XSLTCALL
95
+ xsltCheckRead (xsltSecurityPrefsPtr sec,
96
+ xsltTransformContextPtr ctxt,
97
+ const xmlChar *URL);
98
+
99
+ #ifdef __cplusplus
100
+ }
101
+ #endif
102
+
103
+ #endif /* __XML_XSLT_SECURITY_H__ */
104
+
@@ -0,0 +1,77 @@
1
+ /*
2
+ * Summary: interface for the template processing
3
+ * Description: This set of routine encapsulates XPath calls
4
+ * and Attribute Value Templates evaluation.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __XML_XSLT_TEMPLATES_H__
12
+ #define __XML_XSLT_TEMPLATES_H__
13
+
14
+ #include <libxml/xpath.h>
15
+ #include <libxml/xpathInternals.h>
16
+ #include "xsltexports.h"
17
+ #include "xsltInternals.h"
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+ XSLTPUBFUN int XSLTCALL
24
+ xsltEvalXPathPredicate (xsltTransformContextPtr ctxt,
25
+ xmlXPathCompExprPtr comp,
26
+ xmlNsPtr *nsList,
27
+ int nsNr);
28
+ XSLTPUBFUN xmlChar * XSLTCALL
29
+ xsltEvalTemplateString (xsltTransformContextPtr ctxt,
30
+ xmlNodePtr contextNode,
31
+ xmlNodePtr inst);
32
+ XSLTPUBFUN xmlChar * XSLTCALL
33
+ xsltEvalAttrValueTemplate (xsltTransformContextPtr ctxt,
34
+ xmlNodePtr node,
35
+ const xmlChar *name,
36
+ const xmlChar *ns);
37
+ XSLTPUBFUN const xmlChar * XSLTCALL
38
+ xsltEvalStaticAttrValueTemplate (xsltStylesheetPtr style,
39
+ xmlNodePtr node,
40
+ const xmlChar *name,
41
+ const xmlChar *ns,
42
+ int *found);
43
+
44
+ /* TODO: this is obviously broken ... the namespaces should be passed too ! */
45
+ XSLTPUBFUN xmlChar * XSLTCALL
46
+ xsltEvalXPathString (xsltTransformContextPtr ctxt,
47
+ xmlXPathCompExprPtr comp);
48
+ XSLTPUBFUN xmlChar * XSLTCALL
49
+ xsltEvalXPathStringNs (xsltTransformContextPtr ctxt,
50
+ xmlXPathCompExprPtr comp,
51
+ int nsNr,
52
+ xmlNsPtr *nsList);
53
+
54
+ XSLTPUBFUN xmlNodePtr * XSLTCALL
55
+ xsltTemplateProcess (xsltTransformContextPtr ctxt,
56
+ xmlNodePtr node);
57
+ XSLTPUBFUN xmlAttrPtr XSLTCALL
58
+ xsltAttrListTemplateProcess (xsltTransformContextPtr ctxt,
59
+ xmlNodePtr target,
60
+ xmlAttrPtr cur);
61
+ XSLTPUBFUN xmlAttrPtr XSLTCALL
62
+ xsltAttrTemplateProcess (xsltTransformContextPtr ctxt,
63
+ xmlNodePtr target,
64
+ xmlAttrPtr attr);
65
+ XSLTPUBFUN xmlChar * XSLTCALL
66
+ xsltAttrTemplateValueProcess (xsltTransformContextPtr ctxt,
67
+ const xmlChar* attr);
68
+ XSLTPUBFUN xmlChar * XSLTCALL
69
+ xsltAttrTemplateValueProcessNode(xsltTransformContextPtr ctxt,
70
+ const xmlChar* str,
71
+ xmlNodePtr node);
72
+ #ifdef __cplusplus
73
+ }
74
+ #endif
75
+
76
+ #endif /* __XML_XSLT_TEMPLATES_H__ */
77
+