--- /dev/null
+#!/usr/bin/perl
+# Check symbols exported by a library
+# (c) 2014 Martin Mares <mj@ucw.cz>
+
+use common::sense;
+
+my $lib = $ARGV[0] or die "Usage: $0 <library>\n";
+open my $f, '-|', 'nm', $lib or die;
+while (<$f>) {
+ chomp;
+ next if /^\s/;
+ my ($addr, $type, $sym) = split /\s+/;
+ if ($sym =~ m{^(ucw|ucwlib)_}) {
+ next
+ }
+ if ($type =~ m{[A-Z]}) {
+ print "$sym ($type)\n";
+ }
+}
+close $f or die;
--- /dev/null
+#!/usr/bin/perl
+# Search for symbols which might need renaming
+# (c) 2014 Martin Mares <mj@ucw.cz>
+
+use common::sense;
+
+sub symbol {
+ my ($sym) = @_;
+ return if $sym =~ m{^(ucw|ucwlib)_};
+ print "$sym\n";
+}
+
+sub parse {
+ my ($file) = @_;
+ print "# $file\n";
+ open my $f, '<', $file or die;
+ while (<$f>) {
+ chomp;
+ # Interpret special comments
+ m{// NOAPI} and next;
+ if (m{// API: (\w+)}) {
+ print "$1\n";
+ next;
+ }
+ # Find things which look like top-level declarations
+ s{//.*}{};
+ s{/\*.*}{};
+ /^\s/ and next;
+ /^$/ and next;
+ /^#/ and next;
+ /^{/ and next;
+ /}/ and next;
+ /^"/ and next;
+ /^-/ and next; # Magic for ucw/getopt.h
+ /^\w+:/ and next; # Labels in inline functions
+ /^typedef\s/ and next;
+ /^static\s/ and next;
+ /^(struct|union|enum)(\s+\w+)?(;|\s*{)/ and next;
+
+ # print "$_\n";
+
+ # Try to parse the declaration
+ s{\[[^\]]*\]}{}g; # Delete array sizes
+ if (m{^extern [^,]*(\s+\**\w+(,\s+\**\w+)*);}) {
+ my $x = $1;
+ $x =~ s{[,*]}{}g;
+ symbol $_ for grep { !/^$/ } split /\s+/, $x;
+ } elsif (m{( |\*)(\w+)\(}) {
+ symbol($2);
+ } else {
+ print "??? $_\n";
+ }
+
+ }
+ close $f;
+}
+
+my %blacklist = map { $_ => 1 } qw(
+ ucw/binheap.h
+ ucw/char-map.h
+ ucw/ff-binary.h
+ ucw/gbuf.h
+ ucw/hashtable.h
+ ucw/kmp.h
+ ucw/kmp-search.h
+ ucw/redblack.h
+ ucw/str-match.h
+ ucw/strtonum.h
+ ucw/strtonum-gen.h
+ ucw/trie.h
+ charset/charconv-gen.h
+ charset/chartable.h
+ charset/U-cat.h
+ charset/U-ligatures.h
+ charset/U-lower.h
+ charset/U-unacc.h
+ charset/U-upper.h
+ images/image-walk.h
+ images/scale-gen.h
+);
+
+for my $f (<ucw/*.h>, <ucw/sorter/common.h>, <charset/*.h>, <images/*.h>) {
+ next if $blacklist{$f};
+ parse($f);
+}
--- /dev/null
+#!/usr/bin/perl
+# Re-generate symbol renaming defines
+# (c) 2014 Martin Mares <mj@ucw.cz>
+
+use common::sense;
+
+my %renames = ();
+open my $f, '<', 'maint/libucw.abi' or die;
+my $current;
+while (<$f>) {
+ chomp;
+ if (/^#\s*(.*)/) {
+ $current = $1;
+ } else {
+ push @{$renames{$current}}, $_;
+ }
+}
+close $f;
+
+for my $g (sort keys %renames) {
+ my @symbols = sort @{$renames{$g}};
+ @symbols or next;
+
+ open my $in, '<', $g or die;
+ open my $out, '>', "$g.new" or die;
+ my $mode = 0;
+ my $cmt = 0;
+ while (<$in>) {
+ if (!$mode) {
+ if (m{^/\*$} && !$cmt) {
+ $cmt = 1;
+ } elsif (m{^\s} ||
+ m{^#include\s} ||
+ m{^#define\s+_} ||
+ m{^#ifndef\s+_} ||
+ m{^\s*$}
+ ) {
+ # Waiting for the right spot
+ } elsif (m{^#ifdef CONFIG_UCW_CLEAN_ABI$}) {
+ $mode = 2;
+ next;
+ } else {
+ $mode = 1;
+ print $out "#ifdef CONFIG_UCW_CLEAN_ABI\n";
+ for my $sym (@symbols) {
+ print $out "#define $sym ucw_$sym\n";
+ }
+ print $out "#endif\n\n";
+ }
+ } elsif ($mode == 2) {
+ if (m{^$}) {
+ $mode = 0;
+ }
+ next;
+ }
+ print $out "$_";
+ }
+ $mode or die;
+ close $out;
+ close $in;
+ system "cmp", "-s", $g, "$g.new";
+ if ($?) {
+ print "### $g: updated\n";
+ rename "$g.new", $g or die;
+ } else {
+ print "--- $g: not modified\n";
+ unlink "$g.new" or die;
+ }
+}
--- /dev/null
+# ucw/asio.h
+asio_init_queue
+asio_cleanup_queue
+asio_get
+asio_submit
+asio_wait
+asio_put
+asio_sync
+# ucw/base224.h
+base224_encode
+base224_decode
+# ucw/base64.h
+base64_encode
+base64_decode
+# ucw/bbuf.h
+bb_vprintf
+bb_printf
+bb_vprintf_at
+bb_printf_at
+# ucw/binheap-node.h
+# ucw/binsearch.h
+# ucw/bitarray.h
+bit_array_xrealloc
+bit_array_count_bits
+# ucw/bitops.h
+bit_fls
+ffs_table
+# ucw/bitsig.h
+bitsig_init
+bitsig_free
+bitsig_member
+bitsig_insert
+# ucw/chartype.h
+# ucw/clists.h
+# ucw/conf-internal.h
+cf_obtain_context
+cf_op_names
+cf_type_names
+cf_type_size
+cf_interpret_line
+cf_init_stack
+cf_done_stack
+cf_journal_swap
+cf_journal_delete
+cf_sections
+cf_find_subitem
+cf_commit_all
+cf_add_dirty
+cf_load_default
+# ucw/conf.h
+cf_new_context
+cf_delete_context
+cf_switch_context
+cf_load
+cf_reload
+cf_set
+cf_open_group
+cf_close_group
+cf_revert
+cf_get_pool
+cf_malloc
+cf_malloc_zero
+cf_strdup
+cf_printf
+cf_set_journalling
+cf_journal_block
+cf_journal_new_transaction
+cf_journal_commit_transaction
+cf_journal_rollback_transaction
+cf_declare_section
+cf_declare_rel_section
+cf_init_section
+cf_parse_int
+cf_parse_u64
+cf_parse_double
+cf_parse_ip
+cf_find_item
+cf_modify_item
+cf_dump_sections
+# ucw/config.h
+# ucw/crc-tables.h
+crc_tableil8_o32
+crc_tableil8_o40
+crc_tableil8_o48
+crc_tableil8_o56
+crc_tableil8_o64
+crc_tableil8_o72
+crc_tableil8_o80
+crc_tableil8_o88
+# ucw/crc.h
+crc32_init
+crc32_hash_buffer
+# ucw/daemon.h
+daemon_init
+daemon_run
+daemon_exit
+daemon_control
+# ucw/eltpool.h
+ep_new
+ep_delete
+ep_total_size
+ep_alloc_slow
+# ucw/fastbuf.h
+fb_tie
+fbpar_cf
+fbpar_def
+bopen_file
+bopen_file_try
+bopen_tmp_file
+bopen_fd_name
+bfilesync
+bopen
+bopen_try
+bopen_tmp
+bfdopen
+bfdopen_shared
+temp_file_name
+open_tmp
+bfix_tmp_file
+bfdopen_internal
+bfmmopen_internal
+fbdir_cheat
+fbdir_open_fd_internal
+bclose_file_helper
+bopen_limited_fd
+fbmem_create
+fbmem_clone_read
+fbbuf_init_read
+fbbuf_init_write
+fbgrow_create
+fbgrow_create_mp
+fbgrow_reset
+fbgrow_rewind
+fbgrow_get_buf
+fbpool_init
+fbpool_start
+fbpool_end
+fbatomic_open
+fbatomic_internal_write
+fbmulti_create
+fbmulti_append
+fbmulti_remove
+bconfig
+bclose
+bthrow
+brefill
+bspout
+bflush
+bseek
+bsetpos
+brewind
+bfilesize
+bgetc_slow
+bpeekc_slow
+beof_slow
+bputc_slow
+bread_slow
+bwrite_slow
+bgets
+bgets0
+bgets_nodie
+bgets_bb
+bgets_mp
+bgets_stk_init
+bgets_stk_step
+bbcopy_slow
+bskip_slow
+bprintf
+vbprintf
+# ucw/fb-socket.h
+fbsock_create
+# ucw/ff-binary.h
+bgetw_slow
+bgetw_be_slow
+bgetw_le_slow
+bgetl_slow
+bgetl_be_slow
+bgetl_le_slow
+bgetq_slow
+bgetq_be_slow
+bgetq_le_slow
+bget5_slow
+bget5_be_slow
+bget5_le_slow
+bputw_slow
+bputw_be_slow
+bputw_le_slow
+bputl_slow
+bputl_be_slow
+bputl_le_slow
+bputq_slow
+bputq_be_slow
+bputq_le_slow
+bput5_slow
+bput5_be_slow
+bput5_le_slow
+# ucw/ff-unicode.h
+bget_utf8_slow
+bget_utf8_32_slow
+bput_utf8_slow
+bput_utf8_32_slow
+bget_utf16_be_slow
+bget_utf16_le_slow
+bput_utf16_be_slow
+bput_utf16_le_slow
+# ucw/ff-varint.h
+bget_varint_slow
+bput_varint_slow
+# ucw/gary.h
+gary_allocator_default
+gary_allocator_zeroed
+gary_init
+gary_set_size
+gary_push_helper
+gary_fix
+# ucw/getopt.h
+cf_def_file
+cf_env_file
+cf_getopt
+reset_getopt
+# ucw/hashfunc.h
+str_len_aligned
+hash_string_aligned
+hash_block_aligned
+str_len
+hash_string
+hash_block
+hash_string_nocase
+# ucw/heap.h
+# ucw/io.h
+mmap_file
+munmap_file
+careful_read
+careful_write
+sync_dir
+# ucw/ipaccess.h
+ipaccess_cf
+ipaccess_check
+ip_addrmask_type
+ip_addrmask_match
+# ucw/lib.h
+msg
+vmsg
+die
+vdie
+log_title
+log_pid
+log_die_hook
+log_init
+log_fork
+log_file
+assert_failed
+assert_failed_noinfo
+xmalloc
+xrealloc
+xfree
+xmalloc_zero
+xstrdup
+page_alloc
+page_alloc_zero
+page_free
+page_realloc
+big_alloc
+big_alloc_zero
+big_free
+random_u32
+random_max
+random_u64
+random_max_u64
+# ucw/lizard.h
+lizard_compress
+lizard_decompress
+lizard_alloc
+lizard_free
+lizard_decompress_safe
+adler32_update
+# ucw/log-internal.h
+log_pass_msg
+log_streams
+log_streams_after
+log_stream_default
+log_type_names
+# ucw/log.h
+log_register_type
+log_find_type
+log_type_name
+log_new_stream
+log_close_stream
+log_add_substream
+log_rm_substream
+log_set_format
+log_stream_by_flags
+log_set_default_stream
+log_close_all
+log_new_file
+log_new_fd
+log_switch_disable
+log_switch_enable
+log_switch
+log_new_syslog
+log_syslog_facility_exists
+log_new_configured
+log_configured
+log_check_configured
+# ucw/mainloop.h
+main_new
+main_delete
+main_destroy
+main_switch_context
+main_current
+main_init
+main_cleanup
+main_teardown
+main_loop
+main_step
+main_debug_context
+timer_add
+timer_add_rel
+timer_del
+main_get_time
+timer_debug
+hook_add
+hook_del
+hook_debug
+file_add
+file_chg
+file_del
+file_debug
+block_io_add
+block_io_del
+block_io_read
+block_io_write
+block_io_set_timeout
+rec_io_add
+rec_io_del
+rec_io_start_read
+rec_io_stop_read
+rec_io_set_timeout
+rec_io_write
+rec_io_parse_line
+process_add
+process_del
+process_fork
+process_debug
+signal_add
+signal_del
+signal_debug
+# ucw/md5.h
+md5_init
+md5_update
+md5_final
+md5_transform
+md5_hash_buffer
+# ucw/mempool.h
+mp_init
+mp_new
+mp_delete
+mp_flush
+mp_stats
+mp_total_size
+mp_alloc_internal
+mp_alloc
+mp_alloc_noalign
+mp_alloc_zero
+mp_start_internal
+mp_grow_internal
+mp_spread_internal
+mp_start
+mp_start_noalign
+mp_open
+mp_realloc
+mp_realloc_zero
+mp_push
+mp_restore
+mp_pop
+mp_strdup
+mp_memdup
+mp_multicat
+mp_strjoin
+mp_str_from_mem
+mp_printf
+mp_vprintf
+mp_printf_append
+mp_vprintf_append
+# ucw/opt-internal.h
+opt_precompute
+# ucw/opt.h
+opt_parse
+opt_failure
+opt_help
+opt_handle_help
+opt_handle_config
+opt_handle_set
+opt_handle_dumpconfig
+opt_conf_hook_internal
+cf_def_file
+cf_env_file
+# ucw/partmap.h
+partmap_open
+partmap_close
+partmap_size
+partmap_load
+# ucw/prime.h
+isprime
+nextprime
+next_table_prime
+prev_table_prime
+# ucw/process.h
+setproctitle_init
+setproctitle
+getproctitle
+format_exit_status
+run_command
+exec_command
+echo_command
+run_command_v
+exec_command_v
+echo_command_v
+# ucw/regex.h
+rx_compile
+rx_free
+rx_match
+rx_subst
+# ucw/resource.h
+rp_new
+rp_delete
+rp_detach
+rp_commit
+rp_dump
+res_alloc
+res_dump
+res_free
+res_detach
+res_add
+res_drop
+res_for_fd
+res_malloc
+res_malloc_zero
+res_realloc
+res_subpool
+res_mempool
+res_eltpool
+# ucw/semaphore.h
+# ucw/sha1.h
+sha1_init
+sha1_update
+sha1_final
+sha1_hash_buffer
+sha1_hmac
+sha1_hmac_init
+sha1_hmac_update
+sha1_hmac_final
+# ucw/sighandler.h
+handle_signal
+unhandle_signal
+set_signal_handler
+# ucw/signames.h
+sig_name_to_number
+sig_number_to_name
+# ucw/simple-lists.h
+simp_append
+simp2_append
+cf_string_list_config
+cf_2string_list_config
+# ucw/slists.h
+slist_prev
+slist_insert_before
+slist_remove
+# ucw/stkstring.h
+stk_array_len
+stk_array_join
+stk_printf_internal
+stk_vprintf_internal
+stk_hexdump_internal
+stk_fsize_internal
+# ucw/string.h
+str_format_flags
+str_count_char
+str_unesc
+str_sepsplit
+str_wordsplit
+str_match_pattern
+str_match_pattern_nocase
+mem_to_hex
+hex_to_mem
+str_has_prefix
+str_has_suffix
+str_hier_prefix
+str_hier_suffix
+# ucw/strtonum.h
+str_to_uintmax
+str_to_uns
+# ucw/tbf.h
+tbf_init
+tbf_limit
+# ucw/time.h
+get_timestamp
+timestamp_type
+init_timer
+get_timer
+switch_timer
+# ucw/trans.h
+trans_init
+trans_cleanup
+trans_open
+trans_get_current
+trans_commit
+trans_rollback
+trans_fold
+trans_dump
+trans_get_pool
+trans_throw
+trans_vthrow
+trans_throw_exc
+trans_caught
+trans_current_exc
+# ucw/unaligned.h
+# ucw/unicode.h
+utf8_strlen
+utf8_strnlen
+# ucw/url.h
+url_deescape
+url_enescape
+url_enescape_friendly
+url_split
+url_normalize
+url_canonicalize
+url_pack
+url_canon_split_rel
+url_auto_canonicalize_rel
+url_identify_protocol
+url_has_repeated_component
+url_error
+url_proto_names
+# ucw/varint.h
+varint_put_big
+varint_get_big
+# ucw/wildmatch.h
+wp_compile
+wp_match
+wp_min_size
+# ucw/workqueue.h
+worker_pool_init
+worker_pool_cleanup
+raw_queue_init
+raw_queue_cleanup
+raw_queue_put
+raw_queue_get
+raw_queue_try_get
+work_queue_init
+work_queue_cleanup
+work_submit
+work_wait
+work_try_wait
+# ucw/sorter/common.h
+sorter_trace
+sorter_trace_array
+sorter_stream_bufsize
+sorter_debug
+sorter_min_radix_bits
+sorter_max_radix_bits
+sorter_add_radix_bits
+sorter_min_multiway_bits
+sorter_max_multiway_bits
+sorter_threads
+sorter_bufsize
+sorter_small_input
+sorter_thread_threshold
+sorter_thread_chunk
+sorter_radix_threshold
+sorter_fb_params
+sorter_small_fb_params
+sorter_run
+sorter_alloc
+sorter_prepare_buf
+sorter_alloc_buf
+sorter_free_buf
+sbuck_new
+sbuck_drop
+sbuck_have
+sbuck_has_file
+sbuck_size
+sbuck_read
+sbuck_write
+sbuck_swap_out
+asort_run
+asort_start_threads
+asort_stop_threads
+# charset/charconv.h
+conv_init
+conv_set_charset
+conv_in_to_ucs
+conv_ucs_to_out
+conv_x_to_ucs
+conv_ucs_to_x
+conv_x_count
+find_charset_by_name
+charset_name
+# charset/fb-charconv.h
+fb_wrap_charconv_in
+fb_wrap_charconv_out
+# charset/mp-charconv.h
+mp_strconv
+# charset/stk-charconv.h
+stk_strconv_init
+stk_strconv_step
+# charset/unicat.h
+_U_cat
+_U_upper
+_U_lower
+_U_unaccent
+Uexpand_lig
+# images/color.h
+color_space_channels
+color_space_name
+color_space_id_to_name
+color_space_name_to_id
+color_get
+color_put
+color_black
+color_white
+image_conv_defaults
+image_conv
+color_illuminant_d50
+color_illuminant_d65
+color_illuminant_e
+color_adobe_rgb_info
+color_apple_rgb_info
+color_cie_rgb_info
+color_color_match_rgb_info
+color_srgb_info
+color_compute_color_space_to_xyz_matrix
+color_compute_bradford_matrix
+color_compute_color_spaces_conversion_matrix
+color_invert_matrix
+srgb_to_xyz_exact
+xyz_to_srgb_exact
+xyz_to_luv_exact
+luv_to_xyz_exact
+rgb_to_cmyk_exact
+cmyk_to_rgb_exact
+srgb_to_luv_tab1
+srgb_to_luv_tab2
+srgb_to_luv_tab3
+srgb_to_luv_init
+srgb_to_luv_pixels
+srgb_to_luv_grid
+color_interpolation_table
+color_conv_init
+color_conv_pixels
+# images/duplicates.h
+image_dup_context_init
+image_dup_context_cleanup
+image_dup_estimate_size
+image_dup_new
+image_dup_compare
+# images/error.h
+image_trace
+# images/images.h
+image_context_init
+image_context_cleanup
+image_context_msg
+image_context_vmsg
+image_context_msg_default
+image_context_msg_silent
+image_max_dim
+image_max_bytes
+image_channels_format_to_name
+image_name_to_channels_format
+image_new
+image_clone
+image_destroy
+image_clear
+image_init_matrix
+image_init_subimage
+image_scale
+image_dimensions_fit_to_box
+image_io_init
+image_io_cleanup
+image_io_reset
+image_io_read_header
+image_io_read_data
+image_io_read
+image_io_write
+image_format_to_extension
+image_extension_to_format
+image_file_name_to_format
+# images/io-main.h
+libjpeg_read_header
+libjpeg_read_data
+libjpeg_write
+libpng_read_header
+libpng_read_data
+libpng_write
+libungif_read_header
+libungif_read_data
+libmagick_init
+libmagick_cleanup
+libmagick_read_header
+libmagick_read_data
+libmagick_write
+image_io_read_data_prepare
+image_io_read_data_finish
+image_io_read_data_break
+# images/math.h
+fast_div_tab
+fast_sqrt_tab
+# images/object.h
+get_image_obj_info
+get_image_obj_thumb
+read_image_obj_thumb
+put_image_obj_signature
+get_image_obj_signature
+# images/sig-cmp-gen.h
+image_signatures_dist
+image_signatures_dist_explain
+# images/signature.h
+image_sig_min_width
+image_sig_min_height
+image_sig_prequant_thresholds
+image_sig_postquant_min_steps
+image_sig_postquant_max_steps
+image_sig_postquant_threshold
+image_sig_border_size
+image_sig_border_bonus
+image_sig_inertia_scale
+image_sig_textured_threshold
+image_sig_compare_method
+image_sig_cmp_features_weights
+image_vector_dump
+image_region_dump
+compute_image_signature
+image_sig_init
+image_sig_preprocess
+image_sig_finish
+image_sig_cleanup
+image_sig_segmentation
+image_sig_detect_textured
+image_signatures_dist
+image_signatures_dist_explain
+++ /dev/null
-#!/usr/bin/perl
-# Check symbols exported by a library
-# (c) 2014 Martin Mares <mj@ucw.cz>
-
-use common::sense;
-
-my $lib = $ARGV[0] or die "Usage: $0 <library>\n";
-open my $f, '-|', 'nm', $lib or die;
-while (<$f>) {
- chomp;
- next if /^\s/;
- my ($addr, $type, $sym) = split /\s+/;
- if ($sym =~ m{^(ucw|ucwlib)_}) {
- next
- }
- if ($type =~ m{[A-Z]}) {
- print "$sym ($type)\n";
- }
-}
-close $f or die;
+++ /dev/null
-# ucw/asio.h
-asio_init_queue
-asio_cleanup_queue
-asio_get
-asio_submit
-asio_wait
-asio_put
-asio_sync
-# ucw/base224.h
-base224_encode
-base224_decode
-# ucw/base64.h
-base64_encode
-base64_decode
-# ucw/bbuf.h
-bb_vprintf
-bb_printf
-bb_vprintf_at
-bb_printf_at
-# ucw/binheap-node.h
-# ucw/binsearch.h
-# ucw/bitarray.h
-bit_array_xrealloc
-bit_array_count_bits
-# ucw/bitops.h
-bit_fls
-ffs_table
-# ucw/bitsig.h
-bitsig_init
-bitsig_free
-bitsig_member
-bitsig_insert
-# ucw/chartype.h
-# ucw/clists.h
-# ucw/conf-internal.h
-cf_obtain_context
-cf_op_names
-cf_type_names
-cf_type_size
-cf_interpret_line
-cf_init_stack
-cf_done_stack
-cf_journal_swap
-cf_journal_delete
-cf_sections
-cf_find_subitem
-cf_commit_all
-cf_add_dirty
-cf_load_default
-# ucw/conf.h
-cf_new_context
-cf_delete_context
-cf_switch_context
-cf_load
-cf_reload
-cf_set
-cf_open_group
-cf_close_group
-cf_revert
-cf_get_pool
-cf_malloc
-cf_malloc_zero
-cf_strdup
-cf_printf
-cf_set_journalling
-cf_journal_block
-cf_journal_new_transaction
-cf_journal_commit_transaction
-cf_journal_rollback_transaction
-cf_declare_section
-cf_declare_rel_section
-cf_init_section
-cf_parse_int
-cf_parse_u64
-cf_parse_double
-cf_parse_ip
-cf_find_item
-cf_modify_item
-cf_dump_sections
-# ucw/config.h
-# ucw/crc-tables.h
-crc_tableil8_o32
-crc_tableil8_o40
-crc_tableil8_o48
-crc_tableil8_o56
-crc_tableil8_o64
-crc_tableil8_o72
-crc_tableil8_o80
-crc_tableil8_o88
-# ucw/crc.h
-crc32_init
-crc32_hash_buffer
-# ucw/daemon.h
-daemon_init
-daemon_run
-daemon_exit
-daemon_control
-# ucw/eltpool.h
-ep_new
-ep_delete
-ep_total_size
-ep_alloc_slow
-# ucw/fastbuf.h
-fb_tie
-fbpar_cf
-fbpar_def
-bopen_file
-bopen_file_try
-bopen_tmp_file
-bopen_fd_name
-bfilesync
-bopen
-bopen_try
-bopen_tmp
-bfdopen
-bfdopen_shared
-temp_file_name
-open_tmp
-bfix_tmp_file
-bfdopen_internal
-bfmmopen_internal
-fbdir_cheat
-fbdir_open_fd_internal
-bclose_file_helper
-bopen_limited_fd
-fbmem_create
-fbmem_clone_read
-fbbuf_init_read
-fbbuf_init_write
-fbgrow_create
-fbgrow_create_mp
-fbgrow_reset
-fbgrow_rewind
-fbgrow_get_buf
-fbpool_init
-fbpool_start
-fbpool_end
-fbatomic_open
-fbatomic_internal_write
-fbmulti_create
-fbmulti_append
-fbmulti_remove
-bconfig
-bclose
-bthrow
-brefill
-bspout
-bflush
-bseek
-bsetpos
-brewind
-bfilesize
-bgetc_slow
-bpeekc_slow
-beof_slow
-bputc_slow
-bread_slow
-bwrite_slow
-bgets
-bgets0
-bgets_nodie
-bgets_bb
-bgets_mp
-bgets_stk_init
-bgets_stk_step
-bbcopy_slow
-bskip_slow
-bprintf
-vbprintf
-# ucw/fb-socket.h
-fbsock_create
-# ucw/ff-binary.h
-bgetw_slow
-bgetw_be_slow
-bgetw_le_slow
-bgetl_slow
-bgetl_be_slow
-bgetl_le_slow
-bgetq_slow
-bgetq_be_slow
-bgetq_le_slow
-bget5_slow
-bget5_be_slow
-bget5_le_slow
-bputw_slow
-bputw_be_slow
-bputw_le_slow
-bputl_slow
-bputl_be_slow
-bputl_le_slow
-bputq_slow
-bputq_be_slow
-bputq_le_slow
-bput5_slow
-bput5_be_slow
-bput5_le_slow
-# ucw/ff-unicode.h
-bget_utf8_slow
-bget_utf8_32_slow
-bput_utf8_slow
-bput_utf8_32_slow
-bget_utf16_be_slow
-bget_utf16_le_slow
-bput_utf16_be_slow
-bput_utf16_le_slow
-# ucw/ff-varint.h
-bget_varint_slow
-bput_varint_slow
-# ucw/gary.h
-gary_allocator_default
-gary_allocator_zeroed
-gary_init
-gary_set_size
-gary_push_helper
-gary_fix
-# ucw/getopt.h
-cf_def_file
-cf_env_file
-cf_getopt
-reset_getopt
-# ucw/hashfunc.h
-str_len_aligned
-hash_string_aligned
-hash_block_aligned
-str_len
-hash_string
-hash_block
-hash_string_nocase
-# ucw/heap.h
-# ucw/io.h
-mmap_file
-munmap_file
-careful_read
-careful_write
-sync_dir
-# ucw/ipaccess.h
-ipaccess_cf
-ipaccess_check
-ip_addrmask_type
-ip_addrmask_match
-# ucw/lib.h
-msg
-vmsg
-die
-vdie
-log_title
-log_pid
-log_die_hook
-log_init
-log_fork
-log_file
-assert_failed
-assert_failed_noinfo
-xmalloc
-xrealloc
-xfree
-xmalloc_zero
-xstrdup
-page_alloc
-page_alloc_zero
-page_free
-page_realloc
-big_alloc
-big_alloc_zero
-big_free
-random_u32
-random_max
-random_u64
-random_max_u64
-# ucw/lizard.h
-lizard_compress
-lizard_decompress
-lizard_alloc
-lizard_free
-lizard_decompress_safe
-adler32_update
-# ucw/log-internal.h
-log_pass_msg
-log_streams
-log_streams_after
-log_stream_default
-log_type_names
-# ucw/log.h
-log_register_type
-log_find_type
-log_type_name
-log_new_stream
-log_close_stream
-log_add_substream
-log_rm_substream
-log_set_format
-log_stream_by_flags
-log_set_default_stream
-log_close_all
-log_new_file
-log_new_fd
-log_switch_disable
-log_switch_enable
-log_switch
-log_new_syslog
-log_syslog_facility_exists
-log_new_configured
-log_configured
-log_check_configured
-# ucw/mainloop.h
-main_new
-main_delete
-main_destroy
-main_switch_context
-main_current
-main_init
-main_cleanup
-main_teardown
-main_loop
-main_step
-main_debug_context
-timer_add
-timer_add_rel
-timer_del
-main_get_time
-timer_debug
-hook_add
-hook_del
-hook_debug
-file_add
-file_chg
-file_del
-file_debug
-block_io_add
-block_io_del
-block_io_read
-block_io_write
-block_io_set_timeout
-rec_io_add
-rec_io_del
-rec_io_start_read
-rec_io_stop_read
-rec_io_set_timeout
-rec_io_write
-rec_io_parse_line
-process_add
-process_del
-process_fork
-process_debug
-signal_add
-signal_del
-signal_debug
-# ucw/md5.h
-md5_init
-md5_update
-md5_final
-md5_transform
-md5_hash_buffer
-# ucw/mempool.h
-mp_init
-mp_new
-mp_delete
-mp_flush
-mp_stats
-mp_total_size
-mp_alloc_internal
-mp_alloc
-mp_alloc_noalign
-mp_alloc_zero
-mp_start_internal
-mp_grow_internal
-mp_spread_internal
-mp_start
-mp_start_noalign
-mp_open
-mp_realloc
-mp_realloc_zero
-mp_push
-mp_restore
-mp_pop
-mp_strdup
-mp_memdup
-mp_multicat
-mp_strjoin
-mp_str_from_mem
-mp_printf
-mp_vprintf
-mp_printf_append
-mp_vprintf_append
-# ucw/opt-internal.h
-opt_precompute
-# ucw/opt.h
-opt_parse
-opt_failure
-opt_help
-opt_handle_help
-opt_handle_config
-opt_handle_set
-opt_handle_dumpconfig
-opt_conf_hook_internal
-cf_def_file
-cf_env_file
-# ucw/partmap.h
-partmap_open
-partmap_close
-partmap_size
-partmap_load
-# ucw/prime.h
-isprime
-nextprime
-next_table_prime
-prev_table_prime
-# ucw/process.h
-setproctitle_init
-setproctitle
-getproctitle
-format_exit_status
-run_command
-exec_command
-echo_command
-run_command_v
-exec_command_v
-echo_command_v
-# ucw/regex.h
-rx_compile
-rx_free
-rx_match
-rx_subst
-# ucw/resource.h
-rp_new
-rp_delete
-rp_detach
-rp_commit
-rp_dump
-res_alloc
-res_dump
-res_free
-res_detach
-res_add
-res_drop
-res_for_fd
-res_malloc
-res_malloc_zero
-res_realloc
-res_subpool
-res_mempool
-res_eltpool
-# ucw/semaphore.h
-# ucw/sha1.h
-sha1_init
-sha1_update
-sha1_final
-sha1_hash_buffer
-sha1_hmac
-sha1_hmac_init
-sha1_hmac_update
-sha1_hmac_final
-# ucw/sighandler.h
-handle_signal
-unhandle_signal
-set_signal_handler
-# ucw/signames.h
-sig_name_to_number
-sig_number_to_name
-# ucw/simple-lists.h
-simp_append
-simp2_append
-cf_string_list_config
-cf_2string_list_config
-# ucw/slists.h
-slist_prev
-slist_insert_before
-slist_remove
-# ucw/stkstring.h
-stk_array_len
-stk_array_join
-stk_printf_internal
-stk_vprintf_internal
-stk_hexdump_internal
-stk_fsize_internal
-# ucw/string.h
-str_format_flags
-str_count_char
-str_unesc
-str_sepsplit
-str_wordsplit
-str_match_pattern
-str_match_pattern_nocase
-mem_to_hex
-hex_to_mem
-str_has_prefix
-str_has_suffix
-str_hier_prefix
-str_hier_suffix
-# ucw/strtonum.h
-str_to_uintmax
-str_to_uns
-# ucw/tbf.h
-tbf_init
-tbf_limit
-# ucw/time.h
-get_timestamp
-timestamp_type
-init_timer
-get_timer
-switch_timer
-# ucw/trans.h
-trans_init
-trans_cleanup
-trans_open
-trans_get_current
-trans_commit
-trans_rollback
-trans_fold
-trans_dump
-trans_get_pool
-trans_throw
-trans_vthrow
-trans_throw_exc
-trans_caught
-trans_current_exc
-# ucw/unaligned.h
-# ucw/unicode.h
-utf8_strlen
-utf8_strnlen
-# ucw/url.h
-url_deescape
-url_enescape
-url_enescape_friendly
-url_split
-url_normalize
-url_canonicalize
-url_pack
-url_canon_split_rel
-url_auto_canonicalize_rel
-url_identify_protocol
-url_has_repeated_component
-url_error
-url_proto_names
-# ucw/varint.h
-varint_put_big
-varint_get_big
-# ucw/wildmatch.h
-wp_compile
-wp_match
-wp_min_size
-# ucw/workqueue.h
-worker_pool_init
-worker_pool_cleanup
-raw_queue_init
-raw_queue_cleanup
-raw_queue_put
-raw_queue_get
-raw_queue_try_get
-work_queue_init
-work_queue_cleanup
-work_submit
-work_wait
-work_try_wait
-# ucw/sorter/common.h
-sorter_trace
-sorter_trace_array
-sorter_stream_bufsize
-sorter_debug
-sorter_min_radix_bits
-sorter_max_radix_bits
-sorter_add_radix_bits
-sorter_min_multiway_bits
-sorter_max_multiway_bits
-sorter_threads
-sorter_bufsize
-sorter_small_input
-sorter_thread_threshold
-sorter_thread_chunk
-sorter_radix_threshold
-sorter_fb_params
-sorter_small_fb_params
-sorter_run
-sorter_alloc
-sorter_prepare_buf
-sorter_alloc_buf
-sorter_free_buf
-sbuck_new
-sbuck_drop
-sbuck_have
-sbuck_has_file
-sbuck_size
-sbuck_read
-sbuck_write
-sbuck_swap_out
-asort_run
-asort_start_threads
-asort_stop_threads
-# charset/charconv.h
-conv_init
-conv_set_charset
-conv_in_to_ucs
-conv_ucs_to_out
-conv_x_to_ucs
-conv_ucs_to_x
-conv_x_count
-find_charset_by_name
-charset_name
-# charset/fb-charconv.h
-fb_wrap_charconv_in
-fb_wrap_charconv_out
-# charset/mp-charconv.h
-mp_strconv
-# charset/stk-charconv.h
-stk_strconv_init
-stk_strconv_step
-# charset/unicat.h
-_U_cat
-_U_upper
-_U_lower
-_U_unaccent
-Uexpand_lig
-# images/color.h
-color_space_channels
-color_space_name
-color_space_id_to_name
-color_space_name_to_id
-color_get
-color_put
-color_black
-color_white
-image_conv_defaults
-image_conv
-color_illuminant_d50
-color_illuminant_d65
-color_illuminant_e
-color_adobe_rgb_info
-color_apple_rgb_info
-color_cie_rgb_info
-color_color_match_rgb_info
-color_srgb_info
-color_compute_color_space_to_xyz_matrix
-color_compute_bradford_matrix
-color_compute_color_spaces_conversion_matrix
-color_invert_matrix
-srgb_to_xyz_exact
-xyz_to_srgb_exact
-xyz_to_luv_exact
-luv_to_xyz_exact
-rgb_to_cmyk_exact
-cmyk_to_rgb_exact
-srgb_to_luv_tab1
-srgb_to_luv_tab2
-srgb_to_luv_tab3
-srgb_to_luv_init
-srgb_to_luv_pixels
-srgb_to_luv_grid
-color_interpolation_table
-color_conv_init
-color_conv_pixels
-# images/duplicates.h
-image_dup_context_init
-image_dup_context_cleanup
-image_dup_estimate_size
-image_dup_new
-image_dup_compare
-# images/error.h
-image_trace
-# images/images.h
-image_context_init
-image_context_cleanup
-image_context_msg
-image_context_vmsg
-image_context_msg_default
-image_context_msg_silent
-image_max_dim
-image_max_bytes
-image_channels_format_to_name
-image_name_to_channels_format
-image_new
-image_clone
-image_destroy
-image_clear
-image_init_matrix
-image_init_subimage
-image_scale
-image_dimensions_fit_to_box
-image_io_init
-image_io_cleanup
-image_io_reset
-image_io_read_header
-image_io_read_data
-image_io_read
-image_io_write
-image_format_to_extension
-image_extension_to_format
-image_file_name_to_format
-# images/io-main.h
-libjpeg_read_header
-libjpeg_read_data
-libjpeg_write
-libpng_read_header
-libpng_read_data
-libpng_write
-libungif_read_header
-libungif_read_data
-libmagick_init
-libmagick_cleanup
-libmagick_read_header
-libmagick_read_data
-libmagick_write
-image_io_read_data_prepare
-image_io_read_data_finish
-image_io_read_data_break
-# images/math.h
-fast_div_tab
-fast_sqrt_tab
-# images/object.h
-get_image_obj_info
-get_image_obj_thumb
-read_image_obj_thumb
-put_image_obj_signature
-get_image_obj_signature
-# images/sig-cmp-gen.h
-image_signatures_dist
-image_signatures_dist_explain
-# images/signature.h
-image_sig_min_width
-image_sig_min_height
-image_sig_prequant_thresholds
-image_sig_postquant_min_steps
-image_sig_postquant_max_steps
-image_sig_postquant_threshold
-image_sig_border_size
-image_sig_border_bonus
-image_sig_inertia_scale
-image_sig_textured_threshold
-image_sig_compare_method
-image_sig_cmp_features_weights
-image_vector_dump
-image_region_dump
-compute_image_signature
-image_sig_init
-image_sig_preprocess
-image_sig_finish
-image_sig_cleanup
-image_sig_segmentation
-image_sig_detect_textured
-image_signatures_dist
-image_signatures_dist_explain
+++ /dev/null
-#!/usr/bin/perl
-# Search for symbols which might need renaming
-# (c) 2014 Martin Mares <mj@ucw.cz>
-
-use common::sense;
-
-sub symbol {
- my ($sym) = @_;
- return if $sym =~ m{^(ucw|ucwlib)_};
- print "$sym\n";
-}
-
-sub parse {
- my ($file) = @_;
- print "# $file\n";
- open my $f, '<', $file or die;
- while (<$f>) {
- chomp;
- # Interpret special comments
- m{// NOAPI} and next;
- if (m{// API: (\w+)}) {
- print "$1\n";
- next;
- }
- # Find things which look like top-level declarations
- s{//.*}{};
- s{/\*.*}{};
- /^\s/ and next;
- /^$/ and next;
- /^#/ and next;
- /^{/ and next;
- /}/ and next;
- /^"/ and next;
- /^-/ and next; # Magic for ucw/getopt.h
- /^\w+:/ and next; # Labels in inline functions
- /^typedef\s/ and next;
- /^static\s/ and next;
- /^(struct|union|enum)(\s+\w+)?(;|\s*{)/ and next;
-
- # print "$_\n";
-
- # Try to parse the declaration
- s{\[[^\]]*\]}{}g; # Delete array sizes
- if (m{^extern [^,]*(\s+\**\w+(,\s+\**\w+)*);}) {
- my $x = $1;
- $x =~ s{[,*]}{}g;
- symbol $_ for grep { !/^$/ } split /\s+/, $x;
- } elsif (m{( |\*)(\w+)\(}) {
- symbol($2);
- } else {
- print "??? $_\n";
- }
-
- }
- close $f;
-}
-
-my %blacklist = map { $_ => 1 } qw(
- ucw/binheap.h
- ucw/char-map.h
- ucw/ff-binary.h
- ucw/gbuf.h
- ucw/hashtable.h
- ucw/kmp.h
- ucw/kmp-search.h
- ucw/redblack.h
- ucw/str-match.h
- ucw/strtonum.h
- ucw/strtonum-gen.h
- ucw/trie.h
- charset/charconv-gen.h
- charset/chartable.h
- charset/U-cat.h
- charset/U-ligatures.h
- charset/U-lower.h
- charset/U-unacc.h
- charset/U-upper.h
- images/image-walk.h
- images/scale-gen.h
-);
-
-for my $f (<ucw/*.h>, <ucw/sorter/common.h>, <charset/*.h>, <images/*.h>) {
- next if $blacklist{$f};
- parse($f);
-}
+++ /dev/null
-#!/usr/bin/perl
-# Re-generate symbol renaming defines
-# (c) 2014 Martin Mares <mj@ucw.cz>
-
-use common::sense;
-
-my %renames = ();
-open my $f, '<', 'tools/libucw.api' or die;
-my $current;
-while (<$f>) {
- chomp;
- if (/^#\s*(.*)/) {
- $current = $1;
- } else {
- push @{$renames{$current}}, $_;
- }
-}
-close $f;
-
-for my $g (sort keys %renames) {
- my @symbols = sort @{$renames{$g}};
- @symbols or next;
-
- open my $in, '<', $g or die;
- open my $out, '>', "$g.new" or die;
- my $mode = 0;
- my $cmt = 0;
- while (<$in>) {
- if (!$mode) {
- if (m{^/\*$} && !$cmt) {
- $cmt = 1;
- } elsif (m{^\s} ||
- m{^#include\s} ||
- m{^#define\s+_} ||
- m{^#ifndef\s+_} ||
- m{^\s*$}
- ) {
- # Waiting for the right spot
- } elsif (m{^#ifdef CONFIG_UCW_CLEAN_ABI$}) {
- $mode = 2;
- next;
- } else {
- $mode = 1;
- print $out "#ifdef CONFIG_UCW_CLEAN_ABI\n";
- for my $sym (@symbols) {
- print $out "#define $sym ucw_$sym\n";
- }
- print $out "#endif\n\n";
- }
- } elsif ($mode == 2) {
- if (m{^$}) {
- $mode = 0;
- }
- next;
- }
- print $out "$_";
- }
- $mode or die;
- close $out;
- close $in;
- system "cmp", "-s", $g, "$g.new";
- if ($?) {
- print "### $g: updated\n";
- rename "$g.new", $g or die;
- } else {
- print "--- $g: not modified\n";
- unlink "$g.new" or die;
- }
-}