]> mj.ucw.cz Git - libucw.git/commitdiff
XML: ABI cleanup
authorMartin Mares <mj@ucw.cz>
Thu, 12 Feb 2015 18:31:53 +0000 (19:31 +0100)
committerMartin Mares <mj@ucw.cz>
Thu, 12 Feb 2015 18:31:53 +0000 (19:31 +0100)
maint/abi-map-symbols
maint/libucw.abi
xml/dtd.h
xml/internals.h
xml/source.c
xml/unicat.pl
xml/xml.h

index 94d3016dafc309938d3e9111b7beccb9ca813a39..0a5e2f0f2eb19d960068eed2849feea36d302326 100755 (executable)
@@ -79,7 +79,7 @@ my %blacklist = map { $_ => 1 } qw(
        images/scale-gen.h
 );
 
-for my $f (<ucw/*.h>, <ucw/sorter/common.h>, <charset/*.h>, <images/*.h>) {
+for my $f (<ucw/*.h>, <ucw/sorter/common.h>, <charset/*.h>, <images/*.h>, <xml/*.h>) {
        next if $blacklist{$f};
        parse($f);
 }
index 813398f259507c581894fe4a0a77f4e3c544a64a..90ab410ecc875db700aac81296ba38de48b20430 100644 (file)
@@ -803,3 +803,66 @@ image_sig_segmentation
 image_sig_detect_textured
 image_signatures_dist
 image_signatures_dist_explain
+# xml/dtd.h
+xml_dtd_find_notn
+xml_dtd_find_entity
+xml_dtd_find_elem
+xml_dtd_init
+xml_dtd_cleanup
+xml_dtd_finish
+xml_dtd_find_attr
+# xml/internals.h
+xml_throw
+xml_hash_new
+xml_spout_chars
+xml_fatal_nested
+xml_push_source
+xml_push_entity
+xml_refill
+xml_sources_cleanup
+xml_fatal_expected
+xml_fatal_expected_white
+xml_fatal_expected_quot
+xml_parse_eq
+xml_parse_name
+xml_skip_name
+xml_parse_nmtoken
+xml_parse_system_literal
+xml_parse_pubid_literal
+xml_parse_char_ref
+xml_parse_pe_ref
+xml_parse_attr_value
+xml_skip_internal_subset
+xml_parse_notation_decl
+xml_parse_entity_decl
+xml_parse_element_decl
+xml_parse_attr_list_decl
+xml_push_comment
+xml_pop_comment
+xml_skip_comment
+xml_push_pi
+xml_pop_pi
+xml_skip_pi
+xml_attrs_table_init
+xml_attrs_table_cleanup
+xml_validate_attr
+# xml/xml.h
+xml_init
+xml_cleanup
+xml_reset
+xml_push_fastbuf
+xml_parse
+xml_next
+xml_next_state
+xml_skip_element
+xml_row
+xml_attr_find
+xml_attr_value
+xml_def_find_entity
+xml_def_resolve_entity
+xml_normalize_white
+xml_merge_chars
+xml_merge_dom_chars
+xml_warn
+xml_error
+xml_fatal
index 5249853f5dbb725532c3ceb060eac6133bde8167..d3524ad16dfb5fdeea1a4ba489fd866d40f944a0 100644 (file)
--- a/xml/dtd.h
+++ b/xml/dtd.h
 
 #include <xml/xml.h>
 
+#ifdef CONFIG_UCW_CLEAN_ABI
+#define xml_dtd_cleanup ucw_xml_dtd_cleanup
+#define xml_dtd_find_attr ucw_xml_dtd_find_attr
+#define xml_dtd_find_elem ucw_xml_dtd_find_elem
+#define xml_dtd_find_entity ucw_xml_dtd_find_entity
+#define xml_dtd_find_notn ucw_xml_dtd_find_notn
+#define xml_dtd_finish ucw_xml_dtd_finish
+#define xml_dtd_init ucw_xml_dtd_init
+#endif
+
 struct xml_dtd {
   struct mempool *pool;                        /* Memory pool where to allocate DTD */
   slist ents;                          /* Link list of general entities */
index 2a27126c0e954dc4835b018f400e6d09b636c8d8..a605733bf8f4189befe3ea6363269ac2cc3f20f9 100644 (file)
 #include <xml/xml.h>
 #include <xml/dtd.h>
 
+#ifdef CONFIG_UCW_CLEAN_ABI
+#define xml_attrs_table_cleanup ucw_xml_attrs_table_cleanup
+#define xml_attrs_table_init ucw_xml_attrs_table_init
+#define xml_fatal_expected ucw_xml_fatal_expected
+#define xml_fatal_expected_quot ucw_xml_fatal_expected_quot
+#define xml_fatal_expected_white ucw_xml_fatal_expected_white
+#define xml_fatal_nested ucw_xml_fatal_nested
+#define xml_hash_new ucw_xml_hash_new
+#define xml_parse_attr_list_decl ucw_xml_parse_attr_list_decl
+#define xml_parse_attr_value ucw_xml_parse_attr_value
+#define xml_parse_char_ref ucw_xml_parse_char_ref
+#define xml_parse_element_decl ucw_xml_parse_element_decl
+#define xml_parse_entity_decl ucw_xml_parse_entity_decl
+#define xml_parse_eq ucw_xml_parse_eq
+#define xml_parse_name ucw_xml_parse_name
+#define xml_parse_nmtoken ucw_xml_parse_nmtoken
+#define xml_parse_notation_decl ucw_xml_parse_notation_decl
+#define xml_parse_pe_ref ucw_xml_parse_pe_ref
+#define xml_parse_pubid_literal ucw_xml_parse_pubid_literal
+#define xml_parse_system_literal ucw_xml_parse_system_literal
+#define xml_pop_comment ucw_xml_pop_comment
+#define xml_pop_pi ucw_xml_pop_pi
+#define xml_push_comment ucw_xml_push_comment
+#define xml_push_entity ucw_xml_push_entity
+#define xml_push_pi ucw_xml_push_pi
+#define xml_push_source ucw_xml_push_source
+#define xml_refill ucw_xml_refill
+#define xml_skip_comment ucw_xml_skip_comment
+#define xml_skip_internal_subset ucw_xml_skip_internal_subset
+#define xml_skip_name ucw_xml_skip_name
+#define xml_skip_pi ucw_xml_skip_pi
+#define xml_sources_cleanup ucw_xml_sources_cleanup
+#define xml_spout_chars ucw_xml_spout_chars
+#define xml_throw ucw_xml_throw
+#define xml_validate_attr ucw_xml_validate_attr
+#endif
+
 /*** Debugging ***/
 
 #ifdef LOCAL_DEBUG
@@ -33,8 +70,7 @@ struct xml_stack {
   uint flags;
 };
 
-static inline void *
-xml_do_push(struct xml_context *ctx, uint size)
+static inline void *xml_do_push(struct xml_context *ctx, uint size)
 {
   /* Saves ctx->stack and ctx->flags state */
   struct mempool_state state;
@@ -47,8 +83,7 @@ xml_do_push(struct xml_context *ctx, uint size)
   return s;
 }
 
-static inline void
-xml_do_pop(struct xml_context *ctx, struct xml_stack *s)
+static inline void xml_do_pop(struct xml_context *ctx, struct xml_stack *s)
 {
   /* Restore ctx->stack and ctx->flags state */
   ctx->stack_list = s->next;
@@ -56,15 +91,13 @@ xml_do_pop(struct xml_context *ctx, struct xml_stack *s)
   mp_restore(ctx->stack, &s->state);
 }
 
-static inline void
-xml_push(struct xml_context *ctx)
+static inline void xml_push(struct xml_context *ctx)
 {
   TRACE(ctx, "push");
   xml_do_push(ctx, sizeof(struct xml_stack));
 }
 
-static inline void
-xml_pop(struct xml_context *ctx)
+static inline void xml_pop(struct xml_context *ctx)
 {
   TRACE(ctx, "pop");
   ASSERT(ctx->stack_list);
@@ -76,8 +109,7 @@ struct xml_dom_stack {
   struct mempool_state state;
 };
 
-static inline struct xml_node *
-xml_push_dom(struct xml_context *ctx, struct mempool_state *state)
+static inline struct xml_node *xml_push_dom(struct xml_context *ctx, struct mempool_state *state)
 {
   /* Create a new DOM node */
   TRACE(ctx, "push_dom");
@@ -93,8 +125,7 @@ xml_push_dom(struct xml_context *ctx, struct mempool_state *state)
   return ctx->node = n;
 }
 
-static inline void
-xml_pop_dom(struct xml_context *ctx, uint free)
+static inline void xml_pop_dom(struct xml_context *ctx, uint free)
 {
   /* Leave DOM subtree */
   TRACE(ctx, "pop_dom");
@@ -126,16 +157,14 @@ void xml_spout_chars(struct fastbuf *fb);
 
 void NONRET xml_fatal_nested(struct xml_context *ctx);
 
-static inline void
-xml_inc(struct xml_context *ctx)
+static inline void xml_inc(struct xml_context *ctx)
 {
   /* Called after the first character of a block */
   TRACE(ctx, "inc");
   ctx->depth++;
 }
 
-static inline void
-xml_dec(struct xml_context *ctx)
+static inline void xml_dec(struct xml_context *ctx)
 {
   /* Called after the last character of a block */
   TRACE(ctx, "dec");
@@ -145,21 +174,19 @@ xml_dec(struct xml_context *ctx)
 
 #include "obj/xml/unicat.h"
 
-static inline uint
-xml_char_cat(uint c)
+static inline uint xml_char_cat(uint c)
 {
   if (c < 0x10000)
-    return 1U << xml_char_tab1[(c & 0xff) + xml_char_tab2[c >> 8]];
+    return 1U << ucw_xml_char_tab1[(c & 0xff) + ucw_xml_char_tab2[c >> 8]];
   else if (likely(c < 0x110000))
-    return 1U << xml_char_tab3[c >> 16];
+    return 1U << ucw_xml_char_tab3[c >> 16];
   else
     return 1;
 }
 
-static inline uint
-xml_ascii_cat(uint c)
+static inline uint xml_ascii_cat(uint c)
 {
-  return xml_char_tab1[c];
+  return ucw_xml_char_tab1[c];
 }
 
 struct xml_source *xml_push_source(struct xml_context *ctx);
@@ -167,60 +194,52 @@ void xml_push_entity(struct xml_context *ctx, struct xml_dtd_entity *ent);
 
 void xml_refill(struct xml_context *ctx);
 
-static inline uint
-xml_peek_char(struct xml_context *ctx)
+static inline uint xml_peek_char(struct xml_context *ctx)
 {
   if (ctx->bptr == ctx->bstop)
     xml_refill(ctx);
   return ctx->bptr[0];
 }
 
-static inline uint
-xml_peek_cat(struct xml_context *ctx)
+static inline uint xml_peek_cat(struct xml_context *ctx)
 {
   if (ctx->bptr == ctx->bstop)
     xml_refill(ctx);
   return ctx->bptr[1];
 }
 
-static inline uint
-xml_get_char(struct xml_context *ctx)
+static inline uint xml_get_char(struct xml_context *ctx)
 {
   uint c = xml_peek_char(ctx);
   ctx->bptr += 2;
   return c;
 }
 
-static inline uint
-xml_get_cat(struct xml_context *ctx)
+static inline uint xml_get_cat(struct xml_context *ctx)
 {
   uint c = xml_peek_cat(ctx);
   ctx->bptr += 2;
   return c;
 }
 
-static inline uint
-xml_last_char(struct xml_context *ctx)
+static inline uint xml_last_char(struct xml_context *ctx)
 {
   return ctx->bptr[-2];
 }
 
-static inline uint
-xml_last_cat(struct xml_context *ctx)
+static inline uint xml_last_cat(struct xml_context *ctx)
 {
   return ctx->bptr[-1];
 }
 
-static inline uint
-xml_skip_char(struct xml_context *ctx)
+static inline uint xml_skip_char(struct xml_context *ctx)
 {
   uint c = ctx->bptr[0];
   ctx->bptr += 2;
   return c;
 }
 
-static inline uint
-xml_unget_char(struct xml_context *ctx)
+static inline uint xml_unget_char(struct xml_context *ctx)
 {
   return *(ctx->bptr -= 2);
 }
@@ -233,8 +252,7 @@ void NONRET xml_fatal_expected(struct xml_context *ctx, uint c);
 void NONRET xml_fatal_expected_white(struct xml_context *ctx);
 void NONRET xml_fatal_expected_quot(struct xml_context *ctx);
 
-static inline uint
-xml_parse_white(struct xml_context *ctx, uint mandatory)
+static inline uint xml_parse_white(struct xml_context *ctx, uint mandatory)
 {
   /* mandatory=1 -> S ::= (#x20 | #x9 | #xD | #xA)+
    * mandatory=0 -> S? */
@@ -249,16 +267,14 @@ xml_parse_white(struct xml_context *ctx, uint mandatory)
   return cnt;
 }
 
-static inline void
-xml_parse_char(struct xml_context *ctx, uint c)
+static inline void xml_parse_char(struct xml_context *ctx, uint c)
 {
   /* Consumes a given Unicode character */
   if (unlikely(c != xml_get_char(ctx)))
     xml_fatal_expected(ctx, c);
 }
 
-static inline void
-xml_parse_seq(struct xml_context *ctx, const char *seq)
+static inline void xml_parse_seq(struct xml_context *ctx, const char *seq)
 {
   /* Consumes a given sequence of ASCII characters */
   while (*seq)
@@ -267,8 +283,7 @@ xml_parse_seq(struct xml_context *ctx, const char *seq)
 
 void xml_parse_eq(struct xml_context *ctx);
 
-static inline uint
-xml_parse_quote(struct xml_context *ctx)
+static inline uint xml_parse_quote(struct xml_context *ctx)
 {
   /* "'" | '"' */
   uint c = xml_get_char(ctx);
index 8df409ff172931bdbddf61c933072e6d6fb66fa7..d369c319a5b9dd8212d34513e7eb3def27b18e7a 100644 (file)
@@ -175,7 +175,7 @@ xml_error_restricted(struct xml_context *ctx, uint c)
   return UNI_REPLACEMENT;
 }
 
-void xml_parse_decl(struct xml_context *ctx);
+static void xml_parse_decl(struct xml_context *ctx);
 
 #define REFILL(ctx, func, params...)                                                   \
   struct xml_source *src = ctx->src;                                                   \
@@ -314,7 +314,7 @@ xml_init_charconv(struct xml_context *ctx, int cs)
   src->fb = fb_wrap_charconv_in(src->fb, cs, CONV_CHARSET_UTF8);
 }
 
-void
+static void
 xml_parse_decl(struct xml_context *ctx)
 {
   TRACE(ctx, "xml_parse_decl");
index 5e711846899a7063ac9ae7cba8846406969b7f60..c1bc442bd77a9a0fe2ee1891a35fb761b4f7d8b4 100755 (executable)
@@ -133,11 +133,11 @@ sub gen_tabs {
   my @tab = ();
   my %hash = ();
 
-  print H "extern const byte xml_char_tab1[];\n";
-  print H "extern const uint xml_char_tab2[];\n";
-  print H "extern const byte xml_char_tab3[];\n";
+  print H "extern const byte ucw_xml_char_tab1[];\n";
+  print H "extern const uint ucw_xml_char_tab2[];\n";
+  print H "extern const byte ucw_xml_char_tab3[];\n";
 
-  print C "const uint xml_char_tab2[] = {\n  ";
+  print C "const uint ucw_xml_char_tab2[] = {\n  ";
   for (my $t=0; $t<256; $t++) {
     my $i = $t * 256;
     my @x = ();
@@ -153,7 +153,7 @@ sub gen_tabs {
     print C ((~$t & 15) ? "," : ($t < 255) ? ",\n  " : "\n};\n\n");
   }
 
-  print C "const byte xml_char_tab1[] = {\n";
+  print C "const byte ucw_xml_char_tab1[] = {\n";
   print C join(",\n\n", @tab);
   print C "\n};\n\n";
 
@@ -161,5 +161,5 @@ sub gen_tabs {
   for (my $i=0; $i<0x11; $i++) {
     push @l, sprintf("%d", $cls{$lcat[$i]});
   }
-  print C "const byte xml_char_tab3[] = {" . join(",", @l) . "};\n";
+  print C "const byte ucw_xml_char_tab3[] = {" . join(",", @l) . "};\n";
 }
index d8c797831d899f7c87a2c183ca0b8e8e47948f42..c048f56cab8a44acb09a0c43af03a2d542f5184a 100644 (file)
--- a/xml/xml.h
+++ b/xml/xml.h
 #include <ucw/mempool.h>
 #include <ucw/fastbuf.h>
 
+#ifdef CONFIG_UCW_CLEAN_ABI
+#define xml_attr_find ucw_xml_attr_find
+#define xml_attr_value ucw_xml_attr_value
+#define xml_cleanup ucw_xml_cleanup
+#define xml_def_find_entity ucw_xml_def_find_entity
+#define xml_def_resolve_entity ucw_xml_def_resolve_entity
+#define xml_error ucw_xml_error
+#define xml_fatal ucw_xml_fatal
+#define xml_init ucw_xml_init
+#define xml_merge_chars ucw_xml_merge_chars
+#define xml_merge_dom_chars ucw_xml_merge_dom_chars
+#define xml_next ucw_xml_next
+#define xml_next_state ucw_xml_next_state
+#define xml_normalize_white ucw_xml_normalize_white
+#define xml_parse ucw_xml_parse
+#define xml_push_fastbuf ucw_xml_push_fastbuf
+#define xml_reset ucw_xml_reset
+#define xml_row ucw_xml_row
+#define xml_skip_element ucw_xml_skip_element
+#define xml_warn ucw_xml_warn
+#endif
+
 struct xml_context;
 struct xml_dtd_entity;