From f69c00a7ddcb835fe52169fa9b7e097680fba5c1 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 2 Jul 2015 14:54:00 +0800 Subject: update tbox and fix copy file bug --- core/pkg/tbox.pkg/inc/mac/x64/tbox.config.h | 109 +++--- core/pkg/tbox.pkg/inc/msvc/x86/tbox.config.h | 151 +++----- core/pkg/tbox.pkg/inc/tbox/algorithm/algorithm.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find.h | 0 .../tbox.pkg/inc/tbox/algorithm/binary_find_if.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/bubble_sort.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/count.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/count_if.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/distance.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/find.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/find_if.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/for.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/for_if.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/heap_sort.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/insert_sort.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/predicate.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/quick_sort.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/remove.h | 0 .../pkg/tbox.pkg/inc/tbox/algorithm/remove_first.h | 0 .../tbox.pkg/inc/tbox/algorithm/remove_first_if.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/remove_if.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/rfind.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/rfind_if.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/rfor.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/rfor_if.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/rwalk.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/sort.h | 0 core/pkg/tbox.pkg/inc/tbox/algorithm/walk.h | 0 core/pkg/tbox.pkg/inc/tbox/asio/aice.h | 0 core/pkg/tbox.pkg/inc/tbox/asio/aico.h | 0 core/pkg/tbox.pkg/inc/tbox/asio/aicp.h | 0 core/pkg/tbox.pkg/inc/tbox/asio/aioe.h | 0 core/pkg/tbox.pkg/inc/tbox/asio/aioo.h | 0 core/pkg/tbox.pkg/inc/tbox/asio/aiop.h | 0 core/pkg/tbox.pkg/inc/tbox/asio/asio.h | 0 core/pkg/tbox.pkg/inc/tbox/asio/dns.h | 0 core/pkg/tbox.pkg/inc/tbox/asio/http.h | 0 core/pkg/tbox.pkg/inc/tbox/asio/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/asio/ssl.h | 0 core/pkg/tbox.pkg/inc/tbox/charset/charset.h | 0 core/pkg/tbox.pkg/inc/tbox/charset/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/config.h | 0 .../pkg/tbox.pkg/inc/tbox/container/bloom_filter.h | 0 .../pkg/tbox.pkg/inc/tbox/container/circle_queue.h | 0 core/pkg/tbox.pkg/inc/tbox/container/container.h | 0 core/pkg/tbox.pkg/inc/tbox/container/element.h | 0 .../pkg/tbox.pkg/inc/tbox/container/element/hash.h | 96 +++++ .../tbox.pkg/inc/tbox/container/element/prefix.h | 39 ++ core/pkg/tbox.pkg/inc/tbox/container/hash.h | 184 ---------- core/pkg/tbox.pkg/inc/tbox/container/hash_map.h | 0 core/pkg/tbox.pkg/inc/tbox/container/hash_set.h | 0 core/pkg/tbox.pkg/inc/tbox/container/heap.h | 0 core/pkg/tbox.pkg/inc/tbox/container/item.h | 350 ------------------ core/pkg/tbox.pkg/inc/tbox/container/iterator.h | 0 .../tbox.pkg/inc/tbox/container/iterator/prefix.h | 38 ++ core/pkg/tbox.pkg/inc/tbox/container/list.h | 0 core/pkg/tbox.pkg/inc/tbox/container/list_entry.h | 0 core/pkg/tbox.pkg/inc/tbox/container/prefix.h | 0 .../tbox.pkg/inc/tbox/container/priority_queue.h | 0 core/pkg/tbox.pkg/inc/tbox/container/queue.h | 0 core/pkg/tbox.pkg/inc/tbox/container/single_list.h | 0 .../inc/tbox/container/single_list_entry.h | 0 core/pkg/tbox.pkg/inc/tbox/container/stack.h | 0 core/pkg/tbox.pkg/inc/tbox/container/vector.h | 0 core/pkg/tbox.pkg/inc/tbox/database/database.h | 0 core/pkg/tbox.pkg/inc/tbox/database/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/database/sql.h | 0 core/pkg/tbox.pkg/inc/tbox/database/value.h | 10 +- core/pkg/tbox.pkg/inc/tbox/libc/libc.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/misc/ctype.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/misc/limits.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/misc/misc.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/misc/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/misc/setjmp.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/misc/signal.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/misc/stdarg.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/misc/time/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/misc/time/time.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/misc/time/type.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/stdio/prefix.h | 0 .../tbox.pkg/inc/tbox/libc/stdio/printf_object.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/stdio/stdio.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/stdlib/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/stdlib/stdlib.h | 6 +- core/pkg/tbox.pkg/inc/tbox/libc/string/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/libc/string/string.h | 0 core/pkg/tbox.pkg/inc/tbox/libm/ceil.h | 0 core/pkg/tbox.pkg/inc/tbox/libm/fabs.h | 0 core/pkg/tbox.pkg/inc/tbox/libm/floor.h | 0 core/pkg/tbox.pkg/inc/tbox/libm/inf.h | 0 core/pkg/tbox.pkg/inc/tbox/libm/libm.h | 0 core/pkg/tbox.pkg/inc/tbox/libm/maf.h | 0 core/pkg/tbox.pkg/inc/tbox/libm/math.h | 4 +- core/pkg/tbox.pkg/inc/tbox/libm/mif.h | 0 core/pkg/tbox.pkg/inc/tbox/libm/nan.h | 0 core/pkg/tbox.pkg/inc/tbox/libm/pi.h | 0 core/pkg/tbox.pkg/inc/tbox/libm/prefix.h | 2 +- core/pkg/tbox.pkg/inc/tbox/libm/round.h | 0 core/pkg/tbox.pkg/inc/tbox/math/fixed.h | 2 +- core/pkg/tbox.pkg/inc/tbox/math/fixed16.h | 26 +- core/pkg/tbox.pkg/inc/tbox/math/fixed30.h | 12 +- core/pkg/tbox.pkg/inc/tbox/math/fixed6.h | 2 +- core/pkg/tbox.pkg/inc/tbox/math/impl/fixed16_arm.h | 66 ---- core/pkg/tbox.pkg/inc/tbox/math/impl/fixed30_arm.h | 65 ---- core/pkg/tbox.pkg/inc/tbox/math/int32.h | 0 core/pkg/tbox.pkg/inc/tbox/math/math.h | 0 core/pkg/tbox.pkg/inc/tbox/math/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/math/random.h | 2 +- core/pkg/tbox.pkg/inc/tbox/memory/buffer.h | 0 core/pkg/tbox.pkg/inc/tbox/memory/fixed_pool.h | 0 core/pkg/tbox.pkg/inc/tbox/memory/large_pool.h | 0 core/pkg/tbox.pkg/inc/tbox/memory/memory.h | 0 core/pkg/tbox.pkg/inc/tbox/memory/pool.h | 0 core/pkg/tbox.pkg/inc/tbox/memory/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/memory/queue_buffer.h | 0 core/pkg/tbox.pkg/inc/tbox/memory/small_pool.h | 0 core/pkg/tbox.pkg/inc/tbox/memory/static_buffer.h | 0 core/pkg/tbox.pkg/inc/tbox/memory/string_pool.h | 0 core/pkg/tbox.pkg/inc/tbox/network/addr.h | 57 --- core/pkg/tbox.pkg/inc/tbox/network/cookies.h | 0 core/pkg/tbox.pkg/inc/tbox/network/dns/cache.h | 0 core/pkg/tbox.pkg/inc/tbox/network/dns/dns.h | 0 core/pkg/tbox.pkg/inc/tbox/network/dns/looker.h | 0 core/pkg/tbox.pkg/inc/tbox/network/dns/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/network/dns/server.h | 0 core/pkg/tbox.pkg/inc/tbox/network/http.h | 0 core/pkg/tbox.pkg/inc/tbox/network/hwaddr.h | 0 core/pkg/tbox.pkg/inc/tbox/network/ipaddr.h | 0 core/pkg/tbox.pkg/inc/tbox/network/ipv4.h | 0 core/pkg/tbox.pkg/inc/tbox/network/ipv6.h | 0 core/pkg/tbox.pkg/inc/tbox/network/network.h | 0 core/pkg/tbox.pkg/inc/tbox/network/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/network/ssl.h | 0 core/pkg/tbox.pkg/inc/tbox/network/url.h | 0 core/pkg/tbox.pkg/inc/tbox/object/array.h | 0 core/pkg/tbox.pkg/inc/tbox/object/boolean.h | 0 core/pkg/tbox.pkg/inc/tbox/object/data.h | 0 core/pkg/tbox.pkg/inc/tbox/object/date.h | 0 core/pkg/tbox.pkg/inc/tbox/object/dictionary.h | 0 core/pkg/tbox.pkg/inc/tbox/object/null.h | 0 core/pkg/tbox.pkg/inc/tbox/object/number.h | 6 +- core/pkg/tbox.pkg/inc/tbox/object/object.h | 0 core/pkg/tbox.pkg/inc/tbox/object/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/object/reader/bin.h | 88 ----- core/pkg/tbox.pkg/inc/tbox/object/reader/bplist.h | 85 ----- core/pkg/tbox.pkg/inc/tbox/object/reader/json.h | 85 ----- core/pkg/tbox.pkg/inc/tbox/object/reader/prefix.h | 84 ----- core/pkg/tbox.pkg/inc/tbox/object/reader/reader.h | 81 ---- core/pkg/tbox.pkg/inc/tbox/object/reader/xml.h | 85 ----- core/pkg/tbox.pkg/inc/tbox/object/reader/xplist.h | 85 ----- core/pkg/tbox.pkg/inc/tbox/object/string.h | 0 core/pkg/tbox.pkg/inc/tbox/object/writer/bin.h | 100 ----- core/pkg/tbox.pkg/inc/tbox/object/writer/bplist.h | 85 ----- core/pkg/tbox.pkg/inc/tbox/object/writer/json.h | 88 ----- core/pkg/tbox.pkg/inc/tbox/object/writer/prefix.h | 124 ------- core/pkg/tbox.pkg/inc/tbox/object/writer/writer.h | 84 ----- core/pkg/tbox.pkg/inc/tbox/object/writer/xml.h | 88 ----- core/pkg/tbox.pkg/inc/tbox/object/writer/xplist.h | 88 ----- .../tbox.pkg/inc/tbox/platform/arch/arm/atomic.h | 0 .../tbox.pkg/inc/tbox/platform/arch/arm/frame.h | 66 ++++ .../tbox.pkg/inc/tbox/platform/arch/arm/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/arch/atomic.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/arch/barrier.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/arch/frame.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/arch/prefix.h | 0 .../tbox.pkg/inc/tbox/platform/arch/x64/atomic.h | 0 .../tbox.pkg/inc/tbox/platform/arch/x64/barrier.h | 0 .../tbox.pkg/inc/tbox/platform/arch/x64/frame.h | 0 .../tbox.pkg/inc/tbox/platform/arch/x64/prefix.h | 0 .../tbox.pkg/inc/tbox/platform/arch/x86/atomic.h | 0 .../tbox.pkg/inc/tbox/platform/arch/x86/barrier.h | 0 .../tbox.pkg/inc/tbox/platform/arch/x86/frame.h | 0 .../tbox.pkg/inc/tbox/platform/arch/x86/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/atomic.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/atomic64.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/backtrace.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/barrier.h | 2 +- core/pkg/tbox.pkg/inc/tbox/platform/cache_time.h | 0 .../inc/tbox/platform/compiler/gcc/atomic.h | 0 .../inc/tbox/platform/compiler/gcc/atomic64.h | 0 .../inc/tbox/platform/compiler/gcc/barrier.h | 0 .../inc/tbox/platform/compiler/gcc/prefix.h | 0 .../tbox.pkg/inc/tbox/platform/compiler/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/directory.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/dns.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/dynamic.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/environment.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/event.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/exception.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/file.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/hostmac.h | 56 --- core/pkg/tbox.pkg/inc/tbox/platform/hostname.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/ifaddrs.h | 0 .../tbox.pkg/inc/tbox/platform/libc/exception.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/libc/prefix.h | 0 .../inc/tbox/platform/linux/android/android.h | 52 +++ .../inc/tbox/platform/linux/android/prefix.h | 32 ++ core/pkg/tbox.pkg/inc/tbox/platform/linux/prefix.h | 33 ++ core/pkg/tbox.pkg/inc/tbox/platform/ltimer.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/mach/barrier.h | 0 .../tbox.pkg/inc/tbox/platform/mach/ios/prefix.h | 31 ++ .../tbox.pkg/inc/tbox/platform/mach/mac/prefix.h | 31 ++ core/pkg/tbox.pkg/inc/tbox/platform/mach/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/memory.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/mutex.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/page.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/path.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/platform.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/posix/prefix.h | 33 ++ .../tbox.pkg/inc/tbox/platform/posix/sockaddr.h | 204 +++++++++++ core/pkg/tbox.pkg/inc/tbox/platform/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/print.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/process.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/processor.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/sched.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/semaphore.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/socket.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/spinlock.h | 0 .../tbox.pkg/inc/tbox/platform/systemv/prefix.h | 33 ++ core/pkg/tbox.pkg/inc/tbox/platform/thread.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/thread_pool.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/thread_store.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/time.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/timer.h | 0 core/pkg/tbox.pkg/inc/tbox/platform/unix/prefix.h | 33 ++ core/pkg/tbox.pkg/inc/tbox/platform/unix/syscall.h | 185 ++++++++++ .../tbox.pkg/inc/tbox/platform/windows/atomic.h | 0 .../tbox.pkg/inc/tbox/platform/windows/atomic64.h | 0 .../tbox.pkg/inc/tbox/platform/windows/barrier.h | 0 .../tbox.pkg/inc/tbox/platform/windows/exception.h | 0 .../inc/tbox/platform/windows/interface/dbghelp.h | 0 .../tbox/platform/windows/interface/interface.h | 0 .../inc/tbox/platform/windows/interface/iphlpapi.h | 0 .../inc/tbox/platform/windows/interface/kernel32.h | 0 .../inc/tbox/platform/windows/interface/mswsock.h | 0 .../inc/tbox/platform/windows/interface/prefix.h | 0 .../inc/tbox/platform/windows/interface/shell32.h | 0 .../inc/tbox/platform/windows/interface/user32.h | 0 .../inc/tbox/platform/windows/interface/ws2_32.h | 0 .../tbox.pkg/inc/tbox/platform/windows/ntstatus.h | 408 +++++++++++++++++++++ .../tbox.pkg/inc/tbox/platform/windows/prefix.h | 0 .../inc/tbox/platform/windows/socket_pool.h | 72 ++++ core/pkg/tbox.pkg/inc/tbox/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/abort.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/arch.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/asm.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.S | 148 ++------ core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/asm/asm.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/asm/cache.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.S | 46 ++- core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/assembler.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/assert.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/check.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/compiler.h | 1 + core/pkg/tbox.pkg/inc/tbox/prefix/config.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/cpu.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/endian.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/keyword.h | 2 +- core/pkg/tbox.pkg/inc/tbox/prefix/limits.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/malloc.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/packed.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/prefix.S | 28 -- core/pkg/tbox.pkg/inc/tbox/prefix/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/state.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/trace.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/type.h | 10 +- core/pkg/tbox.pkg/inc/tbox/prefix/utils.h | 0 core/pkg/tbox.pkg/inc/tbox/prefix/version.h | 0 core/pkg/tbox.pkg/inc/tbox/stream/async_stream.h | 0 core/pkg/tbox.pkg/inc/tbox/stream/async_transfer.h | 0 core/pkg/tbox.pkg/inc/tbox/stream/filter.h | 0 core/pkg/tbox.pkg/inc/tbox/stream/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/stream/static_stream.h | 4 +- core/pkg/tbox.pkg/inc/tbox/stream/stream.h | 4 +- core/pkg/tbox.pkg/inc/tbox/stream/transfer.h | 0 core/pkg/tbox.pkg/inc/tbox/stream/transfer_pool.h | 0 core/pkg/tbox.pkg/inc/tbox/string/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/string/static_string.h | 0 core/pkg/tbox.pkg/inc/tbox/string/string.h | 0 core/pkg/tbox.pkg/inc/tbox/tbox.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/base32.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/base64.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/bits.h | 6 +- core/pkg/tbox.pkg/inc/tbox/utils/crc.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/dump.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_arm.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_gcc.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_sh4.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_x86.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/impl/crc_arm.h | 45 +++ core/pkg/tbox.pkg/inc/tbox/utils/impl/prefix.h | 33 ++ core/pkg/tbox.pkg/inc/tbox/utils/lock_profiler.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/md5.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/option.h | 2 +- core/pkg/tbox.pkg/inc/tbox/utils/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/sha.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/singleton.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/trace.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/url.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/used.h | 0 core/pkg/tbox.pkg/inc/tbox/utils/utils.h | 0 core/pkg/tbox.pkg/inc/tbox/xml/node.h | 0 core/pkg/tbox.pkg/inc/tbox/xml/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/xml/reader.h | 0 core/pkg/tbox.pkg/inc/tbox/xml/writer.h | 2 +- core/pkg/tbox.pkg/inc/tbox/xml/xml.h | 0 core/pkg/tbox.pkg/inc/tbox/zip/gzip.h | 81 ++++ core/pkg/tbox.pkg/inc/tbox/zip/lzsw.h | 167 +++++++++ core/pkg/tbox.pkg/inc/tbox/zip/prefix.h | 0 core/pkg/tbox.pkg/inc/tbox/zip/rlc.h | 80 ++++ core/pkg/tbox.pkg/inc/tbox/zip/vlc.h | 0 core/pkg/tbox.pkg/inc/tbox/zip/vlc/prefix.h | 31 ++ core/pkg/tbox.pkg/inc/tbox/zip/zip.h | 0 core/pkg/tbox.pkg/inc/tbox/zip/zlib.h | 81 ++++ core/pkg/tbox.pkg/inc/tbox/zip/zlibraw.h | 81 ++++ core/pkg/tbox.pkg/lib/msvc/x86/tboxd.pdb | Bin 290816 -> 0 bytes core/pkg/tbox.pkg/lib/msvc/x86/tboxr.pdb | Bin 282624 -> 0 bytes core/src/xmake/machine.c | 2 +- core/src/xmake/os/setenv.c | 2 +- core/src/xmake/path/translate.c | 3 +- xmake/scripts/base/project.lua | 2 +- 325 files changed, 2215 insertions(+), 2394 deletions(-) mode change 100644 => 100755 core/pkg/tbox.pkg/inc/mac/x64/tbox.config.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/algorithm.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find_if.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/bubble_sort.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/count.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/count_if.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/distance.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/find.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/find_if.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/for.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/for_if.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/heap_sort.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/insert_sort.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/predicate.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/quick_sort.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/remove.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/remove_first.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/remove_first_if.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/remove_if.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/rfind.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/rfind_if.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/rfor.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/rfor_if.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/rwalk.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/sort.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/algorithm/walk.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/asio/aice.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/asio/aico.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/asio/aicp.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/asio/aioe.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/asio/aioo.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/asio/aiop.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/asio/asio.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/asio/dns.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/asio/http.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/asio/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/asio/ssl.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/charset/charset.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/charset/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/config.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/bloom_filter.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/circle_queue.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/container.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/element.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/container/element/hash.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/container/element/prefix.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/container/hash.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/hash_map.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/hash_set.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/heap.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/container/item.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/iterator.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/container/iterator/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/list.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/list_entry.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/priority_queue.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/queue.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/single_list.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/single_list_entry.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/stack.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/container/vector.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/database/database.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/database/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/database/sql.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/database/value.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/libc.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/misc/ctype.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/misc/limits.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/misc/misc.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/misc/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/misc/setjmp.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/misc/signal.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/misc/stdarg.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/misc/time/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/misc/time/time.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/misc/time/type.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/stdio/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/stdio/printf_object.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/stdio/stdio.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/stdlib/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/stdlib/stdlib.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/string/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libc/string/string.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libm/ceil.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libm/fabs.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libm/floor.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libm/inf.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libm/libm.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libm/maf.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libm/math.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libm/mif.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libm/nan.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libm/pi.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libm/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/libm/round.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/math/fixed.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/math/fixed16.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/math/fixed30.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/math/fixed6.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/math/impl/fixed16_arm.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/math/impl/fixed30_arm.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/math/int32.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/math/math.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/math/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/math/random.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/memory/buffer.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/memory/fixed_pool.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/memory/large_pool.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/memory/memory.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/memory/pool.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/memory/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/memory/queue_buffer.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/memory/small_pool.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/memory/static_buffer.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/memory/string_pool.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/network/addr.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/cookies.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/dns/cache.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/dns/dns.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/dns/looker.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/dns/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/dns/server.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/http.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/hwaddr.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/ipaddr.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/ipv4.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/ipv6.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/network.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/ssl.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/network/url.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/object/array.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/object/boolean.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/object/data.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/object/date.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/object/dictionary.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/object/null.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/object/number.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/object/object.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/object/prefix.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/reader/bin.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/reader/bplist.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/reader/json.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/reader/prefix.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/reader/reader.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/reader/xml.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/reader/xplist.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/object/string.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/writer/bin.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/writer/bplist.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/writer/json.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/writer/prefix.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/writer/writer.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/writer/xml.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/object/writer/xplist.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/arm/atomic.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/arm/frame.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/arm/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/atomic.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/barrier.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/frame.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/x64/atomic.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/x64/barrier.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/x64/frame.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/x64/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/x86/atomic.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/x86/barrier.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/x86/frame.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/arch/x86/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/atomic.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/atomic64.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/backtrace.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/barrier.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/cache_time.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/compiler/gcc/atomic.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/compiler/gcc/atomic64.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/compiler/gcc/barrier.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/compiler/gcc/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/compiler/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/directory.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/dns.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/dynamic.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/environment.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/event.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/exception.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/file.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/platform/hostmac.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/hostname.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/ifaddrs.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/libc/exception.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/libc/prefix.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/platform/linux/android/android.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/platform/linux/android/prefix.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/platform/linux/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/ltimer.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/mach/barrier.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/platform/mach/ios/prefix.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/platform/mach/mac/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/mach/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/memory.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/mutex.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/page.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/path.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/platform.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/platform/posix/prefix.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/platform/posix/sockaddr.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/print.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/process.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/processor.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/sched.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/semaphore.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/socket.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/spinlock.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/platform/systemv/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/thread.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/thread_pool.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/thread_store.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/time.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/timer.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/platform/unix/prefix.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/platform/unix/syscall.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/atomic.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/atomic64.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/barrier.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/exception.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/dbghelp.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/interface.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/iphlpapi.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/kernel32.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/mswsock.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/shell32.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/user32.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/ws2_32.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/ntstatus.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/prefix.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/platform/windows/socket_pool.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/abort.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/arch.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/asm.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.S mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/asm/asm.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/asm/cache.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.S mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/assembler.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/assert.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/check.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/compiler.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/config.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/cpu.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/endian.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/keyword.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/limits.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/malloc.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/packed.h delete mode 100755 core/pkg/tbox.pkg/inc/tbox/prefix/prefix.S mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/state.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/trace.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/type.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/utils.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/prefix/version.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/stream/async_stream.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/stream/async_transfer.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/stream/filter.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/stream/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/stream/static_stream.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/stream/stream.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/stream/transfer.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/stream/transfer_pool.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/string/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/string/static_string.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/string/string.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/tbox.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/base32.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/base64.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/bits.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/crc.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/dump.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_arm.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_gcc.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_sh4.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_x86.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/utils/impl/crc_arm.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/utils/impl/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/lock_profiler.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/md5.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/option.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/sha.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/singleton.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/trace.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/url.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/used.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/utils/utils.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/xml/node.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/xml/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/xml/reader.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/xml/writer.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/xml/xml.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/zip/gzip.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/zip/lzsw.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/zip/prefix.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/zip/rlc.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/zip/vlc.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/zip/vlc/prefix.h mode change 100755 => 100644 core/pkg/tbox.pkg/inc/tbox/zip/zip.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/zip/zlib.h create mode 100644 core/pkg/tbox.pkg/inc/tbox/zip/zlibraw.h delete mode 100644 core/pkg/tbox.pkg/lib/msvc/x86/tboxd.pdb delete mode 100644 core/pkg/tbox.pkg/lib/msvc/x86/tboxr.pdb diff --git a/core/pkg/tbox.pkg/inc/mac/x64/tbox.config.h b/core/pkg/tbox.pkg/inc/mac/x64/tbox.config.h old mode 100644 new mode 100755 index 72c9c14e9..4d34a7622 --- a/core/pkg/tbox.pkg/inc/mac/x64/tbox.config.h +++ b/core/pkg/tbox.pkg/inc/mac/x64/tbox.config.h @@ -1,97 +1,82 @@ #ifndef TB_CONFIG_H #define TB_CONFIG_H -// packages - #define TB_CONFIG_PACKAGE_HAVE_BASE - -// major version -#define TB_CONFIG_VERSION_MAJOR 1 - -// minor version -#define TB_CONFIG_VERSION_MINOR 4 - -// alter version -#define TB_CONFIG_VERSION_ALTER 8 - -// build version -#define TB_CONFIG_VERSION_BUILD 201505251325 - -// small -#define TB_CONFIG_SMALL (0) - -// os -#define TB_CONFIG_OS_MAC -#define TB_CONFIG_OS_LIKE_UNIX - -// api -#define TB_CONFIG_API_HAVE_POSIX -#define TB_CONFIG_API_HAVE_SYSTEMV - -// type -#define TB_CONFIG_TYPE_FLOAT - -// memory -//#define TB_CONFIG_MEMORY_UNALIGNED_ACCESS_ENABLE - -// trace -//#define TB_CONFIG_TRACE_INFO_ONLY - -// exception -#define TB_CONFIG_EXCEPTION_ENABLE - -// libc +// version +#define TB_CONFIG_VERSION "1.5.0" +#define TB_CONFIG_VERSION_MAJOR 1 +#define TB_CONFIG_VERSION_MINOR 5 +#define TB_CONFIG_VERSION_ALTER 0 +#define TB_CONFIG_VERSION_BUILD 201507021420 + +// defines +#define TB_CONFIG_OS_MACOSX +#define TB_CONFIG_TYPE_HAVE_FLOAT +#define TB_CONFIG_MODULE_HAVE_XML +#define TB_CONFIG_MODULE_HAVE_ZIP +#define TB_CONFIG_MODULE_HAVE_ASIO +#define TB_CONFIG_MODULE_HAVE_OBJECT +#define TB_CONFIG_MODULE_HAVE_CHARSET +#define TB_CONFIG_MODULE_HAVE_DATABASE #define TB_CONFIG_LIBC_HAVE_MEMCPY #define TB_CONFIG_LIBC_HAVE_MEMSET -#define TB_CONFIG_LIBC_HAVE_MEMMOV +#define TB_CONFIG_LIBC_HAVE_MEMMOVE #define TB_CONFIG_LIBC_HAVE_MEMCMP #define TB_CONFIG_LIBC_HAVE_STRCAT #define TB_CONFIG_LIBC_HAVE_STRNCAT #define TB_CONFIG_LIBC_HAVE_STRCPY #define TB_CONFIG_LIBC_HAVE_STRNCPY -//#define TB_CONFIG_LIBC_HAVE_STRLCPY -#define TB_CONFIG_LIBC_HAVE_STRLEN +#define TB_CONFIG_LIBC_HAVE_STRLCPY +#define TB_CONFIG_LIBC_HAVE_STRLEN #define TB_CONFIG_LIBC_HAVE_STRNLEN #define TB_CONFIG_LIBC_HAVE_STRSTR -#define TB_CONFIG_LIBC_HAVE_STRISTR +#define TB_CONFIG_LIBC_HAVE_STRCASESTR #define TB_CONFIG_LIBC_HAVE_STRCMP -#define TB_CONFIG_LIBC_HAVE_STRICMP +#define TB_CONFIG_LIBC_HAVE_STRCASECMP #define TB_CONFIG_LIBC_HAVE_STRNCMP -#define TB_CONFIG_LIBC_HAVE_STRNICMP +#define TB_CONFIG_LIBC_HAVE_STRNCASECMP #define TB_CONFIG_LIBC_HAVE_WCSCAT #define TB_CONFIG_LIBC_HAVE_WCSNCAT #define TB_CONFIG_LIBC_HAVE_WCSCPY #define TB_CONFIG_LIBC_HAVE_WCSNCPY -//#define TB_CONFIG_LIBC_HAVE_WCSLCPY -#define TB_CONFIG_LIBC_HAVE_WCSLEN +#define TB_CONFIG_LIBC_HAVE_WCSLCPY +#define TB_CONFIG_LIBC_HAVE_WCSLEN #define TB_CONFIG_LIBC_HAVE_WCSNLEN #define TB_CONFIG_LIBC_HAVE_WCSSTR -//#define TB_CONFIG_LIBC_HAVE_WCSISTR #define TB_CONFIG_LIBC_HAVE_WCSCMP -#define TB_CONFIG_LIBC_HAVE_WCSICMP +#define TB_CONFIG_LIBC_HAVE_WCSCASECMP #define TB_CONFIG_LIBC_HAVE_WCSNCMP -#define TB_CONFIG_LIBC_HAVE_WCSNICMP +#define TB_CONFIG_LIBC_HAVE_WCSNCASECMP #define TB_CONFIG_LIBC_HAVE_WCSTOMBS #define TB_CONFIG_LIBC_HAVE_MBSTOWCS #define TB_CONFIG_LIBC_HAVE_GMTIME #define TB_CONFIG_LIBC_HAVE_MKTIME #define TB_CONFIG_LIBC_HAVE_LOCALTIME +#define TB_CONFIG_LIBC_HAVE_GETTIMEOFDAY #define TB_CONFIG_LIBC_HAVE_SIGNAL #define TB_CONFIG_LIBC_HAVE_SETJMP #define TB_CONFIG_LIBC_HAVE_SIGSETJMP #define TB_CONFIG_LIBC_HAVE_BACKTRACE - -// libm -//#define TB_CONFIG_LIBM_HAVE_SINCOS -//#define TB_CONFIG_LIBM_HAVE_SINCOSF +#define TB_CONFIG_LIBC_HAVE_SYSTEM #define TB_CONFIG_LIBM_HAVE_LOG2 #define TB_CONFIG_LIBM_HAVE_LOG2F - -// module -#define TB_CONFIG_MODULE_HAVE_XML -#define TB_CONFIG_MODULE_HAVE_ZIP -#define TB_CONFIG_MODULE_HAVE_ASIO -#define TB_CONFIG_MODULE_HAVE_OBJECT -#define TB_CONFIG_MODULE_HAVE_CHARSET -#define TB_CONFIG_MODULE_HAVE_DATABASE +#define TB_CONFIG_POSIX_HAVE_POLL +#define TB_CONFIG_POSIX_HAVE_PTHREAD_MUTEX_INIT +#define TB_CONFIG_POSIX_HAVE_PTHREAD_CREATE +#define TB_CONFIG_POSIX_HAVE_SOCKET +#define TB_CONFIG_POSIX_HAVE_OPENDIR +#define TB_CONFIG_POSIX_HAVE_DLOPEN +#define TB_CONFIG_POSIX_HAVE_OPEN +#define TB_CONFIG_POSIX_HAVE_GETHOSTNAME +#define TB_CONFIG_POSIX_HAVE_GETIFADDRS +#define TB_CONFIG_POSIX_HAVE_SEM_INIT +#define TB_CONFIG_POSIX_HAVE_GETPAGESIZE +#define TB_CONFIG_POSIX_HAVE_SYSCONF +#define TB_CONFIG_POSIX_HAVE_SCHED_YIELD +#define TB_CONFIG_SYSTEMV_HAVE_SEMGET + +// undefines +#undef TB_CONFIG_TRACE_INFO_ONLY +#undef TB_CONFIG_EXCEPTION_ENABLE +#undef TB_CONFIG_MEMORY_UNALIGNED_ACCESS_ENABLE #endif diff --git a/core/pkg/tbox.pkg/inc/msvc/x86/tbox.config.h b/core/pkg/tbox.pkg/inc/msvc/x86/tbox.config.h index f48896de0..6ec51f4ca 100644 --- a/core/pkg/tbox.pkg/inc/msvc/x86/tbox.config.h +++ b/core/pkg/tbox.pkg/inc/msvc/x86/tbox.config.h @@ -1,95 +1,56 @@ -#ifndef TB_CONFIG_H -#define TB_CONFIG_H - -// packages - #define TB_CONFIG_PACKAGE_HAVE_BASE - - -// major version -#define TB_CONFIG_VERSION_MAJOR 1 - -// minor version -#define TB_CONFIG_VERSION_MINOR 4 - -// alter version -#define TB_CONFIG_VERSION_ALTER 8 - -// build version -#define TB_CONFIG_VERSION_BUILD 201506021443 - -// small -#define TB_CONFIG_SMALL (0) - -// os -#define TB_CONFIG_OS_WINDOWS -//#define TB_CONFIG_OS_LIKE_UNIX - -// api -//#define TB_CONFIG_API_HAVE_POSIX -//#define TB_CONFIG_API_HAVE_SYSTEMV - -// type -#define TB_CONFIG_TYPE_FLOAT - -// memory -//#define TB_CONFIG_MEMORY_UNALIGNED_ACCESS_ENABLE - -// trace -//#define TB_CONFIG_TRACE_INFO_ONLY - -// exception -#define TB_CONFIG_EXCEPTION_ENABLE - -// libc -#define TB_CONFIG_LIBC_HAVE_MEMCPY -#define TB_CONFIG_LIBC_HAVE_MEMSET -#define TB_CONFIG_LIBC_HAVE_MEMMOV -#define TB_CONFIG_LIBC_HAVE_MEMCMP -#define TB_CONFIG_LIBC_HAVE_STRCAT -#define TB_CONFIG_LIBC_HAVE_STRNCAT -#define TB_CONFIG_LIBC_HAVE_STRCPY -#define TB_CONFIG_LIBC_HAVE_STRNCPY -//#define TB_CONFIG_LIBC_HAVE_STRLCPY -#define TB_CONFIG_LIBC_HAVE_STRLEN -#define TB_CONFIG_LIBC_HAVE_STRNLEN -#define TB_CONFIG_LIBC_HAVE_STRSTR -//#define TB_CONFIG_LIBC_HAVE_STRISTR -#define TB_CONFIG_LIBC_HAVE_STRCMP -#define TB_CONFIG_LIBC_HAVE_STRICMP -#define TB_CONFIG_LIBC_HAVE_STRNCMP -#define TB_CONFIG_LIBC_HAVE_STRNICMP -#define TB_CONFIG_LIBC_HAVE_WCSCAT -#define TB_CONFIG_LIBC_HAVE_WCSNCAT -#define TB_CONFIG_LIBC_HAVE_WCSCPY -#define TB_CONFIG_LIBC_HAVE_WCSNCPY -//#define TB_CONFIG_LIBC_HAVE_WCSLCPY -#define TB_CONFIG_LIBC_HAVE_WCSLEN -#define TB_CONFIG_LIBC_HAVE_WCSNLEN -#define TB_CONFIG_LIBC_HAVE_WCSSTR -//#define TB_CONFIG_LIBC_HAVE_WCSISTR -#define TB_CONFIG_LIBC_HAVE_WCSCMP -#define TB_CONFIG_LIBC_HAVE_WCSICMP -#define TB_CONFIG_LIBC_HAVE_WCSNCMP -#define TB_CONFIG_LIBC_HAVE_WCSNICMP -#define TB_CONFIG_LIBC_HAVE_WCSTOMBS -#define TB_CONFIG_LIBC_HAVE_MBSTOWCS -#define TB_CONFIG_LIBC_HAVE_GMTIME -#define TB_CONFIG_LIBC_HAVE_MKTIME -#define TB_CONFIG_LIBC_HAVE_LOCALTIME -//#define TB_CONFIG_LIBC_HAVE_SETJMP - -// libm -#define TB_CONFIG_LIBM_HAVE_SINCOS -//#define TB_CONFIG_LIBM_HAVE_SINCOSF -//#define TB_CONFIG_LIBM_HAVE_LOG2 -//#define TB_CONFIG_LIBM_HAVE_LOG2F - -// module -#define TB_CONFIG_MODULE_HAVE_XML -#define TB_CONFIG_MODULE_HAVE_ZIP -#define TB_CONFIG_MODULE_HAVE_ASIO -#define TB_CONFIG_MODULE_HAVE_OBJECT -#define TB_CONFIG_MODULE_HAVE_CHARSET -#define TB_CONFIG_MODULE_HAVE_DATABASE - -#endif +#ifndef TB_CONFIG_H +#define TB_CONFIG_H + +// version +#define TB_CONFIG_VERSION "1.5.0" +#define TB_CONFIG_VERSION_MAJOR 1 +#define TB_CONFIG_VERSION_MINOR 5 +#define TB_CONFIG_VERSION_ALTER 0 +#define TB_CONFIG_VERSION_BUILD 201507021431 + +// defines +#define TB_CONFIG_OS_WINDOWS +#define TB_CONFIG_TYPE_HAVE_FLOAT +#define TB_CONFIG_MODULE_HAVE_XML +#define TB_CONFIG_MODULE_HAVE_ZIP +#define TB_CONFIG_MODULE_HAVE_ASIO +#define TB_CONFIG_MODULE_HAVE_OBJECT +#define TB_CONFIG_MODULE_HAVE_CHARSET +#define TB_CONFIG_MODULE_HAVE_DATABASE +#define TB_CONFIG_LIBC_HAVE_MEMCPY +#define TB_CONFIG_LIBC_HAVE_MEMSET +#define TB_CONFIG_LIBC_HAVE_MEMMOVE +#define TB_CONFIG_LIBC_HAVE_MEMCMP +#define TB_CONFIG_LIBC_HAVE_STRCAT +#define TB_CONFIG_LIBC_HAVE_STRNCAT +#define TB_CONFIG_LIBC_HAVE_STRCPY +#define TB_CONFIG_LIBC_HAVE_STRNCPY +#define TB_CONFIG_LIBC_HAVE_STRLEN +#define TB_CONFIG_LIBC_HAVE_STRNLEN +#define TB_CONFIG_LIBC_HAVE_STRSTR +#define TB_CONFIG_LIBC_HAVE_STRCMP +#define TB_CONFIG_LIBC_HAVE_STRNCMP +#define TB_CONFIG_LIBC_HAVE_WCSCAT +#define TB_CONFIG_LIBC_HAVE_WCSNCAT +#define TB_CONFIG_LIBC_HAVE_WCSCPY +#define TB_CONFIG_LIBC_HAVE_WCSNCPY +#define TB_CONFIG_LIBC_HAVE_WCSLEN +#define TB_CONFIG_LIBC_HAVE_WCSNLEN +#define TB_CONFIG_LIBC_HAVE_WCSSTR +#define TB_CONFIG_LIBC_HAVE_WCSCMP +#define TB_CONFIG_LIBC_HAVE_WCSNCMP +#define TB_CONFIG_LIBC_HAVE_WCSTOMBS +#define TB_CONFIG_LIBC_HAVE_MBSTOWCS +#define TB_CONFIG_LIBC_HAVE_GMTIME +#define TB_CONFIG_LIBC_HAVE_MKTIME +#define TB_CONFIG_LIBC_HAVE_LOCALTIME +#define TB_CONFIG_LIBC_HAVE_SIGNAL +#define TB_CONFIG_LIBC_HAVE_SETJMP +#define TB_CONFIG_LIBC_HAVE_SYSTEM + +// undefines +#undef TB_CONFIG_TRACE_INFO_ONLY +#undef TB_CONFIG_EXCEPTION_ENABLE +#undef TB_CONFIG_MEMORY_UNALIGNED_ACCESS_ENABLE + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/algorithm.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/algorithm.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find_if.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/binary_find_if.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/bubble_sort.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/bubble_sort.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/count.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/count.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/count_if.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/count_if.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/distance.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/distance.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/find.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/find.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/find_if.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/find_if.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/for.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/for.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/for_if.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/for_if.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/heap_sort.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/heap_sort.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/insert_sort.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/insert_sort.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/predicate.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/predicate.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/prefix.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/quick_sort.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/quick_sort.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/remove.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/remove.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/remove_first.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/remove_first.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/remove_first_if.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/remove_first_if.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/remove_if.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/remove_if.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/rfind.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/rfind.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/rfind_if.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/rfind_if.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/rfor.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/rfor.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/rfor_if.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/rfor_if.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/rwalk.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/rwalk.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/sort.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/sort.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/algorithm/walk.h b/core/pkg/tbox.pkg/inc/tbox/algorithm/walk.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/asio/aice.h b/core/pkg/tbox.pkg/inc/tbox/asio/aice.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/asio/aico.h b/core/pkg/tbox.pkg/inc/tbox/asio/aico.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/asio/aicp.h b/core/pkg/tbox.pkg/inc/tbox/asio/aicp.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/asio/aioe.h b/core/pkg/tbox.pkg/inc/tbox/asio/aioe.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/asio/aioo.h b/core/pkg/tbox.pkg/inc/tbox/asio/aioo.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/asio/aiop.h b/core/pkg/tbox.pkg/inc/tbox/asio/aiop.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/asio/asio.h b/core/pkg/tbox.pkg/inc/tbox/asio/asio.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/asio/dns.h b/core/pkg/tbox.pkg/inc/tbox/asio/dns.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/asio/http.h b/core/pkg/tbox.pkg/inc/tbox/asio/http.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/asio/prefix.h b/core/pkg/tbox.pkg/inc/tbox/asio/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/asio/ssl.h b/core/pkg/tbox.pkg/inc/tbox/asio/ssl.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/charset/charset.h b/core/pkg/tbox.pkg/inc/tbox/charset/charset.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/charset/prefix.h b/core/pkg/tbox.pkg/inc/tbox/charset/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/config.h b/core/pkg/tbox.pkg/inc/tbox/config.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/bloom_filter.h b/core/pkg/tbox.pkg/inc/tbox/container/bloom_filter.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/circle_queue.h b/core/pkg/tbox.pkg/inc/tbox/container/circle_queue.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/container.h b/core/pkg/tbox.pkg/inc/tbox/container/container.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/element.h b/core/pkg/tbox.pkg/inc/tbox/container/element.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/element/hash.h b/core/pkg/tbox.pkg/inc/tbox/container/element/hash.h new file mode 100644 index 000000000..54a4e411a --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/container/element/hash.h @@ -0,0 +1,96 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file hash.h + * + */ +#ifndef TB_CONTAINER_ELEMENT_HASH_H +#define TB_CONTAINER_ELEMENT_HASH_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * interfaces + */ + +/* compute the uint8 hash + * + * @param value the value + * @param mask the mask + * @param index the hash func index + * + * @return the hash value + */ +tb_size_t tb_element_hash_uint8(tb_uint8_t value, tb_size_t mask, tb_size_t index); + +/* compute the uint16 hash + * + * @param value the value + * @param mask the mask + * @param index the hash func index + * + * @return the hash value + */ +tb_size_t tb_element_hash_uint16(tb_uint16_t value, tb_size_t mask, tb_size_t index); + +/* compute the uint32 hash + * + * @param value the value + * @param mask the mask + * @param index the hash func index + * + * @return the hash value + */ +tb_size_t tb_element_hash_uint32(tb_uint32_t value, tb_size_t mask, tb_size_t index); + +/* compute the uint64 hash + * + * @param value the value + * @param mask the mask + * @param index the hash func index + * + * @return the hash value + */ +tb_size_t tb_element_hash_uint64(tb_uint64_t value, tb_size_t mask, tb_size_t index); + +/* compute the data hash + * + * @param data the data + * @param size the size + * @param mask the mask + * @param index the hash func index + * + * @return the hash value + */ +tb_size_t tb_element_hash_data(tb_byte_t const* data, tb_size_t size, tb_size_t mask, tb_size_t index); + +/* compute the cstring hash + * + * @param cstr the cstring + * @param mask the mask + * @param index the hash func index + * + * @return the hash value + */ +tb_size_t tb_element_hash_cstr(tb_char_t const* cstr, tb_size_t mask, tb_size_t index); + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/container/element/prefix.h b/core/pkg/tbox.pkg/inc/tbox/container/element/prefix.h new file mode 100644 index 000000000..51bf8c8a4 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/container/element/prefix.h @@ -0,0 +1,39 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file prefix.h + * + */ +#ifndef TB_CONTAINER_ELEMENT_PREFIX_H +#define TB_CONTAINER_ELEMENT_PREFIX_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "../prefix.h" +#include "../element.h" +#include "../../libc/libc.h" +#include "../../utils/utils.h" +#include "../../memory/memory.h" +#include "../../object/object.h" +#include "../../stream/stream.h" +#include "../../platform/platform.h" + + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/container/hash.h b/core/pkg/tbox.pkg/inc/tbox/container/hash.h deleted file mode 100755 index 39cb36724..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/container/hash.h +++ /dev/null @@ -1,184 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file hash.h - * @ingroup container - * - */ -#ifndef TB_CONTAINER_HASH_H -#define TB_CONTAINER_HASH_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" -#include "item.h" -#include "iterator.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * macros - */ - -// the hash bulk size -#define TB_HASH_BULK_SIZE_MICRO (64) -#define TB_HASH_BULK_SIZE_SMALL (256) -#define TB_HASH_BULK_SIZE_LARGE (65536) - -/* ////////////////////////////////////////////////////////////////////////////////////// - * types - */ - -/// the hash item type -typedef struct __tb_hash_item_t -{ - /// the item name - tb_pointer_t name; - - /// the item data - tb_pointer_t data; - -}tb_hash_item_t, *tb_hash_item_ref_t; - -/*! the hash ref type - * - *
- *                 0        1        3       ...     ...                n       n + 1
- * hash_list: |--------|--------|--------|--------|--------|--------|--------|--------|
- *                         |
- *                       -----    
- * item_list:           |     |       key:0                                      
- *                       -----   
- *                      |     |       key:1                                              
- *                       -----               <= insert by binary search algorithm
- *                      |     |       key:2                                               
- *                       -----  
- *                      |     |       key:3                                               
- *                       -----   
- *                      |     |       key:4                                               
- *                       -----  
- *                      |     |                                              
- *                       -----  
- *                      |     |                                              
- *                       -----  
- *                      |     |                                              
- *                       -----  
- *
- * 
- * - * @note the itor of the same item is mutable - */ -typedef tb_iterator_ref_t tb_hash_ref_t; - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! init hash - * - * @param bulk_size the hash bulk size, using the default size if be zero - * @param name_func the hash name func - * @param data_func the hash data func - * - * @return the hash - */ -tb_hash_ref_t tb_hash_init(tb_size_t bulk_size, tb_item_func_t name_func, tb_item_func_t data_func); - -/*! exit hash - * - * @param hash the hash - */ -tb_void_t tb_hash_exit(tb_hash_ref_t hash); - -/*! clear hash - * - * @param hash the hash - */ -tb_void_t tb_hash_clear(tb_hash_ref_t hash); - -/*! get hash item itor - * - * @param hash the hash - * @param name the hash item name - * - * @return the hash itor, @note: itor => item maybe changed if insert or remove item - */ -tb_size_t tb_hash_itor(tb_hash_ref_t hash, tb_cpointer_t name); - -/*! get hash item data - * - * @param hash the hash - * @param name the hash item name - * - * @return the hash item data - */ -tb_pointer_t tb_hash_get(tb_hash_ref_t hash, tb_cpointer_t name); - -/*! del hash item - * - * @param hash the hash - * @param name the hash item name - */ -tb_void_t tb_hash_del(tb_hash_ref_t hash, tb_cpointer_t name); - -/*! set hash item - * - * @param hash the hash - * @param name the hash item name - * @param data the hash item data - * - * @return the hash itor, @note: itor => item maybe changed if insert or remove item - */ -tb_size_t tb_hash_set(tb_hash_ref_t hash, tb_cpointer_t name, tb_cpointer_t data); - -/*! the hash size - * - * @param hash the hash - * - * @return the hash size - */ -tb_size_t tb_hash_size(tb_hash_ref_t hash); - -/*! the hash maxn - * - * @param hash the hash - * - * @return the hash maxn - */ -tb_size_t tb_hash_maxn(tb_hash_ref_t hash); - -#ifdef __tb_debug__ -/*! dump hash - * - * @param hash the hash - */ -tb_void_t tb_hash_dump(tb_hash_ref_t hash); -#endif - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/container/hash_map.h b/core/pkg/tbox.pkg/inc/tbox/container/hash_map.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/hash_set.h b/core/pkg/tbox.pkg/inc/tbox/container/hash_set.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/heap.h b/core/pkg/tbox.pkg/inc/tbox/container/heap.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/item.h b/core/pkg/tbox.pkg/inc/tbox/container/item.h deleted file mode 100755 index 35b48a8ea..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/container/item.h +++ /dev/null @@ -1,350 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file item.h - * @ingroup container - * - */ -#ifndef TB_CONTAINER_ITEM_H -#define TB_CONTAINER_ITEM_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * types - */ - -struct __tb_item_func_t; - -/*! the item data hash func type - * - * @param func the item func - * @param data the item data - * @param mask the hash mask - * @param index the hash index - * - * @return the hash value - */ -typedef tb_size_t (*tb_item_func_hash_t)(struct __tb_item_func_t* func, tb_cpointer_t data, tb_size_t mask, tb_size_t index); - -/*! the item data compare func type - * - * @param func the item func - * @param ldata the left-hand data - * @param rdata the right-hand data - * - * @return equal: 0, 1: >, -1: < - */ -typedef tb_long_t (*tb_item_func_comp_t)(struct __tb_item_func_t* func, tb_cpointer_t ldata, tb_cpointer_t rdata); - -/*! the item data func type - * - * @param func the item func - * @param buff the item data address - * - * @return the item data - */ -typedef tb_pointer_t (*tb_item_func_data_t)(struct __tb_item_func_t* func, tb_cpointer_t buff); - -/*! the item data string func type - * - * @param func the item func - * @param data the item data - * @param cstr the string buffer - * @param maxn the string buffer maximum size - * - * @return the string pointer - */ -typedef tb_char_t const* (*tb_item_func_cstr_t)(struct __tb_item_func_t* func, tb_cpointer_t data, tb_char_t* cstr, tb_size_t maxn); - -/*! the item data load func type - * - * load data to the item from the stream - * - * @param func the item func - * @param buff the item buffer - * @param stream the stream - * - * @return tb_true or tb_false - */ -typedef tb_bool_t (*tb_item_func_load_t)(struct __tb_item_func_t* func, tb_pointer_t buff, tb_stream_ref_t stream); - -/*! the item data save func type - * - * save data to the stream - * - * @param func the item func - * @param data the item data - * @param stream the stream - * - * @return tb_true or tb_false - */ -typedef tb_bool_t (*tb_item_func_save_t)(struct __tb_item_func_t* func, tb_cpointer_t data, tb_stream_ref_t stream); - -/*! the item free func type - * - * @param func the item func - * @param buff the item buffer - */ -typedef tb_void_t (*tb_item_func_free_t)(struct __tb_item_func_t* func, tb_pointer_t buff); - -/*! the item duplicate func type - * - * allocate a new item and copy the item data - * - * @param func the item func - * @param buff the item buffer - * @param data the item data - */ -typedef tb_void_t (*tb_item_func_dupl_t)(struct __tb_item_func_t* func, tb_pointer_t buff, tb_cpointer_t data); - -/*! the item replace func type - * - * free the previous item data and duplicate the new data - * - * @param func the item func - * @param buff the item buffer - * @param data the item data - */ -typedef tb_void_t (*tb_item_func_repl_t)(struct __tb_item_func_t* func, tb_pointer_t buff, tb_cpointer_t data); - -/*! the item copy func type - * - * only copy the item data and not allocate new item - * - * @param func the item func - * @param buff the item data address - * @param data the item data - */ -typedef tb_void_t (*tb_item_func_copy_t)(struct __tb_item_func_t* func, tb_pointer_t buff, tb_cpointer_t data); - -/*! the items free func type - * - * free some items - * - * @param func the item func - * @param buff the item buffer - * @param size the item count - */ -typedef tb_void_t (*tb_item_func_nfree_t)(struct __tb_item_func_t* func, tb_pointer_t buff, tb_size_t size); - -/*! the items duplicate func type - * - * duplicate some items - * - * @param func the item func - * @param buff the item buffer - * @param data the item data - * @param size the item count - */ -typedef tb_void_t (*tb_item_func_ndupl_t)(struct __tb_item_func_t* func, tb_pointer_t buff, tb_cpointer_t data, tb_size_t size); - -/*! the items replace func type - * - * replace some items - * - * @param func the item func - * @param buff the item buffer - * @param data the item data - * @param size the item count - */ -typedef tb_void_t (*tb_item_func_nrepl_t)(struct __tb_item_func_t* func, tb_pointer_t buff, tb_cpointer_t data, tb_size_t size); - -/*! the items copy func type - * - * copy some items - * - * @param func the item func - * @param buff the item buffer - * @param data the item data - * @param size the item count - */ -typedef tb_void_t (*tb_item_func_ncopy_t)(struct __tb_item_func_t* func, tb_pointer_t buff, tb_cpointer_t data, tb_size_t size); - -/// the item type -typedef enum __tb_item_type_t -{ - TB_ITEM_TYPE_NULL = 0 //!< null -, TB_ITEM_TYPE_LONG = 1 //!< integer for tb_long_t -, TB_ITEM_TYPE_SIZE = 2 //!< integer for tb_size_t -, TB_ITEM_TYPE_UINT8 = 3 //!< integer for tb_uint8_t -, TB_ITEM_TYPE_UINT16 = 4 //!< integer for tb_uint16_t -, TB_ITEM_TYPE_UINT32 = 5 //!< integer for tb_uint32_t -, TB_ITEM_TYPE_STR = 6 //!< string -, TB_ITEM_TYPE_PTR = 7 //!< pointer -, TB_ITEM_TYPE_MEM = 8 //!< memory -, TB_ITEM_TYPE_OBJ = 9 //!< object -, TB_ITEM_TYPE_TRUE = 10 //!< true -, TB_ITEM_TYPE_USER = 11 //!< the user defined type - -}tb_item_type_t; - -/// the item func type -typedef struct __tb_item_func_t -{ - /// the item type - tb_uint16_t type; - - /// the item flag - tb_uint16_t flag; - - /// the item size - tb_uint16_t size; - - /// the priv data - tb_cpointer_t priv; - - /// the hash func - tb_item_func_hash_t hash; - - /// the compare func - tb_item_func_comp_t comp; - - /// the data func - tb_item_func_data_t data; - - /// the string func - tb_item_func_cstr_t cstr; - - /// the free item func - tb_item_func_free_t free; - - /// the duplicate func - tb_item_func_dupl_t dupl; - - /// the replace func - tb_item_func_repl_t repl; - - /// the copy func - tb_item_func_copy_t copy; - - /// the free items func - tb_item_func_nfree_t nfree; - - /// the duplicate items func - tb_item_func_ndupl_t ndupl; - - /// the replace items func - tb_item_func_nrepl_t nrepl; - - /// the copy items func - tb_item_func_ncopy_t ncopy; - -}tb_item_func_t; - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! the null item function, no space - * - * @return the item func - */ -tb_item_func_t tb_item_func_null(tb_noarg_t); - -/*! the true item function, no space - * - * .e.g for hash data - * - * @return the item func - */ -tb_item_func_t tb_item_func_true(tb_noarg_t); - -/*! the integer item function for tb_long_t - * - * @return the item func - */ -tb_item_func_t tb_item_func_long(tb_noarg_t); - -/*! the integer item function for tb_size_t - * - * @return the item func - */ -tb_item_func_t tb_item_func_size(tb_noarg_t); - -/*! the integer item function for tb_uint8_t - * - * @return the item func - */ -tb_item_func_t tb_item_func_uint8(tb_noarg_t); - -/*! the integer item function for tb_uint16_t - * - * @return the item func - */ -tb_item_func_t tb_item_func_uint16(tb_noarg_t); - -/*! the integer item function for tb_uint32_t - * - * @return the item func - */ -tb_item_func_t tb_item_func_uint32(tb_noarg_t); - -/*! the string item function - * - * @param bcase is case? - * - * @return the item func - */ -tb_item_func_t tb_item_func_str(tb_bool_t bcase); - -/*! the pointer item function - * - * @note if the free func have been hooked, the nfree need hook too. - * - * @param free the item free func - * @param priv the private data of the item free func - * - * @return the item func - */ -tb_item_func_t tb_item_func_ptr(tb_item_func_free_t free, tb_cpointer_t priv); - -/*! the object item function - * - * @return the item func - */ -tb_item_func_t tb_item_func_obj(tb_noarg_t); - -/*! the internal fixed memory item function - * - * storing it in the internal item of the container directly for saving memory - * - * @param size the item size - * @param free the item free func - * @param priv the private data of the item free func - * - * @return the item func - */ -tb_item_func_t tb_item_func_mem(tb_size_t size, tb_item_func_free_t free, tb_cpointer_t priv); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/container/iterator.h b/core/pkg/tbox.pkg/inc/tbox/container/iterator.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/iterator/prefix.h b/core/pkg/tbox.pkg/inc/tbox/container/iterator/prefix.h new file mode 100644 index 000000000..d84483189 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/container/iterator/prefix.h @@ -0,0 +1,38 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file prefix.h + * + */ +#ifndef TB_CONTAINER_ITERATOR_PREFIX_H +#define TB_CONTAINER_ITERATOR_PREFIX_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "../prefix.h" +#include "../iterator.h" +#include "../../libc/libc.h" +#include "../../utils/utils.h" +#include "../../memory/memory.h" +#include "../../object/object.h" +#include "../../platform/platform.h" + + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/container/list.h b/core/pkg/tbox.pkg/inc/tbox/container/list.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/list_entry.h b/core/pkg/tbox.pkg/inc/tbox/container/list_entry.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/prefix.h b/core/pkg/tbox.pkg/inc/tbox/container/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/priority_queue.h b/core/pkg/tbox.pkg/inc/tbox/container/priority_queue.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/queue.h b/core/pkg/tbox.pkg/inc/tbox/container/queue.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/single_list.h b/core/pkg/tbox.pkg/inc/tbox/container/single_list.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/single_list_entry.h b/core/pkg/tbox.pkg/inc/tbox/container/single_list_entry.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/stack.h b/core/pkg/tbox.pkg/inc/tbox/container/stack.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/container/vector.h b/core/pkg/tbox.pkg/inc/tbox/container/vector.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/database/database.h b/core/pkg/tbox.pkg/inc/tbox/database/database.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/database/prefix.h b/core/pkg/tbox.pkg/inc/tbox/database/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/database/sql.h b/core/pkg/tbox.pkg/inc/tbox/database/sql.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/database/value.h b/core/pkg/tbox.pkg/inc/tbox/database/value.h old mode 100755 new mode 100644 index af82222af..a28d286ee --- a/core/pkg/tbox.pkg/inc/tbox/database/value.h +++ b/core/pkg/tbox.pkg/inc/tbox/database/value.h @@ -51,7 +51,7 @@ typedef enum __tb_database_sql_value_type_e , TB_DATABASE_SQL_VALUE_TYPE_UINT16 = 6 , TB_DATABASE_SQL_VALUE_TYPE_UINT32 = 7 , TB_DATABASE_SQL_VALUE_TYPE_UINT64 = 8 -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT , TB_DATABASE_SQL_VALUE_TYPE_FLOAT = 13 , TB_DATABASE_SQL_VALUE_TYPE_DOUBLE = 14 #endif @@ -87,7 +87,7 @@ typedef struct __tb_database_sql_value_t tb_uint64_t u64; // float -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT tb_float_t f; tb_double_t d; #endif @@ -191,7 +191,7 @@ tb_uint32_t tb_database_sql_value_uint32(tb_database_sql_value_t const* */ tb_uint64_t tb_database_sql_value_uint64(tb_database_sql_value_t const* value); -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT /*! the float value * * @param value the value @@ -272,7 +272,7 @@ tb_void_t tb_database_sql_value_set_uint32(tb_database_sql_value_t* va */ tb_void_t tb_database_sql_value_set_uint64(tb_database_sql_value_t* value, tb_uint64_t number); -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT /*! set the float value * * @param value the value @@ -358,7 +358,7 @@ static __tb_inline_force__ tb_bool_t tb_database_sql_value_is_integer(tb_databas } /// the value is float? -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT static __tb_inline_force__ tb_bool_t tb_database_sql_value_is_float(tb_database_sql_value_t const* value) { return ( value diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/libc.h b/core/pkg/tbox.pkg/inc/tbox/libc/libc.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/misc/ctype.h b/core/pkg/tbox.pkg/inc/tbox/libc/misc/ctype.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/misc/limits.h b/core/pkg/tbox.pkg/inc/tbox/libc/misc/limits.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/misc/misc.h b/core/pkg/tbox.pkg/inc/tbox/libc/misc/misc.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/misc/prefix.h b/core/pkg/tbox.pkg/inc/tbox/libc/misc/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/misc/setjmp.h b/core/pkg/tbox.pkg/inc/tbox/libc/misc/setjmp.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/misc/signal.h b/core/pkg/tbox.pkg/inc/tbox/libc/misc/signal.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/misc/stdarg.h b/core/pkg/tbox.pkg/inc/tbox/libc/misc/stdarg.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/misc/time/prefix.h b/core/pkg/tbox.pkg/inc/tbox/libc/misc/time/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/misc/time/time.h b/core/pkg/tbox.pkg/inc/tbox/libc/misc/time/time.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/misc/time/type.h b/core/pkg/tbox.pkg/inc/tbox/libc/misc/time/type.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/prefix.h b/core/pkg/tbox.pkg/inc/tbox/libc/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/stdio/prefix.h b/core/pkg/tbox.pkg/inc/tbox/libc/stdio/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/stdio/printf_object.h b/core/pkg/tbox.pkg/inc/tbox/libc/stdio/printf_object.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/stdio/stdio.h b/core/pkg/tbox.pkg/inc/tbox/libc/stdio/stdio.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/stdlib/prefix.h b/core/pkg/tbox.pkg/inc/tbox/libc/stdlib/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/stdlib/stdlib.h b/core/pkg/tbox.pkg/inc/tbox/libc/stdlib/stdlib.h old mode 100755 new mode 100644 index 27b55a9d7..e22467e29 --- a/core/pkg/tbox.pkg/inc/tbox/libc/stdlib/stdlib.h +++ b/core/pkg/tbox.pkg/inc/tbox/libc/stdlib/stdlib.h @@ -63,7 +63,7 @@ __tb_extern_c_enter__ #define tb_sbtoi64(s, b) ((tb_int64_t)tb_sbtou64(s, b)) // for float -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_s2tof(s) ((tb_float_t)tb_s2tod(s)) # define tb_s8tof(s) ((tb_float_t)tb_s8tod(s)) # define tb_s10tof(s) ((tb_float_t)tb_s10tod(s)) @@ -77,7 +77,7 @@ __tb_extern_c_enter__ #define tb_atoll(s) tb_s10toi64(s) #define tb_strtol(s, e, b) tb_sbtoi32(s, b) #define tb_strtoll(s, e, b) tb_sbtoi64(s, b) -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_atof(s) tb_s10tod(s) # define tb_strtof(s, e) tb_s10tof(s) # define tb_strtod(s, e) tb_s10tod(s) @@ -177,7 +177,7 @@ tb_uint64_t tb_stou64(tb_char_t const* s); */ tb_uint64_t tb_sbtou64(tb_char_t const* s, tb_int_t base); -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT /*! convert the binary string to double * diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/string/prefix.h b/core/pkg/tbox.pkg/inc/tbox/libc/string/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libc/string/string.h b/core/pkg/tbox.pkg/inc/tbox/libc/string/string.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libm/ceil.h b/core/pkg/tbox.pkg/inc/tbox/libm/ceil.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libm/fabs.h b/core/pkg/tbox.pkg/inc/tbox/libm/fabs.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libm/floor.h b/core/pkg/tbox.pkg/inc/tbox/libm/floor.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libm/inf.h b/core/pkg/tbox.pkg/inc/tbox/libm/inf.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libm/libm.h b/core/pkg/tbox.pkg/inc/tbox/libm/libm.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libm/maf.h b/core/pkg/tbox.pkg/inc/tbox/libm/maf.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libm/math.h b/core/pkg/tbox.pkg/inc/tbox/libm/math.h old mode 100755 new mode 100644 index 5ed5f8832..ec85c209a --- a/core/pkg/tbox.pkg/inc/tbox/libm/math.h +++ b/core/pkg/tbox.pkg/inc/tbox/libm/math.h @@ -28,7 +28,7 @@ * includes */ #include "prefix.h" -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT # include "nan.h" # include "inf.h" # include "maf.h" @@ -49,7 +49,7 @@ __tb_extern_c_enter__ * interfaces */ -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT // is infinite? tb_long_t tb_isinf(tb_double_t x); diff --git a/core/pkg/tbox.pkg/inc/tbox/libm/mif.h b/core/pkg/tbox.pkg/inc/tbox/libm/mif.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libm/nan.h b/core/pkg/tbox.pkg/inc/tbox/libm/nan.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libm/pi.h b/core/pkg/tbox.pkg/inc/tbox/libm/pi.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/libm/prefix.h b/core/pkg/tbox.pkg/inc/tbox/libm/prefix.h old mode 100755 new mode 100644 index a876ed2d8..0e0e72d14 --- a/core/pkg/tbox.pkg/inc/tbox/libm/prefix.h +++ b/core/pkg/tbox.pkg/inc/tbox/libm/prefix.h @@ -33,7 +33,7 @@ * types */ -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT // the ieee float type typedef union __tb_ieee_float_t diff --git a/core/pkg/tbox.pkg/inc/tbox/libm/round.h b/core/pkg/tbox.pkg/inc/tbox/libm/round.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/math/fixed.h b/core/pkg/tbox.pkg/inc/tbox/math/fixed.h old mode 100755 new mode 100644 index 97bf82338..590578a73 --- a/core/pkg/tbox.pkg/inc/tbox/math/fixed.h +++ b/core/pkg/tbox.pkg/inc/tbox/math/fixed.h @@ -46,7 +46,7 @@ #define TB_FIXED_NEAR0 TB_FIXED16_NEAR0 // conversion -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_fixed_to_float(x) tb_fixed16_to_float(x) # define tb_float_to_fixed(x) tb_float_to_fixed16(x) #endif diff --git a/core/pkg/tbox.pkg/inc/tbox/math/fixed16.h b/core/pkg/tbox.pkg/inc/tbox/math/fixed16.h old mode 100755 new mode 100644 index 4ac998f04..abe99aadc --- a/core/pkg/tbox.pkg/inc/tbox/math/fixed16.h +++ b/core/pkg/tbox.pkg/inc/tbox/math/fixed16.h @@ -55,7 +55,7 @@ __tb_extern_c_enter__ #define TB_FIXED16_NEAR0 (1 << 4) // conversion -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT # ifndef tb_fixed16_to_float # define tb_fixed16_to_float(x) ((tb_float_t)((x) * 1.5258789e-5)) # endif @@ -175,7 +175,7 @@ __tb_extern_c_enter__ // sin #ifndef tb_fixed16_sin -# ifdef TB_CONFIG_TYPE_FLOAT +# ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_fixed16_sin(x) tb_fixed16_sin_float(x) # else # define tb_fixed16_sin(x) tb_fixed16_sin_int32(x) @@ -184,7 +184,7 @@ __tb_extern_c_enter__ // cos #ifndef tb_fixed16_cos -# ifdef TB_CONFIG_TYPE_FLOAT +# ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_fixed16_cos(x) tb_fixed16_cos_float(x) # else # define tb_fixed16_cos(x) tb_fixed16_cos_int32(x) @@ -193,7 +193,7 @@ __tb_extern_c_enter__ // sincos #ifndef tb_fixed16_sincos -# ifdef TB_CONFIG_TYPE_FLOAT +# ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_fixed16_sincos(x, s, c) tb_fixed16_sincos_float(x, s, c) # else # define tb_fixed16_sincos(x, s, c) tb_fixed16_sincos_int32(x, s, c) @@ -202,7 +202,7 @@ __tb_extern_c_enter__ // tan #ifndef tb_fixed16_tan -# ifdef TB_CONFIG_TYPE_FLOAT +# ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_fixed16_tan(x) tb_fixed16_tan_float(x) # else # define tb_fixed16_tan(x) tb_fixed16_tan_int32(x) @@ -211,7 +211,7 @@ __tb_extern_c_enter__ // asin #ifndef tb_fixed16_asin -# ifdef TB_CONFIG_TYPE_FLOAT +# ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_fixed16_asin(x) tb_fixed16_asin_float(x) # else # define tb_fixed16_asin(x) tb_fixed16_asin_int32(x) @@ -220,7 +220,7 @@ __tb_extern_c_enter__ // acos #ifndef tb_fixed16_acos -# ifdef TB_CONFIG_TYPE_FLOAT +# ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_fixed16_acos(x) tb_fixed16_acos_float(x) # else # define tb_fixed16_acos(x) tb_fixed16_acos_int32(x) @@ -229,7 +229,7 @@ __tb_extern_c_enter__ // atan #ifndef tb_fixed16_atan -# ifdef TB_CONFIG_TYPE_FLOAT +# ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_fixed16_atan(x) tb_fixed16_atan_float(x) # else # define tb_fixed16_atan(x) tb_fixed16_atan_int32(x) @@ -238,7 +238,7 @@ __tb_extern_c_enter__ // atan2 #ifndef tb_fixed16_atan2 -# ifdef TB_CONFIG_TYPE_FLOAT +# ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_fixed16_atan2(y, x) tb_fixed16_atan2_float(y, x) # else # define tb_fixed16_atan2(y, x) tb_fixed16_atan2_int32(y, x) @@ -247,7 +247,7 @@ __tb_extern_c_enter__ // exp #ifndef tb_fixed16_exp -# ifdef TB_CONFIG_TYPE_FLOAT +# ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_fixed16_exp(x) tb_fixed16_exp_float(x) # else # define tb_fixed16_exp(x) tb_fixed16_exp_int32(x) @@ -255,7 +255,7 @@ __tb_extern_c_enter__ #endif #ifndef tb_fixed16_expi -# ifdef TB_CONFIG_TYPE_FLOAT +# ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_fixed16_expi(x) tb_fixed16_expi_float(x) # else # define tb_fixed16_expi(x) tb_assert(0) @@ -263,7 +263,7 @@ __tb_extern_c_enter__ #endif #ifndef tb_fixed16_exp1 -# ifdef TB_CONFIG_TYPE_FLOAT +# ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_fixed16_exp1(x) tb_fixed16_exp1_float(x) # else # define tb_fixed16_exp1(x) tb_assert(0) @@ -424,7 +424,7 @@ static __tb_inline__ tb_fixed16_t tb_fixed16_imulsub_check(tb_fixed16_t x, tb_lo // ok return (tb_fixed16_t)v; } -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT static __tb_inline__ tb_fixed16_t tb_fixed16_sin_float(tb_fixed16_t x) { return tb_float_to_fixed16(tb_sinf(tb_fixed16_to_float(x))); diff --git a/core/pkg/tbox.pkg/inc/tbox/math/fixed30.h b/core/pkg/tbox.pkg/inc/tbox/math/fixed30.h old mode 100755 new mode 100644 index b7232b715..41965701a --- a/core/pkg/tbox.pkg/inc/tbox/math/fixed30.h +++ b/core/pkg/tbox.pkg/inc/tbox/math/fixed30.h @@ -53,7 +53,7 @@ __tb_extern_c_enter__ #define TB_FIXED30_SQRT2 (0x5a827999) // conversion -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT # ifndef tb_fixed30_to_float # define tb_fixed30_to_float(x) (((x) * 0.00000000093132257f)) # endif @@ -83,7 +83,7 @@ __tb_extern_c_enter__ #ifndef tb_fixed30_mul # if 1 # define tb_fixed30_mul(x, y) tb_fixed30_mul_int64(x, y) -# elif defined(TB_CONFIG_TYPE_FLOAT) +# elif defined(TB_CONFIG_TYPE_HAVE_FLOAT) # define tb_fixed30_mul(x, y) tb_fixed30_mul_float(x, y) # else # define tb_fixed30_mul(x, y) tb_fixed30_mul_int32(x, y) @@ -94,7 +94,7 @@ __tb_extern_c_enter__ #ifndef tb_fixed30_div # if 1 # define tb_fixed30_div(x, y) tb_fixed30_div_int64(x, y) -# elif defined(TB_CONFIG_TYPE_FLOAT) +# elif defined(TB_CONFIG_TYPE_HAVE_FLOAT) # define tb_fixed30_div(x, y) tb_fixed30_div_float(x, y) # else # define tb_fixed30_div(x, y) tb_int32_div(x, y, 30) @@ -105,7 +105,7 @@ __tb_extern_c_enter__ #ifndef tb_fixed30_sqre # if 1 # define tb_fixed30_sqre(x) tb_fixed30_sqre_int64(x) -# elif defined(TB_CONFIG_TYPE_FLOAT) +# elif defined(TB_CONFIG_TYPE_HAVE_FLOAT) # define tb_fixed30_sqre(x) tb_fixed30_sqre_float(x) # else # define tb_fixed30_sqre(x) tb_fixed30_sqre_int32(x) @@ -122,7 +122,7 @@ __tb_extern_c_enter__ */ #ifdef __tb_debug__ -# ifdef TB_CONFIG_TYPE_FLOAT +# ifdef TB_CONFIG_TYPE_HAVE_FLOAT static __tb_inline__ tb_fixed30_t tb_float_to_fixed30_check(tb_float_t x) { // check overflow, [-2., 2.] @@ -152,7 +152,7 @@ static __tb_inline__ tb_fixed30_t tb_fixed30_sqre_int64(tb_fixed30_t x) return (tb_fixed30_t)((tb_hong_t)x * x >> 30); } -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT static __tb_inline__ tb_fixed30_t tb_fixed30_mul_float(tb_fixed30_t x, tb_fixed30_t y) { tb_float_t f = tb_fixed30_to_float(x) * tb_fixed30_to_float(y); diff --git a/core/pkg/tbox.pkg/inc/tbox/math/fixed6.h b/core/pkg/tbox.pkg/inc/tbox/math/fixed6.h old mode 100755 new mode 100644 index d3a01669c..0703e2b0d --- a/core/pkg/tbox.pkg/inc/tbox/math/fixed6.h +++ b/core/pkg/tbox.pkg/inc/tbox/math/fixed6.h @@ -51,7 +51,7 @@ __tb_extern_c_enter__ #define TB_FIXED6_NEAR0 (0) // conversion -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT # ifndef tb_fixed6_to_float # define tb_fixed6_to_float(x) (((x) * 0.015625)) # endif diff --git a/core/pkg/tbox.pkg/inc/tbox/math/impl/fixed16_arm.h b/core/pkg/tbox.pkg/inc/tbox/math/impl/fixed16_arm.h deleted file mode 100755 index 2a84fca64..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/math/impl/fixed16_arm.h +++ /dev/null @@ -1,66 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file fixed16_arm.h - * - */ -#ifndef TB_MATH_IMPL_FIXED16_ARM_H -#define TB_MATH_IMPL_FIXED16_ARM_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "../prefix.h" - - -/* ////////////////////////////////////////////////////////////////////////////////////// - * macros - */ - -#ifdef TB_ASSEMBLER_IS_GAS - -#if 0 -# define tb_fixed16_mul(x, y) tb_fixed16_mul_asm(x, y) -#endif - -#endif /* TB_ASSEMBLER_IS_GAS */ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -#if defined(TB_ASSEMBLER_IS_GAS) && !defined(TB_ARCH_ARM64) -static __tb_inline__ tb_fixed16_t tb_fixed16_mul_asm(tb_fixed16_t x, tb_fixed16_t y) -{ - __tb_register__ tb_fixed16_t t; - __tb_asm__ __tb_volatile__ - ( - "smull %0, %2, %1, %3 \n" // r64 = (l, h) = x * y - "mov %0, %0, lsr #16 \n" // to fixed16: r64 >>= 16 - "orr %0, %0, %2, lsl #16 \n" // x = l = (h << (32 - 16)) | (l >> 16); - - : "=r"(x), "=&r"(y), "=r"(t) - : "r"(x), "1"(y) - ); - return x; -} -#endif - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/math/impl/fixed30_arm.h b/core/pkg/tbox.pkg/inc/tbox/math/impl/fixed30_arm.h deleted file mode 100755 index 68ea25f26..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/math/impl/fixed30_arm.h +++ /dev/null @@ -1,65 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file fixed30_arm.h - * - */ -#ifndef TB_MATH_IMPL_FIXED30_ARM_H -#define TB_MATH_IMPL_FIXED30_ARM_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "../prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * macros - */ - -#ifdef TB_ASSEMBLER_IS_GAS - -#if 0 -# define tb_fixed30_mul(x, y) tb_fixed30_mul_asm(x, y) -#endif - -#endif /* TB_ASSEMBLER_IS_GAS */ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ -#if defined(TB_ASSEMBLER_IS_GAS) -static __tb_inline__ tb_fixed30_t tb_fixed30_mul_asm(tb_fixed30_t x, tb_fixed30_t y) -{ - __tb_register__ tb_fixed30_t t; - __tb_asm__ __tb_volatile__ - ( - "smull %0, %2, %1, %3 \n" // r64 = (l, h) = x * y - "mov %0, %0, lsr #30 \n" // to fixed30: r64 >>= 30 - "orr %0, %0, %2, lsl #2 \n" // x = l = (h << (32 - 30)) | (l >> 30); - - : "=r"(x), "=&r"(y), "=r"(t) - : "r"(x), "1"(y) - ); - return x; -} -#endif - - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/math/int32.h b/core/pkg/tbox.pkg/inc/tbox/math/int32.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/math/math.h b/core/pkg/tbox.pkg/inc/tbox/math/math.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/math/prefix.h b/core/pkg/tbox.pkg/inc/tbox/math/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/math/random.h b/core/pkg/tbox.pkg/inc/tbox/math/random.h old mode 100755 new mode 100644 index 86b99ae36..f21a364ee --- a/core/pkg/tbox.pkg/inc/tbox/math/random.h +++ b/core/pkg/tbox.pkg/inc/tbox/math/random.h @@ -83,7 +83,7 @@ tb_void_t tb_random_clear(tb_random_ref_t random); */ tb_long_t tb_random_range(tb_random_ref_t random, tb_long_t beg, tb_long_t end); -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT /*! generate the float random with range: [beg, end) * * @param random the random, using the default random if be null diff --git a/core/pkg/tbox.pkg/inc/tbox/memory/buffer.h b/core/pkg/tbox.pkg/inc/tbox/memory/buffer.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/memory/fixed_pool.h b/core/pkg/tbox.pkg/inc/tbox/memory/fixed_pool.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/memory/large_pool.h b/core/pkg/tbox.pkg/inc/tbox/memory/large_pool.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/memory/memory.h b/core/pkg/tbox.pkg/inc/tbox/memory/memory.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/memory/pool.h b/core/pkg/tbox.pkg/inc/tbox/memory/pool.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/memory/prefix.h b/core/pkg/tbox.pkg/inc/tbox/memory/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/memory/queue_buffer.h b/core/pkg/tbox.pkg/inc/tbox/memory/queue_buffer.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/memory/small_pool.h b/core/pkg/tbox.pkg/inc/tbox/memory/small_pool.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/memory/static_buffer.h b/core/pkg/tbox.pkg/inc/tbox/memory/static_buffer.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/memory/string_pool.h b/core/pkg/tbox.pkg/inc/tbox/memory/string_pool.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/addr.h b/core/pkg/tbox.pkg/inc/tbox/network/addr.h deleted file mode 100755 index 11840ea4a..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/network/addr.h +++ /dev/null @@ -1,57 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file addr.h - * @ingroup network - * - */ -#ifndef TB_NETWORK_ADDR_H -#define TB_NETWORK_ADDR_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * types - */ - -/// the addr4 type -typedef struct __tb_addr4_t -{ - /// the ipv4 - tb_ipv4_t ipv4; - - /// the port - tb_uint16_t port; - -}tb_addr4_t, *tb_addr4_ref_t; - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/network/cookies.h b/core/pkg/tbox.pkg/inc/tbox/network/cookies.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/dns/cache.h b/core/pkg/tbox.pkg/inc/tbox/network/dns/cache.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/dns/dns.h b/core/pkg/tbox.pkg/inc/tbox/network/dns/dns.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/dns/looker.h b/core/pkg/tbox.pkg/inc/tbox/network/dns/looker.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/dns/prefix.h b/core/pkg/tbox.pkg/inc/tbox/network/dns/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/dns/server.h b/core/pkg/tbox.pkg/inc/tbox/network/dns/server.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/http.h b/core/pkg/tbox.pkg/inc/tbox/network/http.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/hwaddr.h b/core/pkg/tbox.pkg/inc/tbox/network/hwaddr.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/ipaddr.h b/core/pkg/tbox.pkg/inc/tbox/network/ipaddr.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/ipv4.h b/core/pkg/tbox.pkg/inc/tbox/network/ipv4.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/ipv6.h b/core/pkg/tbox.pkg/inc/tbox/network/ipv6.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/network.h b/core/pkg/tbox.pkg/inc/tbox/network/network.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/prefix.h b/core/pkg/tbox.pkg/inc/tbox/network/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/ssl.h b/core/pkg/tbox.pkg/inc/tbox/network/ssl.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/network/url.h b/core/pkg/tbox.pkg/inc/tbox/network/url.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/object/array.h b/core/pkg/tbox.pkg/inc/tbox/object/array.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/object/boolean.h b/core/pkg/tbox.pkg/inc/tbox/object/boolean.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/object/data.h b/core/pkg/tbox.pkg/inc/tbox/object/data.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/object/date.h b/core/pkg/tbox.pkg/inc/tbox/object/date.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/object/dictionary.h b/core/pkg/tbox.pkg/inc/tbox/object/dictionary.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/object/null.h b/core/pkg/tbox.pkg/inc/tbox/object/null.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/object/number.h b/core/pkg/tbox.pkg/inc/tbox/object/number.h old mode 100755 new mode 100644 index 0b994a15c..830afc660 --- a/core/pkg/tbox.pkg/inc/tbox/object/number.h +++ b/core/pkg/tbox.pkg/inc/tbox/object/number.h @@ -123,7 +123,7 @@ tb_object_ref_t tb_object_number_init_from_uint64(tb_uint64_t value); */ tb_object_ref_t tb_object_number_init_from_sint64(tb_sint64_t value); -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT /*! init number from float * * @param value the value @@ -213,7 +213,7 @@ tb_uint64_t tb_object_number_uint64(tb_object_ref_t number); */ tb_sint64_t tb_object_number_sint64(tb_object_ref_t number); -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT /*! the float value of the number * * @param object the object pointer @@ -303,7 +303,7 @@ tb_bool_t tb_object_number_uint64_set(tb_object_ref_t number, tb_uint6 */ tb_bool_t tb_object_number_sint64_set(tb_object_ref_t number, tb_sint64_t value); -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT /*! set the float value * * @param object the object pointer diff --git a/core/pkg/tbox.pkg/inc/tbox/object/object.h b/core/pkg/tbox.pkg/inc/tbox/object/object.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/object/prefix.h b/core/pkg/tbox.pkg/inc/tbox/object/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/object/reader/bin.h b/core/pkg/tbox.pkg/inc/tbox/object/reader/bin.h deleted file mode 100755 index 49940aa49..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/reader/bin.h +++ /dev/null @@ -1,88 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file bin.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_READER_BIN_H -#define TB_OBJECT_READER_BIN_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * types - */ - -/// the bin reader type -typedef struct __tb_object_bin_reader_t -{ - /// the stream - tb_stream_ref_t stream; - - /// the object list - tb_vector_ref_t list; - -}tb_object_bin_reader_t; - -/// the bin reader func type -typedef tb_object_ref_t (*tb_object_bin_reader_func_t)(tb_object_bin_reader_t* reader, tb_size_t type, tb_uint64_t size); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! the bin object reader - * - * @return the bin object reader - */ -tb_object_reader_t* tb_object_bin_reader(tb_noarg_t); - -/*! hook the bin reader - * - * @param type the object type - * @param func the reader func - * - * @return tb_true or tb_false - */ -tb_bool_t tb_object_bin_reader_hook(tb_size_t type, tb_object_bin_reader_func_t func); - -/*! the bin reader func - * - * @param type the object type - * - * @return the object reader func - */ -tb_object_bin_reader_func_t tb_object_bin_reader_func(tb_size_t type); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/object/reader/bplist.h b/core/pkg/tbox.pkg/inc/tbox/object/reader/bplist.h deleted file mode 100755 index 9bf1c6c66..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/reader/bplist.h +++ /dev/null @@ -1,85 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file bplist.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_READER_BPLIST_H -#define TB_OBJECT_READER_BPLIST_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * types - */ - -/// the bplist reader type -typedef struct __tb_object_bplist_reader_t -{ - /// the stream - tb_stream_ref_t stream; - -}tb_object_bplist_reader_t; - -/// the bplist reader func type -typedef tb_object_ref_t (*tb_object_bplist_reader_func_t)(tb_object_bplist_reader_t* reader, tb_size_t type, tb_size_t size, tb_size_t item_size); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! the bplist object reader - * - * @return the bplist object reader - */ -tb_object_reader_t* tb_object_bplist_reader(tb_noarg_t); - -/*! hook the bplist reader - * - * @param type the object type - * @param func the reader func - * - * @return tb_true or tb_false - */ -tb_bool_t tb_object_bplist_reader_hook(tb_size_t type, tb_object_bplist_reader_func_t func); - -/*! the bplist reader func - * - * @param type the object type - * - * @return the object reader func - */ -tb_object_bplist_reader_func_t tb_object_bplist_reader_func(tb_size_t type); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/object/reader/json.h b/core/pkg/tbox.pkg/inc/tbox/object/reader/json.h deleted file mode 100755 index fbf4a3288..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/reader/json.h +++ /dev/null @@ -1,85 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file json.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_READER_JSON_H -#define TB_OBJECT_READER_JSON_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * types - */ - -/// the json reader type -typedef struct __tb_object_json_reader_t -{ - /// the stream - tb_stream_ref_t stream; - -}tb_object_json_reader_t; - -/// the json reader func type -typedef tb_object_ref_t (*tb_object_json_reader_func_t)(tb_object_json_reader_t* reader, tb_char_t type); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! the json object reader - * - * @return the json object reader - */ -tb_object_reader_t* tb_object_json_reader(tb_noarg_t); - -/*! hook the json reader - * - * @param type the object type name - * @param func the reader func - * - * @return tb_true or tb_false - */ -tb_bool_t tb_object_json_reader_hook(tb_char_t type, tb_object_json_reader_func_t func); - -/*! the json reader func - * - * @param type the object type name - * - * @return the object reader func - */ -tb_object_json_reader_func_t tb_object_json_reader_func(tb_char_t type); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/object/reader/prefix.h b/core/pkg/tbox.pkg/inc/tbox/object/reader/prefix.h deleted file mode 100755 index 564d818d8..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/reader/prefix.h +++ /dev/null @@ -1,84 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file prefix.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_READER_PREFIX_H -#define TB_OBJECT_READER_PREFIX_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "../prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * macros - */ - -// bytes -#define tb_object_reader_need_bytes(x) \ - (((tb_uint64_t)(x)) < (1ull << 8) ? 1 : \ - (((tb_uint64_t)(x)) < (1ull << 16) ? 2 : \ - (((tb_uint64_t)(x)) < (1ull << 24) ? 3 : \ - (((tb_uint64_t)(x)) < (1ull << 32) ? 4 : 8)))) - -/* ////////////////////////////////////////////////////////////////////////////////////// - * inlines - */ -static __tb_inline__ tb_void_t tb_object_reader_bin_type_size(tb_stream_ref_t stream, tb_size_t* ptype, tb_uint64_t* psize) -{ - // check - tb_assert_and_check_return(stream); - - // the flag - tb_uint8_t flag = tb_stream_bread_u8(stream); - - // the type & size - tb_size_t type = flag >> 4; - tb_uint64_t size = flag & 0x0f; - if (type == 0xf) type = tb_stream_bread_u8(stream); - switch (size) - { - case 0xc: - size = tb_stream_bread_u8(stream); - break; - case 0xd: - size = tb_stream_bread_u16_be(stream); - break; - case 0xe: - size = tb_stream_bread_u32_be(stream); - break; - case 0xf: - size = tb_stream_bread_u64_be(stream); - break; - default: - break; - } - - // trace -// tb_trace("type: %lu, size: %llu", type, size); - - // save - if (ptype) *ptype = type; - if (psize) *psize = size; -} - -#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/object/reader/reader.h b/core/pkg/tbox.pkg/inc/tbox/object/reader/reader.h deleted file mode 100755 index cc0aaba63..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/reader/reader.h +++ /dev/null @@ -1,81 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file reader.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_READER_H -#define TB_OBJECT_READER_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "xml.h" -#include "bin.h" -#include "json.h" -#include "xplist.h" -#include "bplist.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! set object reader - * - * @param format the reader format - * @param reader the reader - * - * @return tb_true or tb_false - */ -tb_bool_t tb_object_reader_set(tb_size_t format, tb_object_reader_t* reader); - -/*! del object reader - * - * @param format the reader format - */ -tb_void_t tb_object_reader_del(tb_size_t format); - -/*! get object reader - * - * @param format the reader format - * - * @return the object reader - */ -tb_object_reader_t* tb_object_reader_get(tb_size_t format); - -/*! done reader - * - * @param stream the stream - * - * @return the object - */ -tb_object_ref_t tb_object_reader_done(tb_stream_ref_t stream); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/object/reader/xml.h b/core/pkg/tbox.pkg/inc/tbox/object/reader/xml.h deleted file mode 100755 index 3a6b568ca..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/reader/xml.h +++ /dev/null @@ -1,85 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file xml.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_READER_XML_H -#define TB_OBJECT_READER_XML_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * types - */ - -/// the xml reader type -typedef struct __tb_object_xml_reader_t -{ - /// the xml reader - tb_xml_reader_ref_t reader; - -}tb_object_xml_reader_t; - -/// the xml reader func type -typedef tb_object_ref_t (*tb_object_xml_reader_func_t)(tb_object_xml_reader_t* reader, tb_size_t event); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! the xml object reader - * - * @return the xml object reader - */ -tb_object_reader_t* tb_object_xml_reader(tb_noarg_t); - -/*! hook the xml reader - * - * @param type the object type name - * @param func the reader func - * - * @return tb_true or tb_false - */ -tb_bool_t tb_object_xml_reader_hook(tb_char_t const* type, tb_object_xml_reader_func_t func); - -/*! the xml reader func - * - * @param type the object type name - * - * @return the object reader func - */ -tb_object_xml_reader_func_t tb_object_xml_reader_func(tb_char_t const* type); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/object/reader/xplist.h b/core/pkg/tbox.pkg/inc/tbox/object/reader/xplist.h deleted file mode 100755 index 41cb4058b..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/reader/xplist.h +++ /dev/null @@ -1,85 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file xplist.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_READER_XPLIST_H -#define TB_OBJECT_READER_XPLIST_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * types - */ - -/// the xplist reader type -typedef struct __tb_object_xplist_reader_t -{ - /// the xplist reader - tb_xml_reader_ref_t reader; - -}tb_object_xplist_reader_t; - -/// the xplist reader func type -typedef tb_object_ref_t (*tb_object_xplist_reader_func_t)(tb_object_xplist_reader_t* reader, tb_size_t event); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! the xplist object reader - * - * @return the xplist object reader - */ -tb_object_reader_t* tb_object_xplist_reader(tb_noarg_t); - -/*! hook the xplist reader - * - * @param type the object type name - * @param func the reader func - * - * @return tb_true or tb_false - */ -tb_bool_t tb_object_xplist_reader_hook(tb_char_t const* type, tb_object_xplist_reader_func_t func); - -/*! the xplist reader func - * - * @param type the object type name - * - * @return the object reader func - */ -tb_object_xplist_reader_func_t tb_object_xplist_reader_func(tb_char_t const* type); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/object/string.h b/core/pkg/tbox.pkg/inc/tbox/object/string.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/object/writer/bin.h b/core/pkg/tbox.pkg/inc/tbox/object/writer/bin.h deleted file mode 100755 index 097eae520..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/writer/bin.h +++ /dev/null @@ -1,100 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file bin.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_WRITER_BIN_H -#define TB_OBJECT_WRITER_BIN_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * types - */ - -/// the object bin writer type -typedef struct __tb_object_bin_writer_t -{ - /// the stream - tb_stream_ref_t stream; - - /// the object hash - tb_hash_ref_t ohash; - - /// the string hash - tb_hash_ref_t shash; - - /// the object index - tb_size_t index; - - /// the encoder data - tb_byte_t* data; - - /// the encoder maxn - tb_size_t maxn; - -}tb_object_bin_writer_t; - -/// the bin writer func type -typedef tb_bool_t (*tb_object_bin_writer_func_t)(tb_object_bin_writer_t* writer, tb_object_ref_t object); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! the bin object writer - * - * @return the bin object writer - */ -tb_object_writer_t* tb_object_bin_writer(tb_noarg_t); - -/*! hook the bin writer - * - * @param type the object type - * @param func the writer func - * - * @return tb_true or tb_false - */ -tb_bool_t tb_object_bin_writer_hook(tb_size_t type, tb_object_bin_writer_func_t func); - -/*! the bin writer func - * - * @param type the object type - * - * @return the object writer func - */ -tb_object_bin_writer_func_t tb_object_bin_writer_func(tb_size_t type); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/object/writer/bplist.h b/core/pkg/tbox.pkg/inc/tbox/object/writer/bplist.h deleted file mode 100755 index 7ff9e69cb..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/writer/bplist.h +++ /dev/null @@ -1,85 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file bplist.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_WRITER_BPLIST_H -#define TB_OBJECT_WRITER_BPLIST_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * types - */ - -/// the object bplist writer type -typedef struct __tb_object_bplist_writer_t -{ - /// the stream - tb_stream_ref_t stream; - -}tb_object_bplist_writer_t; - -/// the bplist writer func type -typedef tb_bool_t (*tb_object_bplist_writer_func_t)(tb_object_bplist_writer_t* writer, tb_object_ref_t object, tb_size_t item_size); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! the bplist object writer - * - * @return the bplist object writer - */ -tb_object_writer_t* tb_object_bplist_writer(tb_noarg_t); - -/*! hook the bplist writer - * - * @param type the object type - * @param func the writer func - * - * @return tb_true or tb_false - */ -tb_bool_t tb_object_bplist_writer_hook(tb_size_t type, tb_object_bplist_writer_func_t func); - -/*! the bplist writer func - * - * @param type the object type - * - * @return the object writer func - */ -tb_object_bplist_writer_func_t tb_object_bplist_writer_func(tb_size_t type); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/object/writer/json.h b/core/pkg/tbox.pkg/inc/tbox/object/writer/json.h deleted file mode 100755 index ac5eb60c0..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/writer/json.h +++ /dev/null @@ -1,88 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file json.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_WRITER_JSON_H -#define TB_OBJECT_WRITER_JSON_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * types - */ - -/// the object json writer type -typedef struct __tb_object_json_writer_t -{ - /// the stream - tb_stream_ref_t stream; - - /// is deflate? - tb_bool_t deflate; - -}tb_object_json_writer_t; - -/// the json writer func type -typedef tb_bool_t (*tb_object_json_writer_func_t)(tb_object_json_writer_t* writer, tb_object_ref_t object, tb_size_t level); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! the json object writer - * - * @return the json object writer - */ -tb_object_writer_t* tb_object_json_writer(tb_noarg_t); - -/*! hook the json writer - * - * @param type the object type - * @param func the writer func - * - * @return tb_true or tb_false - */ -tb_bool_t tb_object_json_writer_hook(tb_size_t type, tb_object_json_writer_func_t func); - -/*! the json writer func - * - * @param type the object type - * - * @return the object writer func - */ -tb_object_json_writer_func_t tb_object_json_writer_func(tb_size_t type); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/object/writer/prefix.h b/core/pkg/tbox.pkg/inc/tbox/object/writer/prefix.h deleted file mode 100755 index 1fdd5362f..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/writer/prefix.h +++ /dev/null @@ -1,124 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file prefix.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_WRITER_PREFIX_H -#define TB_OBJECT_WRITER_PREFIX_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "../prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * macros - */ - -// bytes -#define tb_object_writer_need_bytes(x) \ - (((tb_uint64_t)(x)) < (1ull << 8) ? 1 : \ - (((tb_uint64_t)(x)) < (1ull << 16) ? 2 : \ - (((tb_uint64_t)(x)) < (1ull << 24) ? 3 : \ - (((tb_uint64_t)(x)) < (1ull << 32) ? 4 : 8)))) - -/* ////////////////////////////////////////////////////////////////////////////////////// - * inlines - */ - -static __tb_inline__ tb_bool_t tb_object_writer_tab(tb_stream_ref_t stream, tb_bool_t deflate, tb_size_t tab) -{ - // writ tab - if (!deflate) - { - while (tab--) if (tb_stream_printf(stream, "\t") < 0) return tb_false; - } - - // ok - return tb_true; -} -static __tb_inline__ tb_bool_t tb_object_writer_newline(tb_stream_ref_t stream, tb_bool_t deflate) -{ - // writ newline - if (!deflate && tb_stream_printf(stream, __tb_newline__) < 0) return tb_false; - - // ok - return tb_true; -} -static __tb_inline__ tb_bool_t tb_object_writer_bin_type_size(tb_stream_ref_t stream, tb_size_t type, tb_uint64_t size) -{ - // check - tb_assert_and_check_return_val(stream && type <= 0xff, tb_false); - - // byte for size < 64bits - tb_size_t sizeb = tb_object_writer_need_bytes(size); - tb_assert_and_check_return_val(sizeb <= 8, tb_false); - - // flag for size - tb_size_t sizef = 0; - switch (sizeb) - { - case 1: sizef = 0xc; break; - case 2: sizef = 0xd; break; - case 4: sizef = 0xe; break; - case 8: sizef = 0xf; break; - default: break; - } - tb_assert_and_check_return_val(sizef, tb_false); - - // writ flag - tb_uint8_t flag = ((type < 0xf? (tb_uint8_t)type : 0xf) << 4) | (size < 0xc? (tb_uint8_t)size : (tb_uint8_t)sizef); - if (!tb_stream_bwrit_u8(stream, flag)) return tb_false; - - // trace -// tb_trace("writ: type: %lu, size: %llu", type, size); - - // writ type - if (type >= 0xf) if (!tb_stream_bwrit_u8(stream, (tb_uint8_t)type)) return tb_false; - - // writ size - if (size >= 0xc) - { - switch (sizeb) - { - case 1: - if (!tb_stream_bwrit_u8(stream, (tb_uint8_t)size)) return tb_false; - break; - case 2: - if (!tb_stream_bwrit_u16_be(stream, (tb_uint16_t)size)) return tb_false; - break; - case 4: - if (!tb_stream_bwrit_u32_be(stream, (tb_uint32_t)size)) return tb_false; - break; - case 8: - if (!tb_stream_bwrit_u64_be(stream, (tb_uint64_t)size)) return tb_false; - break; - default: - tb_assert_and_check_return_val(0, tb_false); - break; - } - } - - // ok - return tb_true; -} - -#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/object/writer/writer.h b/core/pkg/tbox.pkg/inc/tbox/object/writer/writer.h deleted file mode 100755 index 98014c41c..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/writer/writer.h +++ /dev/null @@ -1,84 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file writer.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_WRITER_H -#define TB_OBJECT_WRITER_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "xml.h" -#include "bin.h" -#include "json.h" -#include "xplist.h" -#include "bplist.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! set object writer - * - * @param format the writer format - * @param writer the writer - * - * @return tb_true or tb_false - */ -tb_bool_t tb_object_writer_set(tb_size_t format, tb_object_writer_t* writer); - -/*! del object writer - * - * @param format the writer format - */ -tb_void_t tb_object_writer_del(tb_size_t format); - -/*! get object writer - * - * @param format the writer format - * - * @return the object writer - */ -tb_object_writer_t* tb_object_writer_get(tb_size_t format); - -/*! done writer - * - * @param object the object - * @param stream the stream - * @param format the object format - * - * @return the writed size, failed: -1 - */ -tb_long_t tb_object_writer_done(tb_object_ref_t object, tb_stream_ref_t stream, tb_size_t format); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - - -#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/object/writer/xml.h b/core/pkg/tbox.pkg/inc/tbox/object/writer/xml.h deleted file mode 100755 index ff601f765..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/writer/xml.h +++ /dev/null @@ -1,88 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file xml.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_WRITER_XML_H -#define TB_OBJECT_WRITER_XML_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * types - */ - -/// the object xml writer type -typedef struct __tb_object_xml_writer_t -{ - /// the stream - tb_stream_ref_t stream; - - /// is deflate? - tb_bool_t deflate; - -}tb_object_xml_writer_t; - -/// the xml writer func type -typedef tb_bool_t (*tb_object_xml_writer_func_t)(tb_object_xml_writer_t* writer, tb_object_ref_t object, tb_size_t level); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! the xml object writer - * - * @return the xml object writer - */ -tb_object_writer_t* tb_object_xml_writer(tb_noarg_t); - -/*! hook the xml writer - * - * @param type the object type - * @param func the writer func - * - * @return tb_true or tb_false - */ -tb_bool_t tb_object_xml_writer_hook(tb_size_t type, tb_object_xml_writer_func_t func); - -/*! the xml writer func - * - * @param type the object type - * - * @return the object writer func - */ -tb_object_xml_writer_func_t tb_object_xml_writer_func(tb_size_t type); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/object/writer/xplist.h b/core/pkg/tbox.pkg/inc/tbox/object/writer/xplist.h deleted file mode 100755 index b6a2ad436..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/object/writer/xplist.h +++ /dev/null @@ -1,88 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file xplist.h - * @ingroup object - * - */ -#ifndef TB_OBJECT_WRITER_XPLIST_H -#define TB_OBJECT_WRITER_XPLIST_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * types - */ - -/// the object xplist writer type -typedef struct __tb_object_xplist_writer_t -{ - /// the stream - tb_stream_ref_t stream; - - /// is deflate? - tb_bool_t deflate; - -}tb_object_xplist_writer_t; - -/// the xplist writer func type -typedef tb_bool_t (*tb_object_xplist_writer_func_t)(tb_object_xplist_writer_t* writer, tb_object_ref_t object, tb_size_t level); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! the xplist object writer - * - * @return the xplist object writer - */ -tb_object_writer_t* tb_object_xplist_writer(tb_noarg_t); - -/*! hook the xplist writer - * - * @param type the object type - * @param func the writer func - * - * @return tb_true or tb_false - */ -tb_bool_t tb_object_xplist_writer_hook(tb_size_t type, tb_object_xplist_writer_func_t func); - -/*! the xplist writer func - * - * @param type the object type - * - * @return the object writer func - */ -tb_object_xplist_writer_func_t tb_object_xplist_writer_func(tb_size_t type); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif - diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/arm/atomic.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/arm/atomic.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/arm/frame.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/arm/frame.h new file mode 100644 index 000000000..4e0b57417 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/platform/arch/arm/frame.h @@ -0,0 +1,66 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file frame.h + * + */ +#ifndef TB_PLATFORM_ARCH_ARM_FRAME_H +#define TB_PLATFORM_ARCH_ARM_FRAME_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * macros + */ + +// the current stack frame address +#if !defined(TB_CURRENT_STACK_FRAME) \ + && defined(TB_COMPILER_IS_GCC) \ + && TB_COMPILER_VERSION_BE(4, 1) +# define TB_CURRENT_STACK_FRAME (__builtin_frame_address(0) - 12) +#endif + +// the advance stack frame address +#ifndef TB_ADVANCE_STACK_FRAME +# define TB_ADVANCE_STACK_FRAME(next) ((tb_frame_layout_t*)(next) - 1) +#endif + +/* ////////////////////////////////////////////////////////////////////////////////////// + * types + */ + +// the frame layout type +typedef struct __tb_frame_layout_t +{ + // the next + struct __tb_frame_layout_t* next; + + // the sp + tb_pointer_t sp; + + // the frame return address + tb_pointer_t return_address; + +}tb_frame_layout_t; + + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/arm/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/arm/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/atomic.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/atomic.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/barrier.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/barrier.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/frame.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/frame.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/x64/atomic.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/x64/atomic.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/x64/barrier.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/x64/barrier.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/x64/frame.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/x64/frame.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/x64/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/x64/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/x86/atomic.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/x86/atomic.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/x86/barrier.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/x86/barrier.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/x86/frame.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/x86/frame.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/arch/x86/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/arch/x86/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/atomic.h b/core/pkg/tbox.pkg/inc/tbox/platform/atomic.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/atomic64.h b/core/pkg/tbox.pkg/inc/tbox/platform/atomic64.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/backtrace.h b/core/pkg/tbox.pkg/inc/tbox/platform/backtrace.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/barrier.h b/core/pkg/tbox.pkg/inc/tbox/platform/barrier.h old mode 100755 new mode 100644 index 13712e87d..5054febfe --- a/core/pkg/tbox.pkg/inc/tbox/platform/barrier.h +++ b/core/pkg/tbox.pkg/inc/tbox/platform/barrier.h @@ -28,7 +28,7 @@ * includes */ #include "prefix.h" -#if defined(TB_CONFIG_OS_MAC) || defined(TB_CONFIG_OS_IOS) +#if defined(TB_CONFIG_OS_MACOSX) || defined(TB_CONFIG_OS_IOS) # include "mach/barrier.h" #elif defined(TB_COMPILER_IS_GCC) \ && TB_COMPILER_VERSION_BE(4, 1) diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/cache_time.h b/core/pkg/tbox.pkg/inc/tbox/platform/cache_time.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/compiler/gcc/atomic.h b/core/pkg/tbox.pkg/inc/tbox/platform/compiler/gcc/atomic.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/compiler/gcc/atomic64.h b/core/pkg/tbox.pkg/inc/tbox/platform/compiler/gcc/atomic64.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/compiler/gcc/barrier.h b/core/pkg/tbox.pkg/inc/tbox/platform/compiler/gcc/barrier.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/compiler/gcc/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/compiler/gcc/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/compiler/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/compiler/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/directory.h b/core/pkg/tbox.pkg/inc/tbox/platform/directory.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/dns.h b/core/pkg/tbox.pkg/inc/tbox/platform/dns.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/dynamic.h b/core/pkg/tbox.pkg/inc/tbox/platform/dynamic.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/environment.h b/core/pkg/tbox.pkg/inc/tbox/platform/environment.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/event.h b/core/pkg/tbox.pkg/inc/tbox/platform/event.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/exception.h b/core/pkg/tbox.pkg/inc/tbox/platform/exception.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/file.h b/core/pkg/tbox.pkg/inc/tbox/platform/file.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/hostmac.h b/core/pkg/tbox.pkg/inc/tbox/platform/hostmac.h deleted file mode 100755 index 3fa82d063..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/platform/hostmac.h +++ /dev/null @@ -1,56 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file hostmac.h - * @ingroup platform - * - */ -#ifndef TB_PLATFORM_HOSTMAC_H -#define TB_PLATFORM_HOSTMAC_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "prefix.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * interfaces - */ - -/*! get the host mac address for the given network interface name - * - * @param interface_name the network interface name, using the first ethernet address if be null - * @param mac_address the raw mac address - * - * @return tb_true or tb_false - */ -tb_bool_t tb_hostmac(tb_char_t const* interface_name, tb_byte_t mac_address[6]); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - - -#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/hostname.h b/core/pkg/tbox.pkg/inc/tbox/platform/hostname.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/ifaddrs.h b/core/pkg/tbox.pkg/inc/tbox/platform/ifaddrs.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/libc/exception.h b/core/pkg/tbox.pkg/inc/tbox/platform/libc/exception.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/libc/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/libc/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/linux/android/android.h b/core/pkg/tbox.pkg/inc/tbox/platform/linux/android/android.h new file mode 100644 index 000000000..1d00defb3 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/platform/linux/android/android.h @@ -0,0 +1,52 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file android.h + * @ingroup platform + */ +#ifndef TB_PLATFORM_LINUX_ANDROID_H +#define TB_PLATFORM_LINUX_ANDROID_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * interfaces + */ + +/*! init the android platform + * + * @param jenv the jni environment pointer + * + * @return tb_true or tb_false + */ +tb_bool_t tb_android_init(JNIEnv* jenv); + +/// exit the android platform +tb_void_t tb_android_exit(tb_noarg_t); + +/*! the jni environment pointer + * + * @return the environment pointer + */ +JNIEnv* tb_android_jenv(tb_noarg_t); + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/linux/android/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/linux/android/prefix.h new file mode 100644 index 000000000..1208719a8 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/platform/linux/android/prefix.h @@ -0,0 +1,32 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file prefix.h + * @ingroup platform + */ +#ifndef TB_PLATFORM_LINUX_ANDROID_PREFIX_H +#define TB_PLATFORM_LINUX_ANDROID_PREFIX_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "../prefix.h" +#include + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/linux/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/linux/prefix.h new file mode 100644 index 000000000..e131be8ad --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/platform/linux/prefix.h @@ -0,0 +1,33 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file prefix.h + * @ingroup platform + */ +#ifndef TB_PLATFORM_LINUX_PREFIX_H +#define TB_PLATFORM_LINUX_PREFIX_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "../prefix.h" +#include "../../libc/libc.h" +#include "../../utils/utils.h" + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/ltimer.h b/core/pkg/tbox.pkg/inc/tbox/platform/ltimer.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/mach/barrier.h b/core/pkg/tbox.pkg/inc/tbox/platform/mach/barrier.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/mach/ios/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/mach/ios/prefix.h new file mode 100644 index 000000000..d8bdbc6d3 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/platform/mach/ios/prefix.h @@ -0,0 +1,31 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file prefix.h + * @ingroup platform + */ +#ifndef TB_PLATFORM_MACH_IOS_PREFIX_H +#define TB_PLATFORM_MACH_IOS_PREFIX_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "../prefix.h" + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/mach/mac/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/mach/mac/prefix.h new file mode 100644 index 000000000..f4e014c91 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/platform/mach/mac/prefix.h @@ -0,0 +1,31 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file prefix.h + * @ingroup platform + */ +#ifndef TB_PLATFORM_MACH_MAC_PREFIX_H +#define TB_PLATFORM_MACH_MAC_PREFIX_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "../prefix.h" + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/mach/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/mach/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/memory.h b/core/pkg/tbox.pkg/inc/tbox/platform/memory.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/mutex.h b/core/pkg/tbox.pkg/inc/tbox/platform/mutex.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/page.h b/core/pkg/tbox.pkg/inc/tbox/platform/page.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/path.h b/core/pkg/tbox.pkg/inc/tbox/platform/path.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/platform.h b/core/pkg/tbox.pkg/inc/tbox/platform/platform.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/posix/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/posix/prefix.h new file mode 100644 index 000000000..cf88c8e85 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/platform/posix/prefix.h @@ -0,0 +1,33 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file prefix.h + * @ingroup platform + */ +#ifndef TB_PLATFORM_POSIX_PREFIX_H +#define TB_PLATFORM_POSIX_PREFIX_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "../platform.h" +#include "../../libc/libc.h" +#include "../../utils/utils.h" + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/posix/sockaddr.h b/core/pkg/tbox.pkg/inc/tbox/platform/posix/sockaddr.h new file mode 100644 index 000000000..1b18bfaf8 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/platform/posix/sockaddr.h @@ -0,0 +1,204 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file sockaddr.h + */ +#ifndef TB_PLATFORM_POSIX_SOCKADDR_H +#define TB_PLATFORM_POSIX_SOCKADDR_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" +#ifdef TB_CONFIG_OS_WINDOWS +# include "ws2tcpip.h" +#else +# include +#endif + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_enter__ + +/* ////////////////////////////////////////////////////////////////////////////////////// + * interfaces + */ + +/* save the socket address to the ip address + * + * @param ipaddr the ip address + * @param saddr the socket address + * + * @return the socket address size + */ +static __tb_inline__ tb_size_t tb_sockaddr_save(tb_ipaddr_ref_t ipaddr, struct sockaddr_storage const* saddr) +{ + // check + tb_assert_and_check_return_val(ipaddr && saddr, 0); + + // clear address + tb_ipaddr_clear(ipaddr); + + // done + tb_size_t size = 0; + switch (saddr->ss_family) + { + case AF_INET: + { + // the ipv4 ipaddr + struct sockaddr_in* addr4 = (struct sockaddr_in*)saddr; + + // save family + tb_ipaddr_family_set(ipaddr, TB_IPADDR_FAMILY_IPV4); + + // make ipv4 + tb_ipv4_t ipv4; + ipv4.u32 = (tb_uint32_t)addr4->sin_addr.s_addr; + + // save ipv4 + tb_ipaddr_ipv4_set(ipaddr, &ipv4); + + // save port + tb_ipaddr_port_set(ipaddr, tb_bits_be_to_ne_u16(addr4->sin_port)); + + // save size + size = sizeof(struct sockaddr_in); + } + break; + case AF_INET6: + { + // the ipv6 ipaddr + struct sockaddr_in6* addr6 = (struct sockaddr_in6*)saddr; + + // check + tb_assert_static(sizeof(ipaddr->u.ipv6.addr.u8) == sizeof(addr6->sin6_addr.s6_addr)); + tb_assert_static(tb_arrayn(ipaddr->u.ipv6.addr.u8) == tb_arrayn(addr6->sin6_addr.s6_addr)); + + // save family + tb_ipaddr_family_set(ipaddr, TB_IPADDR_FAMILY_IPV6); + + // save port + tb_ipaddr_port_set(ipaddr, tb_bits_be_to_ne_u16(addr6->sin6_port)); + + // make ipv6 + tb_ipv6_t ipv6; + tb_memcpy(ipv6.addr.u8, addr6->sin6_addr.s6_addr, sizeof(ipv6.addr.u8)); + + // save scope id + ipv6.scope_id = 0; + if (IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr) || IN6_IS_ADDR_MC_LINKLOCAL(&addr6->sin6_addr)) + ipv6.scope_id = addr6->sin6_scope_id; + + // save ipv6 + tb_ipaddr_ipv6_set(ipaddr, &ipv6); + + // save size + size = sizeof(struct sockaddr_in6); + } + break; + default: + tb_assert_abort(0); + break; + } + + // ok? + return size; +} + +/* load the ip address to socket address + * + * @param saddr the socket address + * @param ipaddr the ip address + * + * @return the socket address size + */ +static __tb_inline__ tb_size_t tb_sockaddr_load(struct sockaddr_storage* saddr, tb_ipaddr_ref_t ipaddr) +{ + // check + tb_assert_and_check_return_val(saddr && ipaddr, 0); + + // clear address + tb_memset(saddr, 0, sizeof(struct sockaddr_storage)); + + // done + tb_size_t size = 0; + switch (tb_ipaddr_family(ipaddr)) + { + case TB_IPADDR_FAMILY_IPV4: + { + // the ipv4 ipaddr + struct sockaddr_in* addr4 = (struct sockaddr_in*)saddr; + + // save family + addr4->sin_family = AF_INET; + + // save ipv4 + addr4->sin_addr.s_addr = tb_ipaddr_ip_is_any(ipaddr)? INADDR_ANY : ipaddr->u.ipv4.u32; + + // save port + addr4->sin_port = tb_bits_ne_to_be_u16(tb_ipaddr_port(ipaddr)); + + // save size + size = sizeof(struct sockaddr_in); + } + break; + case TB_IPADDR_FAMILY_IPV6: + { + // the ipv6 ipaddr + struct sockaddr_in6* addr6 = (struct sockaddr_in6*)saddr; + + // check + tb_assert_static(sizeof(ipaddr->u.ipv6.addr.u8) == sizeof(addr6->sin6_addr.s6_addr)); + tb_assert_static(tb_arrayn(ipaddr->u.ipv6.addr.u8) == tb_arrayn(addr6->sin6_addr.s6_addr)); + + // save family + addr6->sin6_family = AF_INET6; + + // save ipv6 + if (tb_ipaddr_ip_is_any(ipaddr)) addr6->sin6_addr = in6addr_any; + else tb_memcpy(addr6->sin6_addr.s6_addr, ipaddr->u.ipv6.addr.u8, sizeof(addr6->sin6_addr.s6_addr)); + + // save port + addr6->sin6_port = tb_bits_ne_to_be_u16(tb_ipaddr_port(ipaddr)); + + // save scope id + if (tb_ipv6_is_linklocal(&ipaddr->u.ipv6) || tb_ipv6_is_mc_linklocal(&ipaddr->u.ipv6)) + addr6->sin6_scope_id = ipaddr->u.ipv6.scope_id; + + // save size + size = sizeof(struct sockaddr_in6); + } + break; + default: + tb_assert_abort(0); + break; + } + + // ok? + return size; +} + + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_leave__ + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/print.h b/core/pkg/tbox.pkg/inc/tbox/platform/print.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/process.h b/core/pkg/tbox.pkg/inc/tbox/platform/process.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/processor.h b/core/pkg/tbox.pkg/inc/tbox/platform/processor.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/sched.h b/core/pkg/tbox.pkg/inc/tbox/platform/sched.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/semaphore.h b/core/pkg/tbox.pkg/inc/tbox/platform/semaphore.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/socket.h b/core/pkg/tbox.pkg/inc/tbox/platform/socket.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/spinlock.h b/core/pkg/tbox.pkg/inc/tbox/platform/spinlock.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/systemv/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/systemv/prefix.h new file mode 100644 index 000000000..64c917a0f --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/platform/systemv/prefix.h @@ -0,0 +1,33 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file prefix.h + * @ingroup platform + */ +#ifndef TB_PLATFORM_SYSTEMV_PREFIX_H +#define TB_PLATFORM_SYSTEMV_PREFIX_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "../platform.h" +#include "../../libc/libc.h" +#include "../../utils/utils.h" + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/thread.h b/core/pkg/tbox.pkg/inc/tbox/platform/thread.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/thread_pool.h b/core/pkg/tbox.pkg/inc/tbox/platform/thread_pool.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/thread_store.h b/core/pkg/tbox.pkg/inc/tbox/platform/thread_store.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/time.h b/core/pkg/tbox.pkg/inc/tbox/platform/time.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/timer.h b/core/pkg/tbox.pkg/inc/tbox/platform/timer.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/unix/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/unix/prefix.h new file mode 100644 index 000000000..c5735c89c --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/platform/unix/prefix.h @@ -0,0 +1,33 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file prefix.h + * @ingroup platform + */ +#ifndef TB_PLATFORM_UNIX_PREFIX_H +#define TB_PLATFORM_UNIX_PREFIX_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "../prefix.h" +#include "../../libc/libc.h" +#include "../../utils/utils.h" + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/unix/syscall.h b/core/pkg/tbox.pkg/inc/tbox/platform/unix/syscall.h new file mode 100644 index 000000000..ffa028f34 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/platform/unix/syscall.h @@ -0,0 +1,185 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file syscall.h + * @ingroup platform + */ +#ifndef TB_PLATFORM_UNIX_SYSCALL_H +#define TB_PLATFORM_UNIX_SYSCALL_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" +#include + +/* ////////////////////////////////////////////////////////////////////////////////////// + * macros + */ +#ifdef TB_ASSEMBLER_IS_GAS + +// x64 +# if defined(TB_ARCH_x64) +# define tb_syscall1(code, name, type1, arg1) \ + static __tb_inline__ tb_long_t name(type1 arg1) \ + { \ + tb_long_t __ret; \ + __asm__ __volatile__("syscall" : "=a" (__ret) : \ + "0" (code), "D" (arg1)); \ + return __ret; \ + } + +# define tb_syscall2(code, name, type1, arg1, type2, arg2) \ + static __tb_inline__ tb_long_t name(type1 arg1, type2 arg2) \ + { \ + tb_long_t __ret; \ + __asm__ __volatile__("syscall" : "=a" (__ret) : \ + "0" (code), "D" (arg1), "S" (arg2)); \ + return __ret; \ + } + +# define tb_syscall3(code, name, type1, arg1, type2, arg2, type3, arg3) \ + static __tb_inline__ tb_long_t name(type1 arg1, type2 arg2, type3 arg3) \ + { \ + tb_long_t __ret; \ + __asm__ __volatile__("syscall" : "=a" (__ret) : \ + "0" (code), "D" (arg1), "S" (arg2), \ + "d" (arg3) \ + ); \ + return __ret; \ + } + +# define tb_syscall4(code, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) \ + static __tb_inline__ tb_long_t name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ + { \ + tb_long_t __ret; \ + __asm__ __volatile__("movq %5,%%r10 ; syscall" : "=a" (__ret) : \ + "0" (code), "D" (arg1), "S" (arg2), \ + "d" (arg3), "g" (arg4) \ + ); \ + return __ret; \ + } + +# define tb_syscall5(code, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5) \ + static __tb_inline__ tb_long_t name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ + { \ + tb_long_t __ret; \ + __asm__ __volatile__("movq %5,%%r10 ; movq %6,%%r8 ; syscall" : "=a" (__ret) : \ + "0" (code), "D" (arg1), "S" (arg2), \ + "d" (arg3), "g" (arg4), "g" (arg5) \ + ); \ + return __ret; \ + } + +// x86 +# elif defined(TB_ARCH_x86) +# define tb_syscall1(code, name, type1, arg1) \ + static __tb_inline__ tb_long_t name(type1 arg1) \ + { \ + tb_long_t __ret; \ + __asm__ __volatile__("int $0x80" : "=a" (__ret) : \ + "0" (code), "b" (arg1)); \ + return __ret; \ + } + +# define tb_syscall2(code, name, type1, arg1, type2, arg2) \ + static __tb_inline__ tb_long_t name(type1 arg1, type2 arg2) \ + { \ + tb_long_t __ret; \ + __asm__ __volatile__("int $0x80" : "=a" (__ret) : \ + "0" (code), "b" (arg1), "c" (arg2)); \ + return __ret; \ + } + +# define tb_syscall3(code, name, type1, arg1, type2, arg2, type3, arg3) \ + static __tb_inline__ tb_long_t name(type1 arg1, type2 arg2, type3 arg3) \ + { \ + tb_long_t __ret; \ + __asm__ __volatile__("int $0x80" : "=a" (__ret) : \ + "0" (code), "b" (arg1), "c" (arg2), \ + "d" (arg3) \ + ); \ + return __ret; \ + } + +# define tb_syscall4(code, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) \ + static __tb_inline__ tb_long_t name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ + { \ + tb_long_t __ret; \ + __asm__ __volatile__("int $0x80" : "=a" (__ret) : \ + "0" (code), "b" (arg1), "c" (arg2), \ + "d" (arg3), "S" (arg4) \ + ); \ + return __ret; \ + } + +# define tb_syscall5(code, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5) \ + static __tb_inline__ tb_long_t name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ + { \ + tb_long_t __ret; \ + __asm__ __volatile__("int $0x80" : "=a" (__ret) : \ + "0" (code), "b" (arg1), "c" (arg2), \ + "d" (arg3), "S" (arg4), "D" (arg5) \ + ); \ + return __ret; \ + } + +# endif +#endif + +#ifndef tb_syscall1 +# define tb_syscall1(code, name, type1, arg1) \ + static __tb_inline__ tb_long_t name(type1 arg1) \ + { \ + return syscall(code, arg1); \ + } +#endif + +#ifndef tb_syscall2 +# define tb_syscall2(code, name, type1, arg1, type2, arg2) \ + static __tb_inline__ tb_long_t name(type1 arg1, type2 arg2) \ + { \ + return syscall(code, arg1, arg2); \ + } +#endif + +#ifndef tb_syscall3 +# define tb_syscall3(code, name, type1, arg1, type2, arg2, type3, arg3) \ + static __tb_inline__ tb_long_t name(type1 arg1, type2 arg2, type3 arg3) \ + { \ + return syscall(code, arg1, arg2, arg3); \ + } +#endif + +#ifndef tb_syscall4 +# define tb_syscall4(code, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) \ + static __tb_inline__ tb_long_t name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ + { \ + return syscall(code, arg1, arg2, arg3, arg4); \ + } +#endif + +#ifndef tb_syscall5 +# define tb_syscall5(code, name, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5) \ + static __tb_inline__ tb_long_t name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ + { \ + return syscall(code, arg1, arg2, arg3, arg4, arg5); \ + } +#endif +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/atomic.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/atomic.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/atomic64.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/atomic64.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/barrier.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/barrier.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/exception.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/exception.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/dbghelp.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/dbghelp.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/interface.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/interface.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/iphlpapi.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/iphlpapi.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/kernel32.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/kernel32.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/mswsock.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/mswsock.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/shell32.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/shell32.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/user32.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/user32.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/ws2_32.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/interface/ws2_32.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/ntstatus.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/ntstatus.h new file mode 100644 index 000000000..c57efe865 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/platform/windows/ntstatus.h @@ -0,0 +1,408 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file ntstatus.h + * + */ +#ifndef TB_PLATFORM_WINDOWS_NTSTATUS_H +#define TB_PLATFORM_WINDOWS_NTSTATUS_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" +//#include + +/* ////////////////////////////////////////////////////////////////////////////////////// + * macros + */ + +#ifndef FACILITY_NTWIN32 +# define FACILITY_NTWIN32 (0x7) +#endif + +#ifndef STATUS_SUCCESS +# define STATUS_SUCCESS (0x00000000) +#endif + +#ifndef STATUS_PENDING +# define STATUS_PENDING (0x00000103) +#endif + +#ifndef STATUS_END_OF_FILE +# define STATUS_END_OF_FILE (0xC0000011) +#endif + +#ifndef STATUS_INVALID_HANDLE +# define STATUS_INVALID_HANDLE (0xC0000008) +#endif + +#ifndef STATUS_OBJECT_TYPE_MISMATCH +# define STATUS_OBJECT_TYPE_MISMATCH (0xC0000024) +#endif + +#ifndef STATUS_INSUFFICIENT_RESOURCES +# define STATUS_INSUFFICIENT_RESOURCES (0xC000009A) +#endif + +#ifndef STATUS_PAGEFILE_QUOTA +# define STATUS_PAGEFILE_QUOTA (0xC0000007) +#endif + +#ifndef STATUS_COMMITMENT_LIMIT +# define STATUS_COMMITMENT_LIMIT (0xC000012D) +#endif + +#ifndef STATUS_WORKING_SET_QUOTA +# define STATUS_WORKING_SET_QUOTA (0xC00000A1) +#endif + +#ifndef STATUS_NO_MEMORY +# define STATUS_NO_MEMORY (0xC0000017) +#endif + +#ifndef STATUS_CONFLICTING_ADDRESSES +# define STATUS_CONFLICTING_ADDRESSES (0xC0000018) +#endif + +#ifndef STATUS_QUOTA_EXCEEDED +# define STATUS_QUOTA_EXCEEDED (0xC0000044) +#endif + +#ifndef STATUS_TOO_MANY_PAGING_FILES +# define STATUS_TOO_MANY_PAGING_FILES (0xC0000097) +#endif + +#ifndef STATUS_REMOTE_RESOURCES +# define STATUS_REMOTE_RESOURCES (0xC000013D) +#endif + +#ifndef STATUS_TOO_MANY_ADDRESSES +# define STATUS_TOO_MANY_ADDRESSES (0xC0000209) +#endif + +#ifndef STATUS_SHARING_VIOLATION +# define STATUS_SHARING_VIOLATION (0xC0000043) +#endif + +#ifndef STATUS_HOPLIMIT_EXCEEDED +# define STATUS_HOPLIMIT_EXCEEDED (0xC000A012) +#endif + +#ifndef STATUS_ADDRESS_ALREADY_EXISTS +# define STATUS_ADDRESS_ALREADY_EXISTS (0xC000020A) +#endif + +#ifndef STATUS_LINK_TIMEOUT +# define STATUS_LINK_TIMEOUT (0xC000013F) +#endif + +#ifndef STATUS_IO_TIMEOUT +# define STATUS_IO_TIMEOUT (0xC00000B5) +#endif + +#ifndef STATUS_TIMEOUT +# define STATUS_TIMEOUT (0x00000102) +#endif + +#ifndef STATUS_GRACEFUL_DISCONNECT +# define STATUS_GRACEFUL_DISCONNECT (0xC0000237) +#endif + +#ifndef STATUS_REMOTE_DISCONNECT +# define STATUS_REMOTE_DISCONNECT (0xC000013C) +#endif + +#ifndef STATUS_CONNECTION_RESET +# define STATUS_CONNECTION_RESET (0xC000020D) +#endif + +#ifndef STATUS_LINK_FAILED +# define STATUS_LINK_FAILED (0xC000013E) +#endif + +#ifndef STATUS_CONNECTION_DISCONNECTED +# define STATUS_CONNECTION_DISCONNECTED (0xC000020C) +#endif + +#ifndef STATUS_PORT_UNREACHABLE +# define STATUS_PORT_UNREACHABLE (0xC000023F) +#endif + +#ifndef STATUS_HOPLIMIT_EXCEEDED +# define STATUS_HOPLIMIT_EXCEEDED (0xC000A012) +#endif + +#ifndef STATUS_LOCAL_DISCONNECT +# define STATUS_LOCAL_DISCONNECT (0xC000013B) +#endif + +#ifndef STATUS_FLTRSACTION_ABORTED +//# define STATUS_FLTRSACTION_ABORTED (0x00000000) +#endif + +#ifndef STATUS_CONNECTION_ABORTED +# define STATUS_CONNECTION_ABORTED (0xC0000241) +#endif + +#ifndef STATUS_BAD_NETWORK_PATH +# define STATUS_BAD_NETWORK_PATH (0xC00000BE) +#endif + +#ifndef STATUS_NETWORK_UNREACHABLE +# define STATUS_NETWORK_UNREACHABLE (0xC000023C) +#endif + +#ifndef STATUS_PROTOCOL_UNREACHABLE +# define STATUS_PROTOCOL_UNREACHABLE (0xC000023E) +#endif + +#ifndef STATUS_HOST_UNREACHABLE +# define STATUS_HOST_UNREACHABLE (0xC000023D) +#endif + +#ifndef STATUS_CANCELLED +# define STATUS_CANCELLED (0xC0000120) +#endif + +#ifndef STATUS_REQUEST_ABORTED +# define STATUS_REQUEST_ABORTED (0xC0000240) +#endif + +#ifndef STATUS_BUFFER_OVERFLOW +# define STATUS_BUFFER_OVERFLOW (0x80000005) +#endif + +#ifndef STATUS_INVALID_BUFFER_SIZE +# define STATUS_INVALID_BUFFER_SIZE (0xC0000206) +#endif + +#ifndef STATUS_BUFFER_TOO_SMALL +# define STATUS_BUFFER_TOO_SMALL (0xC0000023) +#endif + +#ifndef STATUS_ACCESS_VIOLATION +# define STATUS_ACCESS_VIOLATION (0xC0000005) +#endif + +#ifndef STATUS_DEVICE_NOT_READY +# define STATUS_DEVICE_NOT_READY (0xC00000A3) +#endif + +#ifndef STATUS_REQUEST_NOT_ACCEPTED +# define STATUS_REQUEST_NOT_ACCEPTED (0xC00000D0) +#endif + +#ifndef STATUS_INVALID_NETWORK_RESPONSE +# define STATUS_INVALID_NETWORK_RESPONSE (0xC00000C3) +#endif + +#ifndef STATUS_NETWORK_BUSY +# define STATUS_NETWORK_BUSY (0xC00000BF) +#endif + +#ifndef STATUS_NO_SUCH_DEVICE +# define STATUS_NO_SUCH_DEVICE (0xC000000E) +#endif + +#ifndef STATUS_NO_SUCH_FILE +# define STATUS_NO_SUCH_FILE (0xC000000F) +#endif + +#ifndef STATUS_OBJECT_PATH_NOT_FOUND +# define STATUS_OBJECT_PATH_NOT_FOUND (0xC000003A) +#endif + +#ifndef STATUS_OBJECT_NAME_NOT_FOUND +# define STATUS_OBJECT_NAME_NOT_FOUND (0xC0000034) +#endif + +#ifndef STATUS_UNEXPECTED_NETWORK_ERROR +# define STATUS_UNEXPECTED_NETWORK_ERROR (0xC00000C4) +#endif + +#ifndef STATUS_INVALID_CONNECTION +# define STATUS_INVALID_CONNECTION (0xC0000140) +#endif + +#ifndef STATUS_REMOTE_NOT_LISTENING +# define STATUS_REMOTE_NOT_LISTENING (0xC00000BC) +#endif + +#ifndef STATUS_CONNECTION_REFUSED +# define STATUS_CONNECTION_REFUSED (0xC0000236) +#endif + +#ifndef STATUS_PIPE_DISCONNECTED +# define STATUS_PIPE_DISCONNECTED (0xC00000B0) +#endif + +#ifndef STATUS_INVALID_ADDRESS +# define STATUS_INVALID_ADDRESS (0xC0000141) +#endif + +#ifndef STATUS_INVALID_ADDRESS_COMPONENT +# define STATUS_INVALID_ADDRESS_COMPONENT (0xC0000207) +#endif + +#ifndef STATUS_NOT_SUPPORTED +# define STATUS_NOT_SUPPORTED (0xC00000BB) +#endif + +#ifndef STATUS_NOT_IMPLEMENTED +# define STATUS_NOT_IMPLEMENTED (0xC0000002) +#endif + +#ifndef STATUS_ACCESS_DENIED +# define STATUS_ACCESS_DENIED (0xC0000022) +#endif + +#ifndef STATUS_INVALID_DEVICE_STATE +# define STATUS_INVALID_DEVICE_STATE (0xC0000184) +#endif + +/* ////////////////////////////////////////////////////////////////////////////////////// + * inlines + */ + +static __tb_inline__ tb_size_t tb_ntstatus_to_winerror(tb_size_t status) +{ + switch (status) + { + case STATUS_SUCCESS: + return ERROR_SUCCESS; + + case STATUS_PENDING: + return ERROR_IO_PENDING; + + case STATUS_END_OF_FILE: + return ERROR_HANDLE_EOF; + + case STATUS_INVALID_HANDLE: + case STATUS_OBJECT_TYPE_MISMATCH: + return WSAENOTSOCK; + + case STATUS_INSUFFICIENT_RESOURCES: + case STATUS_PAGEFILE_QUOTA: + case STATUS_COMMITMENT_LIMIT: + case STATUS_WORKING_SET_QUOTA: + case STATUS_NO_MEMORY: + case STATUS_CONFLICTING_ADDRESSES: + case STATUS_QUOTA_EXCEEDED: + case STATUS_TOO_MANY_PAGING_FILES: + case STATUS_REMOTE_RESOURCES: + case STATUS_TOO_MANY_ADDRESSES: + return WSAENOBUFS; + + case STATUS_SHARING_VIOLATION: + case STATUS_ADDRESS_ALREADY_EXISTS: + return WSAEADDRINUSE; + + case STATUS_LINK_TIMEOUT: + case STATUS_IO_TIMEOUT: + case STATUS_TIMEOUT: + return WSAETIMEDOUT; + + case STATUS_GRACEFUL_DISCONNECT: + return WSAEDISCON; + + case STATUS_REMOTE_DISCONNECT: + case STATUS_CONNECTION_RESET: + case STATUS_LINK_FAILED: + case STATUS_CONNECTION_DISCONNECTED: + case STATUS_PORT_UNREACHABLE: + case STATUS_HOPLIMIT_EXCEEDED: + case STATUS_INVALID_DEVICE_STATE: + return WSAECONNRESET; + + case STATUS_LOCAL_DISCONNECT: +// case STATUS_FLTRSACTION_ABORTED: + case STATUS_CONNECTION_ABORTED: + return WSAECONNABORTED; + + case STATUS_BAD_NETWORK_PATH: + case STATUS_NETWORK_UNREACHABLE: + case STATUS_PROTOCOL_UNREACHABLE: + return WSAENETUNREACH; + + case STATUS_HOST_UNREACHABLE: + return WSAEHOSTUNREACH; + + case STATUS_CANCELLED: + case STATUS_REQUEST_ABORTED: + return WSAEINTR; + + case STATUS_BUFFER_OVERFLOW: + case STATUS_INVALID_BUFFER_SIZE: + return WSAEMSGSIZE; + + case STATUS_BUFFER_TOO_SMALL: + case STATUS_ACCESS_VIOLATION: + return WSAEFAULT; + + case STATUS_DEVICE_NOT_READY: + case STATUS_REQUEST_NOT_ACCEPTED: + return WSAEWOULDBLOCK; + + case STATUS_INVALID_NETWORK_RESPONSE: + case STATUS_NETWORK_BUSY: + case STATUS_NO_SUCH_DEVICE: + case STATUS_NO_SUCH_FILE: + case STATUS_OBJECT_PATH_NOT_FOUND: + case STATUS_OBJECT_NAME_NOT_FOUND: + case STATUS_UNEXPECTED_NETWORK_ERROR: + return WSAENETDOWN; + + case STATUS_INVALID_CONNECTION: + return WSAENOTCONN; + + case STATUS_REMOTE_NOT_LISTENING: + case STATUS_CONNECTION_REFUSED: + return WSAECONNREFUSED; + + case STATUS_PIPE_DISCONNECTED: + return WSAESHUTDOWN; + + case STATUS_INVALID_ADDRESS: + case STATUS_INVALID_ADDRESS_COMPONENT: + return WSAEADDRNOTAVAIL; + + case STATUS_NOT_SUPPORTED: + case STATUS_NOT_IMPLEMENTED: + return WSAEOPNOTSUPP; + + case STATUS_ACCESS_DENIED: + return WSAEACCES; + + default: + if ( (status & (FACILITY_NTWIN32 << 16)) == (FACILITY_NTWIN32 << 16) + && (status & (ERROR_SEVERITY_ERROR | ERROR_SEVERITY_WARNING))) + { + return (tb_size_t) (status & 0xffff); + } + else + { + tb_trace_e("ntstatus: unknown: %lx", status); + return WSAEINVAL; + } + } +} + + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/prefix.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/platform/windows/socket_pool.h b/core/pkg/tbox.pkg/inc/tbox/platform/windows/socket_pool.h new file mode 100644 index 000000000..ff8fde64a --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/platform/windows/socket_pool.h @@ -0,0 +1,72 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file socket_pool.h + * @ingroup platform + * + */ +#ifndef TB_PLATFORM_WINDOWS_SOCKET_POOL_H +#define TB_PLATFORM_WINDOWS_SOCKET_POOL_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" +#include "../socket.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_enter__ + +/* ////////////////////////////////////////////////////////////////////////////////////// + * interfaces + */ + +/*! init socket pool + * + * @return tb_true or tb_false + */ +tb_bool_t tb_socket_pool_init(tb_noarg_t); + +/*! exit socket pool + * + */ +tb_void_t tb_socket_pool_exit(tb_noarg_t); + +/*! put socket to the socket pool + * + * @param sock the tcp socket + * + * @return tb_true or tb_false + */ +tb_bool_t tb_socket_pool_put(tb_socket_ref_t sock); + +/*! get socket from the socket pool + * + * @return the tcp socket + */ +tb_socket_ref_t tb_socket_pool_get(tb_noarg_t); + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_leave__ + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix.h b/core/pkg/tbox.pkg/inc/tbox/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/abort.h b/core/pkg/tbox.pkg/inc/tbox/prefix/abort.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/arch.h b/core/pkg/tbox.pkg/inc/tbox/prefix/arch.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/asm.h b/core/pkg/tbox.pkg/inc/tbox/prefix/asm.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.S b/core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.S old mode 100755 new mode 100644 index d815dcbb7..e8c3981ac --- a/core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.S +++ b/core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.S @@ -17,131 +17,41 @@ * Copyright (C) 2009 - 2015, ruki All rights reserved. * * @author ruki - * @file prefix.S + * @file algorithm.h + * @defgroup algorithm * */ +#ifndef TB_ALGORITHM_H +#define TB_ALGORITHM_H /* ////////////////////////////////////////////////////////////////////////////////////// * includes */ #include "prefix.h" +#include "predicate.h" +#include "distance.h" +#include "for.h" +#include "for_if.h" +#include "rfor.h" +#include "rfor_if.h" +#include "sort.h" +#include "heap_sort.h" +#include "quick_sort.h" +#include "insert_sort.h" +#include "bubble_sort.h" +#include "find.h" +#include "find_if.h" +#include "rfind.h" +#include "rfind_if.h" +#include "binary_find.h" +#include "binary_find_if.h" +#include "walk.h" +#include "rwalk.h" +#include "count.h" +#include "count_if.h" +#include "remove.h" +#include "remove_if.h" +#include "remove_first.h" +#include "remove_first_if.h" -/* ////////////////////////////////////////////////////////////////////////////////////// - * macros - */ - -#ifdef TB_ARCH_ARM_THUMB -# define A @ -# define T -#else -# define A -# define T @ -#endif - -#ifdef TB_ARCH_ELF -# define ELF -# define EXTERN_ASM -#else -# define ELF @ -# define EXTERN_ASM _ -#endif - -/* ////////////////////////////////////////////////////////////////////////////////////// - * arch - */ - -#if defined(TB_ARCH_ARM_v7A) - .arch armv7-a -#elif defined(TB_ARCH_ARM_v7) - .arch armv7 -#elif defined(TB_ARCH_ARM_v6) - .arch armv6 -#elif defined(TB_ARCH_ARM_v5te) - .arch armv5te -#elif defined(TB_ARCH_ARM_v5) - .arch armv5 -#endif - -/* ////////////////////////////////////////////////////////////////////////////////////// - * fpu - */ - -#if defined(TB_ARCH_ARM_NEON) && !defined(TB_ARCH_ARM64) - .fpu neon -#elif defined(TB_ARCH_VFP) - .fpu vfp -#endif - -/* ////////////////////////////////////////////////////////////////////////////////////// - * syntax - */ -#ifndef TB_ARCH_ARM64 - .syntax unified -#endif - -/* ////////////////////////////////////////////////////////////////////////////////////// - * thumb - */ - -// will crash -//T .thumb - -/* ////////////////////////////////////////////////////////////////////////////////////// - * eabi - */ -#ifndef TB_ARCH_ARM64 -ELF .eabi_attribute 25, 1 -#endif - -/* ////////////////////////////////////////////////////////////////////////////////////// - * macros - */ - -/*! function - * - * @code - function func_xxxx, export=1 - ... - bx lr - endfunc - @endcode - */ -.macro function name, export=0 - .macro endfunc -ELF .size \name, . - \name - .endfunc - .purgem endfunc - .endm - - .text -#ifdef TB_ARCH_ARM64 - .align 8 -#else - .align 4 -#endif - .if \export - .global EXTERN_ASM\name -EXTERN_ASM\name: - .endif -ELF .type \name, %function - .func \name -\name: -.endm - -/*! label - * - * @code - label name - xxx - xxx - bl name - @endcode - */ -.macro label name -#ifdef TB_ARCH_ARM64 - .align 8 -#else - .align 4 #endif -\name: -.endm diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.h b/core/pkg/tbox.pkg/inc/tbox/prefix/asm/arm/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/asm/asm.h b/core/pkg/tbox.pkg/inc/tbox/prefix/asm/asm.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/asm/cache.h b/core/pkg/tbox.pkg/inc/tbox/prefix/asm/cache.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.S b/core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.S old mode 100755 new mode 100644 index 574675b8a..6a6f0b5f5 --- a/core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.S +++ b/core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.S @@ -16,16 +16,50 @@ * * Copyright (C) 2009 - 2015, ruki All rights reserved. * - * @author ruki - * @file prefix.S + * @author ruki + * @file binary_find.h + * @ingroup algorithm * */ +#ifndef TB_ALGORITHM_BINARY_FIND_H +#define TB_ALGORITHM_BINARY_FIND_H /* ////////////////////////////////////////////////////////////////////////////////////// * includes */ -#include "asm.h" -#if defined(TB_ARCH_ARM) -# include "arm/prefix.S" -#endif +#include "prefix.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_enter__ + +/* ////////////////////////////////////////////////////////////////////////////////////// + * interfaces + */ + +/*! binary find item + * + * @param iterator the iterator + * @param head the iterator head + * @param tail the iterator tail + * @param item the finded item + * + * @return the iterator itor, return tb_iterator_tail(iterator) if not found + */ +tb_size_t tb_binary_find(tb_iterator_ref_t iterator, tb_size_t head, tb_size_t tail, tb_cpointer_t item); +/*!binary find item for all + * + * @param iterator the iterator + * @param item the finded item + * + * @return the iterator itor, return tb_iterator_tail(iterator) if not found + */ +tb_size_t tb_binary_find_all(tb_iterator_ref_t iterator, tb_cpointer_t item); + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_leave__ +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.h b/core/pkg/tbox.pkg/inc/tbox/prefix/asm/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/assembler.h b/core/pkg/tbox.pkg/inc/tbox/prefix/assembler.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/assert.h b/core/pkg/tbox.pkg/inc/tbox/prefix/assert.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/check.h b/core/pkg/tbox.pkg/inc/tbox/prefix/check.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/compiler.h b/core/pkg/tbox.pkg/inc/tbox/prefix/compiler.h old mode 100755 new mode 100644 index ed7c9df6e..aab9863e5 --- a/core/pkg/tbox.pkg/inc/tbox/prefix/compiler.h +++ b/core/pkg/tbox.pkg/inc/tbox/prefix/compiler.h @@ -303,6 +303,7 @@ # pragma warning(disable:4018) # pragma warning(disable:4197) # pragma warning(disable:4141) +# pragma warning(disable:4996) #else # define TB_COMPILER_STRING "unknown compiler" diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/config.h b/core/pkg/tbox.pkg/inc/tbox/prefix/config.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/cpu.h b/core/pkg/tbox.pkg/inc/tbox/prefix/cpu.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/endian.h b/core/pkg/tbox.pkg/inc/tbox/prefix/endian.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/keyword.h b/core/pkg/tbox.pkg/inc/tbox/prefix/keyword.h old mode 100755 new mode 100644 index 4264229f8..683ec43ff --- a/core/pkg/tbox.pkg/inc/tbox/prefix/keyword.h +++ b/core/pkg/tbox.pkg/inc/tbox/prefix/keyword.h @@ -128,7 +128,7 @@ // small #undef __tb_small__ -#if TB_CONFIG_SMALL +#ifdef TB_CONFIG_SMALL # define __tb_small__ #endif diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/limits.h b/core/pkg/tbox.pkg/inc/tbox/prefix/limits.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/malloc.h b/core/pkg/tbox.pkg/inc/tbox/prefix/malloc.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/packed.h b/core/pkg/tbox.pkg/inc/tbox/prefix/packed.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/prefix.S b/core/pkg/tbox.pkg/inc/tbox/prefix/prefix.S deleted file mode 100755 index c459b12a9..000000000 --- a/core/pkg/tbox.pkg/inc/tbox/prefix/prefix.S +++ /dev/null @@ -1,28 +0,0 @@ -/*!The Treasure Box Library - * - * TBox is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * TBox is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with TBox; - * If not, see http://www.gnu.org/licenses/ - * - * Copyright (C) 2009 - 2015, ruki All rights reserved. - * - * @author ruki - * @file prefix.S - * - */ - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "asm/prefix.S" - diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/prefix.h b/core/pkg/tbox.pkg/inc/tbox/prefix/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/state.h b/core/pkg/tbox.pkg/inc/tbox/prefix/state.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/trace.h b/core/pkg/tbox.pkg/inc/tbox/prefix/trace.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/type.h b/core/pkg/tbox.pkg/inc/tbox/prefix/type.h old mode 100755 new mode 100644 index 0c742b914..d8b08ee95 --- a/core/pkg/tbox.pkg/inc/tbox/prefix/type.h +++ b/core/pkg/tbox.pkg/inc/tbox/prefix/type.h @@ -48,7 +48,7 @@ // check config #if !defined(TB_CONFIG_TYPE_SCALAR_IS_FIXED) \ - && !defined(TB_CONFIG_TYPE_FLOAT) + && !defined(TB_CONFIG_TYPE_HAVE_FLOAT) # define TB_CONFIG_TYPE_SCALAR_IS_FIXED #endif @@ -87,7 +87,9 @@ typedef tb_pointer_t tb_handle_t; #endif // wchar -#ifdef TB_CONFIG_OS_WINDOWS +#ifdef TB_CONFIG_TYPE_HAVE_WCHAR + typedef wchar_t tb_wchar_t; +#elif defined(TB_CONFIG_OS_WINDOWS) # if defined(_WCHAR_T_DEFINED) || defined(_NATIVE_WCHAR_T_DEFINED) typedef wchar_t tb_wchar_t; # else @@ -126,7 +128,7 @@ typedef unsigned long tb_ulong_t; typedef tb_ulong_t tb_size_t; // double -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT typedef float tb_float_t; typedef double tb_double_t; #endif @@ -308,7 +310,7 @@ typedef union __tb_value_t /// async stream tb_async_stream_ref_t astream; -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT /// float tb_float_t f; diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/utils.h b/core/pkg/tbox.pkg/inc/tbox/prefix/utils.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/prefix/version.h b/core/pkg/tbox.pkg/inc/tbox/prefix/version.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/stream/async_stream.h b/core/pkg/tbox.pkg/inc/tbox/stream/async_stream.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/stream/async_transfer.h b/core/pkg/tbox.pkg/inc/tbox/stream/async_transfer.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/stream/filter.h b/core/pkg/tbox.pkg/inc/tbox/stream/filter.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/stream/prefix.h b/core/pkg/tbox.pkg/inc/tbox/stream/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/stream/static_stream.h b/core/pkg/tbox.pkg/inc/tbox/stream/static_stream.h old mode 100755 new mode 100644 index 378690253..0a4952540 --- a/core/pkg/tbox.pkg/inc/tbox/stream/static_stream.h +++ b/core/pkg/tbox.pkg/inc/tbox/stream/static_stream.h @@ -79,7 +79,7 @@ __tb_extern_c_enter__ #endif -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT # ifdef TB_FLOAT_BIGENDIAN # define tb_static_stream_read_double_nbe(stream) tb_static_stream_read_double_bbe(stream) # define tb_static_stream_read_double_nle(stream) tb_static_stream_read_double_ble(stream) @@ -679,7 +679,7 @@ tb_bool_t tb_static_stream_writ_u64_le(tb_static_stream_ref_t stream, */ tb_bool_t tb_static_stream_writ_s64_le(tb_static_stream_ref_t stream, tb_sint64_t val); -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT /*! read float-le number * diff --git a/core/pkg/tbox.pkg/inc/tbox/stream/stream.h b/core/pkg/tbox.pkg/inc/tbox/stream/stream.h old mode 100755 new mode 100644 index cd4a24ecf..1cf448447 --- a/core/pkg/tbox.pkg/inc/tbox/stream/stream.h +++ b/core/pkg/tbox.pkg/inc/tbox/stream/stream.h @@ -145,7 +145,7 @@ __tb_extern_c_enter__ #endif -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT # ifdef TB_FLOAT_BIGENDIAN # define tb_stream_bread_double_nbe(stream) tb_stream_bread_double_bbe(stream) # define tb_stream_bread_double_nle(stream) tb_stream_bread_double_ble(stream) @@ -974,7 +974,7 @@ tb_bool_t tb_stream_bwrit_u64_be(tb_stream_ref_t stream, tb_uint64 */ tb_bool_t tb_stream_bwrit_s64_be(tb_stream_ref_t stream, tb_sint64_t val); -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT /*! read float-le number * diff --git a/core/pkg/tbox.pkg/inc/tbox/stream/transfer.h b/core/pkg/tbox.pkg/inc/tbox/stream/transfer.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/stream/transfer_pool.h b/core/pkg/tbox.pkg/inc/tbox/stream/transfer_pool.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/string/prefix.h b/core/pkg/tbox.pkg/inc/tbox/string/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/string/static_string.h b/core/pkg/tbox.pkg/inc/tbox/string/static_string.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/string/string.h b/core/pkg/tbox.pkg/inc/tbox/string/string.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/tbox.h b/core/pkg/tbox.pkg/inc/tbox/tbox.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/base32.h b/core/pkg/tbox.pkg/inc/tbox/utils/base32.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/base64.h b/core/pkg/tbox.pkg/inc/tbox/utils/base64.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/bits.h b/core/pkg/tbox.pkg/inc/tbox/utils/bits.h old mode 100755 new mode 100644 index 86810f1ad..5ba791c87 --- a/core/pkg/tbox.pkg/inc/tbox/utils/bits.h +++ b/core/pkg/tbox.pkg/inc/tbox/utils/bits.h @@ -122,7 +122,7 @@ __tb_extern_c_enter__ #define tb_bits_set_s64_ne_impl(p, x) tb_bits_set_u64_ne_impl(p, x) // float -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT # define tb_bits_get_float_le(p) tb_bits_get_float_le_inline(p) # define tb_bits_get_float_be(p) tb_bits_get_float_be_inline(p) @@ -747,7 +747,7 @@ static __tb_inline__ tb_size_t tb_bits_cb1_u64_inline(tb_uint64_t x) return (tb_size_t)x; } -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT /* ////////////////////////////////////////////////////////////////////////////////////// * float */ @@ -968,7 +968,7 @@ static __tb_inline__ tb_void_t tb_bits_set_double_lle_inline(tb_byte_t* p, tb_do } -#endif /* TB_CONFIG_TYPE_FLOAT */ +#endif /* TB_CONFIG_TYPE_HAVE_FLOAT */ /* ////////////////////////////////////////////////////////////////////////////////////// * extern diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/crc.h b/core/pkg/tbox.pkg/inc/tbox/utils/crc.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/dump.h b/core/pkg/tbox.pkg/inc/tbox/utils/dump.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_arm.h b/core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_arm.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_gcc.h b/core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_gcc.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_sh4.h b/core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_sh4.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_x86.h b/core/pkg/tbox.pkg/inc/tbox/utils/impl/bits_x86.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/impl/crc_arm.h b/core/pkg/tbox.pkg/inc/tbox/utils/impl/crc_arm.h new file mode 100644 index 000000000..9908bfb5a --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/utils/impl/crc_arm.h @@ -0,0 +1,45 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file crc_arm.h + * + */ +#ifndef TB_UTILS_IMPL_CRC_ARM_H +#define TB_UTILS_IMPL_CRC_ARM_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "../prefix.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * macros + */ +#ifndef TB_ARCH_ARM64 +# define tb_crc32_encode(crc, ib, in, table) tb_crc32_encode_asm(crc, ib, in, table) +#endif + +/* ////////////////////////////////////////////////////////////////////////////////////// + * interfaces + */ +tb_uint32_t tb_crc32_encode_asm(tb_uint32_t crc, tb_byte_t const* ib, tb_size_t in, tb_uint32_t const* table); + + +#endif + diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/impl/prefix.h b/core/pkg/tbox.pkg/inc/tbox/utils/impl/prefix.h new file mode 100644 index 000000000..0f32a6b68 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/utils/impl/prefix.h @@ -0,0 +1,33 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file prefix.h + * + */ +#ifndef TB_UTILS_IMPL_PREFIX_H +#define TB_UTILS_IMPL_PREFIX_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "../prefix.h" + + + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/lock_profiler.h b/core/pkg/tbox.pkg/inc/tbox/utils/lock_profiler.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/md5.h b/core/pkg/tbox.pkg/inc/tbox/utils/md5.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/option.h b/core/pkg/tbox.pkg/inc/tbox/utils/option.h old mode 100755 new mode 100644 index 17742aac5..f1c67cc5e --- a/core/pkg/tbox.pkg/inc/tbox/utils/option.h +++ b/core/pkg/tbox.pkg/inc/tbox/utils/option.h @@ -224,7 +224,7 @@ tb_uint64_t tb_option_item_uint64(tb_option_ref_t option, tb_char_t */ tb_sint64_t tb_option_item_sint64(tb_option_ref_t option, tb_char_t const* name); -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT /*! the option item - float * diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/prefix.h b/core/pkg/tbox.pkg/inc/tbox/utils/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/sha.h b/core/pkg/tbox.pkg/inc/tbox/utils/sha.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/singleton.h b/core/pkg/tbox.pkg/inc/tbox/utils/singleton.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/trace.h b/core/pkg/tbox.pkg/inc/tbox/utils/trace.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/url.h b/core/pkg/tbox.pkg/inc/tbox/utils/url.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/used.h b/core/pkg/tbox.pkg/inc/tbox/utils/used.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/utils/utils.h b/core/pkg/tbox.pkg/inc/tbox/utils/utils.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/xml/node.h b/core/pkg/tbox.pkg/inc/tbox/xml/node.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/xml/prefix.h b/core/pkg/tbox.pkg/inc/tbox/xml/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/xml/reader.h b/core/pkg/tbox.pkg/inc/tbox/xml/reader.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/xml/writer.h b/core/pkg/tbox.pkg/inc/tbox/xml/writer.h old mode 100755 new mode 100644 index 5d1607204..8541ba03e --- a/core/pkg/tbox.pkg/inc/tbox/xml/writer.h +++ b/core/pkg/tbox.pkg/inc/tbox/xml/writer.h @@ -170,7 +170,7 @@ tb_void_t tb_xml_writer_attributes_cstr(tb_xml_writer_ref_t writer */ tb_void_t tb_xml_writer_attributes_format(tb_xml_writer_ref_t writer, tb_char_t const* name, tb_char_t const* format, ...); -#ifdef TB_CONFIG_TYPE_FLOAT +#ifdef TB_CONFIG_TYPE_HAVE_FLOAT /*! writ the xml attribute for float value * * @param writer the xml writer diff --git a/core/pkg/tbox.pkg/inc/tbox/xml/xml.h b/core/pkg/tbox.pkg/inc/tbox/xml/xml.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/zip/gzip.h b/core/pkg/tbox.pkg/inc/tbox/zip/gzip.h new file mode 100644 index 000000000..e614e1a5f --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/zip/gzip.h @@ -0,0 +1,81 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file gzip.h + * @ingroup zip + * + */ +#ifndef TB_ZIP_GZIP_H +#define TB_ZIP_GZIP_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" +#ifdef TB_CONFIG_PACKAGE_HAVE_ZLIB +# include "zlib/zlib.h" +#endif + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_enter__ + +/* ////////////////////////////////////////////////////////////////////////////////////// + * types + */ + +// the gzip zip type +typedef struct __tb_zip_gzip_t +{ + // the zip base + tb_zip_t base; + + // the zstream +#ifdef TB_CONFIG_PACKAGE_HAVE_ZLIB + z_stream zstream; +#endif + +}tb_zip_gzip_t; + +/* ////////////////////////////////////////////////////////////////////////////////////// + * interfaces + */ + +/* init gzip + * + * @param action the action + * + * @return the zip + */ +tb_zip_ref_t tb_zip_gzip_init(tb_size_t action); + +/* exit gzip + * + * @param zip the zip + */ +tb_void_t tb_zip_gzip_exit(tb_zip_ref_t zip); + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_leave__ + +#endif + diff --git a/core/pkg/tbox.pkg/inc/tbox/zip/lzsw.h b/core/pkg/tbox.pkg/inc/tbox/zip/lzsw.h new file mode 100644 index 000000000..d1a28d738 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/zip/lzsw.h @@ -0,0 +1,167 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file lzsw.h + * @ingroup zip + * + */ +#ifndef TB_STREAM_ZSTREAM_LZSW_H +#define TB_STREAM_ZSTREAM_LZSW_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_enter__ + +/* ////////////////////////////////////////////////////////////////////////////////////// + * macros + */ + +// vlc +#define TB_LZSW_VLC_TYPE_FIXED (0) +#define TB_LZSW_VLC_TYPE_GAMMA (1) +#define TB_LZSW_VLC_TYPE_GOLOMB (0) + +// window +//#define TB_LZSW_WINDOW_SIZE_MAX (256) +//#define TB_LZSW_WINDOW_SIZE_MAX (4096) +#define TB_LZSW_WINDOW_SIZE_MAX (65536) +//#define TB_LZSW_WINDOW_SIZE_MAX (8) + +#define TB_LZSW_WINDOW_HASH_FIND (1) +#define TB_LZSW_WINDOW_HASH_MAX (768) // (256 + 256 + 256) + +/* ////////////////////////////////////////////////////////////////////////////////////// + * types + */ + +#if TB_LZSW_WINDOW_HASH_FIND +// the node type +typedef struct __tb_lzsw_node_t +{ + // the signature + tb_byte_t sign[4]; + + // the circle offset + tb_size_t coff; + + // the global address + tb_byte_t const* addr; + + // the next & prev + tb_size_t prev; + tb_size_t next; + +}tb_lzsw_node_t; +#endif + +// the inflate window type +typedef struct __tb_lzsw_inflate_window_t +{ + // the window rage + tb_byte_t const* we; + tb_size_t wn; + + // the window bits + tb_size_t wb; + tb_size_t mb; + +}tb_lzsw_inflate_window_t; + + +// the deflate window type +typedef struct __tb_lzsw_deflate_window_t +{ + // the window rage + tb_byte_t const* we; + tb_size_t wn; + + // the window bits + tb_size_t wb; + tb_size_t mb; + +#if TB_LZSW_WINDOW_HASH_FIND + // the circle base + tb_size_t base; + + // the window hash + tb_pointer_t pool; + tb_size_t hash[TB_LZSW_WINDOW_HASH_MAX]; +#endif + +}tb_lzsw_deflate_window_t; + + +// the lzsw inflate zstream type +typedef struct __tb_lzsw_inflate_stream_filter_zip_t +{ + // the stream base + tb_inflate_stream_filter_zip_t base; + + // the reference to vlc + tb_stream_filter_zip_vlc_t* vlc; + + // the window + tb_lzsw_inflate_window_t window; + +}tb_lzsw_inflate_stream_filter_zip_t; + +// the lzsw deflate zstream type +typedef struct __tb_lzsw_deflate_stream_filter_zip_t +{ + // the stream base + tb_deflate_stream_filter_zip_t base; + + // the reference to vlc + tb_stream_filter_zip_vlc_t* vlc; + + // the window + tb_lzsw_deflate_window_t window; + +}tb_lzsw_deflate_stream_filter_zip_t; + + +// the lzsw zstream type +typedef union __tb_lzsw_stream_filter_zip_t +{ + tb_lzsw_inflate_stream_filter_zip_t infst; + tb_lzsw_deflate_stream_filter_zip_t defst; + +}tb_lzsw_stream_filter_zip_t; + +/* ////////////////////////////////////////////////////////////////////////////////////// + * interfaces + */ + +tb_stream_filter_t* tb_stream_filter_zip_open_lzsw_inflate(tb_lzsw_inflate_stream_filter_zip_t* zst); +tb_stream_filter_t* tb_stream_filter_zip_open_lzsw_deflate(tb_lzsw_deflate_stream_filter_zip_t* zst); +tb_stream_filter_t* tb_stream_filter_zip_open_lzsw(tb_lzsw_stream_filter_zip_t* zst, tb_size_t action); + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_leave__ + +#endif + diff --git a/core/pkg/tbox.pkg/inc/tbox/zip/prefix.h b/core/pkg/tbox.pkg/inc/tbox/zip/prefix.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/zip/rlc.h b/core/pkg/tbox.pkg/inc/tbox/zip/rlc.h new file mode 100644 index 000000000..adaec0ce6 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/zip/rlc.h @@ -0,0 +1,80 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file rlc.h + * @ingroup zip + * + */ +#ifndef TB_ZIP_RLC_H +#define TB_ZIP_RLC_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_enter__ + +/* ////////////////////////////////////////////////////////////////////////////////////// + * macros + */ + +// vlc +#define TB_ZIP_RLC_VLC_TYPE_FIXED (0) +#define TB_ZIP_RLC_VLC_TYPE_GAMMA (1) +#define TB_ZIP_RLC_VLC_TYPE_GOLOMB (0) + +/* ////////////////////////////////////////////////////////////////////////////////////// + * types + */ + +// the rlc zip type +typedef struct __tb_zip_rlc_t +{ + // the zip base + tb_zip_t base; + + // the reference to vlc + tb_zip_vlc_t* vlc; + + // the last byte + tb_byte_t last; + + // the repeat size + tb_size_t repeat; + +}tb_zip_rlc_t; + +/* ////////////////////////////////////////////////////////////////////////////////////// + * interfaces + */ + +tb_zip_ref_t tb_zip_rlc_init(tb_size_t action); +tb_void_t tb_zip_rlc_exit(tb_zip_ref_t zip); + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_leave__ + +#endif + diff --git a/core/pkg/tbox.pkg/inc/tbox/zip/vlc.h b/core/pkg/tbox.pkg/inc/tbox/zip/vlc.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/zip/vlc/prefix.h b/core/pkg/tbox.pkg/inc/tbox/zip/vlc/prefix.h new file mode 100644 index 000000000..4fb7ae046 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/zip/vlc/prefix.h @@ -0,0 +1,31 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file prefix.h + * + */ +#ifndef TB_ZIP_VLC_PREFIX_H +#define TB_ZIP_VLC_PREFIX_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "../prefix.h" + +#endif diff --git a/core/pkg/tbox.pkg/inc/tbox/zip/zip.h b/core/pkg/tbox.pkg/inc/tbox/zip/zip.h old mode 100755 new mode 100644 diff --git a/core/pkg/tbox.pkg/inc/tbox/zip/zlib.h b/core/pkg/tbox.pkg/inc/tbox/zip/zlib.h new file mode 100644 index 000000000..f6b2ae730 --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/zip/zlib.h @@ -0,0 +1,81 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file zlib.h + * @ingroup zip + * + */ +#ifndef TB_ZIP_ZLIB_H +#define TB_ZIP_ZLIB_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" +#ifdef TB_CONFIG_PACKAGE_HAVE_ZLIB +# include "zlib/zlib.h" +#endif + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_enter__ + +/* ////////////////////////////////////////////////////////////////////////////////////// + * types + */ + +// the zlib zip type +typedef struct __tb_zip_zlib_t +{ + // the zip base + tb_zip_t base; + + // the zstream +#ifdef TB_CONFIG_PACKAGE_HAVE_ZLIB + z_stream zstream; +#endif + +}tb_zip_zlib_t; + +/* ////////////////////////////////////////////////////////////////////////////////////// + * interfaces + */ + +/* init zlib + * + * @param action the action + * + * @return the zip + */ +tb_zip_ref_t tb_zip_zlib_init(tb_size_t action); + +/* exit zlib + * + * @param zip the zip + */ +tb_void_t tb_zip_zlib_exit(tb_zip_ref_t zip); + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_leave__ + +#endif + diff --git a/core/pkg/tbox.pkg/inc/tbox/zip/zlibraw.h b/core/pkg/tbox.pkg/inc/tbox/zip/zlibraw.h new file mode 100644 index 000000000..805f7c50b --- /dev/null +++ b/core/pkg/tbox.pkg/inc/tbox/zip/zlibraw.h @@ -0,0 +1,81 @@ +/*!The Treasure Box Library + * + * TBox is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * TBox is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TBox; + * If not, see http://www.gnu.org/licenses/ + * + * Copyright (C) 2009 - 2015, ruki All rights reserved. + * + * @author ruki + * @file zlibraw.h + * @ingroup zip + * + */ +#ifndef TB_ZIP_ZLIBRAW_H +#define TB_ZIP_ZLIBRAW_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "prefix.h" +#ifdef TB_CONFIG_PACKAGE_HAVE_ZLIB +# include "zlib/zlib.h" +#endif + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_enter__ + +/* ////////////////////////////////////////////////////////////////////////////////////// + * types + */ + +// the zlibraw zip type +typedef struct __tb_zip_zlibraw_t +{ + // the zip base + tb_zip_t base; + + // the zstream +#ifdef TB_CONFIG_PACKAGE_HAVE_ZLIB + z_stream zstream; +#endif + +}tb_zip_zlibraw_t; + +/* ////////////////////////////////////////////////////////////////////////////////////// + * interfaces + */ + +/* init zlibraw + * + * @param action the action + * + * @return the zip + */ +tb_zip_ref_t tb_zip_zlibraw_init(tb_size_t action); + +/* exit zlibraw + * + * @param zip the zip + */ +tb_void_t tb_zip_zlibraw_exit(tb_zip_ref_t zip); + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_leave__ + +#endif + diff --git a/core/pkg/tbox.pkg/lib/msvc/x86/tboxd.pdb b/core/pkg/tbox.pkg/lib/msvc/x86/tboxd.pdb deleted file mode 100644 index cac9103b7..000000000 Binary files a/core/pkg/tbox.pkg/lib/msvc/x86/tboxd.pdb and /dev/null differ diff --git a/core/pkg/tbox.pkg/lib/msvc/x86/tboxr.pdb b/core/pkg/tbox.pkg/lib/msvc/x86/tboxr.pdb deleted file mode 100644 index cbff71939..000000000 Binary files a/core/pkg/tbox.pkg/lib/msvc/x86/tboxr.pdb and /dev/null differ diff --git a/core/src/xmake/machine.c b/core/src/xmake/machine.c index 0898f9807..7c53cbd20 100755 --- a/core/src/xmake/machine.c +++ b/core/src/xmake/machine.c @@ -251,7 +251,7 @@ xm_machine_ref_t xm_machine_init() // init host #if defined(TB_CONFIG_OS_WINDOWS) lua_pushstring(impl->lua, "windows"); -#elif defined(TB_CONFIG_OS_MAC) +#elif defined(TB_CONFIG_OS_MACOSX) lua_pushstring(impl->lua, "macosx"); #elif defined(TB_CONFIG_OS_LINUX) lua_pushstring(impl->lua, "linux"); diff --git a/core/src/xmake/os/setenv.c b/core/src/xmake/os/setenv.c index 1dcf125ce..13fb991e2 100755 --- a/core/src/xmake/os/setenv.c +++ b/core/src/xmake/os/setenv.c @@ -81,7 +81,7 @@ tb_int_t xm_os_setenv(lua_State* lua) tb_size_t size = tb_min(p - b, sizeof(data) - 1); // copy it - tb_strlcpy(data, b, size); + tb_strncpy(data, b, size); data[size] = '\0'; // have been not inserted? diff --git a/core/src/xmake/path/translate.c b/core/src/xmake/path/translate.c index 7b53662ea..e1a573032 100755 --- a/core/src/xmake/path/translate.c +++ b/core/src/xmake/path/translate.c @@ -46,8 +46,7 @@ tb_int_t xm_path_translate(lua_State* lua) // copy path tb_char_t data[TB_PATH_MAXN]; - tb_strlcpy(data, path, sizeof(data) - 1); - data[sizeof(data) - 1] = '\0'; + tb_strlcpy(data, path, sizeof(data)); // done path:translate() lua_pushstring(lua, tb_path_translate(data, 0, sizeof(data) - 1)? data : tb_null); diff --git a/xmake/scripts/base/project.lua b/xmake/scripts/base/project.lua index 85f652f2f..c020e7190 100644 --- a/xmake/scripts/base/project.lua +++ b/xmake/scripts/base/project.lua @@ -481,7 +481,7 @@ function project._makeconf_for_target(target_name, target) i = i + 1 if i > 3 then break end end - file:write(string.format("#define %s_VERSION_BUILD %d\n", prefix, os.date("%Y%m%d%H%M", os.time()))) + file:write(string.format("#define %s_VERSION_BUILD %s\n", prefix, os.date("%Y%m%d%H%M", os.time()))) file:write("\n") end -- cgit v1.3.1