├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── NOTICE.md ├── README.md ├── README_zh.md ├── appveyor.yml ├── makefile ├── pkg ├── base.pkg │ └── xmake.lua ├── mbedtls.pkg │ ├── LICENSE.md │ ├── inc │ │ └── mbedtls │ │ │ └── mbedtls.h │ └── xmake.lua ├── mysql.pkg │ ├── inc │ │ └── mysql │ │ │ └── mysql.h │ └── xmake.lua ├── openssl.pkg │ ├── LICENSE.md │ ├── inc │ │ └── openssl │ │ │ └── openssl.h │ └── xmake.lua ├── pcre.pkg │ ├── LICENSE.md │ ├── inc │ │ └── pcre │ │ │ ├── pcre.h │ │ │ ├── pcre_scanner.h │ │ │ ├── pcre_stringpiece.h │ │ │ ├── pcrecpp.h │ │ │ ├── pcrecpparg.h │ │ │ └── pcreposix.h │ ├── lib │ │ └── macosx │ │ │ └── x86_64 │ │ │ ├── libpcre.a │ │ │ └── libpcreposix.a │ └── xmake.lua ├── pcre2.pkg │ ├── LICENSE.md │ ├── inc │ │ └── pcre2 │ │ │ └── pcre2.h │ ├── lib │ │ ├── android │ │ │ ├── arm64-v8a │ │ │ │ └── libpcre2-8.a │ │ │ └── armv7-a │ │ │ │ └── libpcre2-8.a │ │ ├── iphoneos │ │ │ ├── arm64 │ │ │ │ └── libpcre2-8.a │ │ │ ├── armv7 │ │ │ │ └── libpcre2-8.a │ │ │ ├── armv7s │ │ │ │ └── libpcre2-8.a │ │ │ └── universal │ │ │ │ └── libpcre2-8.a │ │ ├── linux │ │ │ ├── i386 │ │ │ │ └── libpcre2-8.a │ │ │ └── x86_64 │ │ │ │ └── libpcre2-8.a │ │ ├── macosx │ │ │ └── x86_64 │ │ │ │ └── libpcre2-8.a │ │ └── windows │ │ │ └── x86 │ │ │ └── pcre2-8.lib │ └── xmake.lua ├── polarssl.pkg │ ├── LICENSE.md │ ├── inc │ │ └── polarssl │ │ │ ├── aes.h │ │ │ ├── aesni.h │ │ │ ├── arc4.h │ │ │ ├── asn1.h │ │ │ ├── asn1write.h │ │ │ ├── base64.h │ │ │ ├── bignum.h │ │ │ ├── blowfish.h │ │ │ ├── bn_mul.h │ │ │ ├── camellia.h │ │ │ ├── certs.h │ │ │ ├── cipher.h │ │ │ ├── cipher_wrap.h │ │ │ ├── compat-1.2.h │ │ │ ├── config.h │ │ │ ├── ctr_drbg.h │ │ │ ├── debug.h │ │ │ ├── des.h │ │ │ ├── dhm.h │ │ │ ├── ecdh.h │ │ │ ├── ecdsa.h │ │ │ ├── ecp.h │ │ │ ├── entropy.h │ │ │ ├── entropy_poll.h │ │ │ ├── error.h │ │ │ ├── gcm.h │ │ │ ├── havege.h │ │ │ ├── hmac_drbg.h │ │ │ ├── md.h │ │ │ ├── md2.h │ │ │ ├── md4.h │ │ │ ├── md5.h │ │ │ ├── md_wrap.h │ │ │ ├── memory.h │ │ │ ├── memory_buffer_alloc.h │ │ │ ├── net.h │ │ │ ├── oid.h │ │ │ ├── openssl.h │ │ │ ├── padlock.h │ │ │ ├── pbkdf2.h │ │ │ ├── pem.h │ │ │ ├── pk.h │ │ │ ├── pk_wrap.h │ │ │ ├── pkcs11.h │ │ │ ├── pkcs12.h │ │ │ ├── pkcs5.h │ │ │ ├── platform.h │ │ │ ├── polarssl.h │ │ │ ├── ripemd160.h │ │ │ ├── rsa.h │ │ │ ├── sha1.h │ │ │ ├── sha256.h │ │ │ ├── sha512.h │ │ │ ├── ssl.h │ │ │ ├── ssl_cache.h │ │ │ ├── ssl_ciphersuites.h │ │ │ ├── threading.h │ │ │ ├── timing.h │ │ │ ├── version.h │ │ │ ├── x509.h │ │ │ ├── x509_crl.h │ │ │ ├── x509_crt.h │ │ │ ├── x509_csr.h │ │ │ └── xtea.h │ ├── lib │ │ ├── android │ │ │ ├── armv5te │ │ │ │ └── libpolarssl.a │ │ │ └── armv6 │ │ │ │ └── libpolarssl.a │ │ ├── iphoneos │ │ │ ├── arm64 │ │ │ │ └── libpolarssl.a │ │ │ ├── armv7 │ │ │ │ └── libpolarssl.a │ │ │ ├── armv7s │ │ │ │ └── libpolarssl.a │ │ │ ├── i386 │ │ │ │ └── libpolarssl.a │ │ │ └── x86_64 │ │ │ │ └── libpolarssl.a │ │ ├── linux │ │ │ └── x86_64 │ │ │ │ └── libpolarssl.a │ │ ├── macosx │ │ │ ├── i386 │ │ │ │ └── libpolarssl.a │ │ │ └── x86_64 │ │ │ │ └── libpolarssl.a │ │ ├── mingw │ │ │ └── i386 │ │ │ │ └── libpolarssl.a │ │ └── windows │ │ │ └── i386 │ │ │ └── polarssl.lib │ └── xmake.lua ├── sqlite3.pkg │ ├── inc │ │ ├── iphoneos │ │ │ └── sqlite3 │ │ │ │ └── sqlite3.h │ │ ├── macosx │ │ │ └── sqlite3 │ │ │ │ └── sqlite3.h │ │ └── sqlite3 │ │ │ ├── sqlite3.h │ │ │ └── sqlite3ext.h │ ├── lib │ │ ├── mingw │ │ │ └── i386 │ │ │ │ └── libsqlite3.a │ │ └── windows │ │ │ └── i386 │ │ │ └── sqlite3.lib │ └── xmake.lua └── zlib.pkg │ ├── LICENSE.md │ ├── inc │ └── zlib │ │ ├── zconf.h │ │ └── zlib.h │ ├── lib │ ├── linux │ │ └── i386 │ │ │ └── libz.a │ ├── mingw │ │ └── i386 │ │ │ └── libz.a │ └── windows │ │ └── i386 │ │ └── z.lib │ └── xmake.lua ├── src ├── demo │ ├── algorithm │ │ ├── find.c │ │ └── sort.c │ ├── asio │ │ └── deprecated │ │ │ ├── aicpc.c │ │ │ ├── aicpd.c │ │ │ ├── aiopc.c │ │ │ ├── aiopd.c │ │ │ ├── dns.c │ │ │ ├── http.c │ │ │ └── httpd.c │ ├── container │ │ ├── bloom_filter.c │ │ ├── circle_queue.c │ │ ├── hash_map.c │ │ ├── hash_set.c │ │ ├── heap.c │ │ ├── list.c │ │ ├── list_entry.c │ │ ├── queue.c │ │ ├── single_list.c │ │ ├── single_list_entry.c │ │ ├── stack.c │ │ └── vector.c │ ├── coroutine │ │ ├── channel.c │ │ ├── echo_client.c │ │ ├── echo_server.c │ │ ├── file_client.c │ │ ├── file_server.c │ │ ├── http_server.c │ │ ├── lock.c │ │ ├── nest.c │ │ ├── semaphore.c │ │ ├── sleep.c │ │ ├── spider.c │ │ ├── stackless │ │ │ ├── echo_client.c │ │ │ ├── echo_server.c │ │ │ ├── file_client.c │ │ │ ├── file_server.c │ │ │ ├── http_server.c │ │ │ ├── lock.c │ │ │ ├── nest.c │ │ │ ├── sleep.c │ │ │ └── switch.c │ │ └── switch.c │ ├── database │ │ └── sql.c │ ├── demo.c │ ├── demo.h │ ├── hash │ │ ├── adler32.c │ │ ├── benchmark.c │ │ ├── crc16.c │ │ ├── crc32.c │ │ ├── crc8.c │ │ ├── djb2.c │ │ ├── fnv32.c │ │ ├── fnv64.c │ │ ├── md5.c │ │ ├── sdbm.c │ │ ├── sha.c │ │ └── uuid.c │ ├── libc │ │ ├── mbstowcs.c │ │ ├── stdlib.c │ │ ├── string.c │ │ ├── time.c │ │ ├── wchar.c │ │ └── wcstombs.c │ ├── libm │ │ ├── double.c │ │ ├── float.c │ │ └── integer.c │ ├── math │ │ ├── fixed.c │ │ └── random.c │ ├── memory │ │ ├── buffer.c │ │ ├── check.c │ │ ├── default_allocator.c │ │ ├── fixed_pool.c │ │ ├── impl │ │ │ └── static_fixed_pool.c │ │ ├── large_pool.c │ │ ├── memops.c │ │ ├── queue_buffer.c │ │ ├── small_allocator.c │ │ ├── static_buffer.c │ │ └── string_pool.c │ ├── micro.c │ ├── micro.lua │ ├── network │ │ ├── cookies.c │ │ ├── dns.c │ │ ├── http.c │ │ ├── hwaddr.c │ │ ├── impl │ │ │ └── date.c │ │ ├── ipaddr.c │ │ ├── ipv4.c │ │ ├── ipv6.c │ │ ├── url.c │ │ └── whois.c │ ├── object │ │ ├── bin.c │ │ ├── bplist.c │ │ ├── dump.c │ │ ├── jcat.c │ │ ├── json.c │ │ ├── xml.c │ │ └── xplist.c │ ├── other │ │ ├── charset.c │ │ └── test.c │ ├── platform │ │ ├── addrinfo.c │ │ ├── atomic.c │ │ ├── atomic64.c │ │ ├── backtrace.c │ │ ├── barrier.c │ │ ├── cache_time.c │ │ ├── context.c │ │ ├── directory.c │ │ ├── environment.c │ │ ├── event.c │ │ ├── exception.c │ │ ├── file.c │ │ ├── hostname.c │ │ ├── ifaddrs.c │ │ ├── lock.c │ │ ├── ltimer.c │ │ ├── path.c │ │ ├── process.c │ │ ├── processor.c │ │ ├── semaphore.c │ │ ├── thread.c │ │ ├── thread_local.c │ │ ├── thread_pool.c │ │ ├── timer.c │ │ └── utils.c │ ├── regex │ │ └── regex.c │ ├── stream │ │ ├── deprecated │ │ │ ├── async_stream.c │ │ │ ├── async_stream │ │ │ │ ├── cache.c │ │ │ │ ├── charset.c │ │ │ │ ├── null.c │ │ │ │ └── zip.c │ │ │ ├── async_transfer.c │ │ │ └── transfer_pool.c │ │ ├── stream.c │ │ └── stream │ │ │ ├── cache.c │ │ │ ├── charset.c │ │ │ ├── null.c │ │ │ └── zip.c │ ├── string │ │ ├── static_string.c │ │ └── string.c │ ├── utils │ │ ├── base32.c │ │ ├── base64.c │ │ ├── bits.c │ │ ├── dump.c │ │ ├── option.c │ │ └── url.c │ ├── xmake.lua │ └── xml │ │ ├── document.c │ │ ├── reader.c │ │ └── writer.c ├── tbox │ ├── algorithm │ │ ├── algorithm.h │ │ ├── binary_find.c │ │ ├── binary_find.h │ │ ├── binary_find_if.c │ │ ├── binary_find_if.h │ │ ├── bubble_sort.c │ │ ├── bubble_sort.h │ │ ├── count.c │ │ ├── count.h │ │ ├── count_if.c │ │ ├── count_if.h │ │ ├── distance.c │ │ ├── distance.h │ │ ├── find.c │ │ ├── find.h │ │ ├── find_if.c │ │ ├── find_if.h │ │ ├── for.h │ │ ├── for_if.h │ │ ├── heap_sort.c │ │ ├── heap_sort.h │ │ ├── insert_sort.c │ │ ├── insert_sort.h │ │ ├── predicate.c │ │ ├── predicate.h │ │ ├── prefix.h │ │ ├── quick_sort.c │ │ ├── quick_sort.h │ │ ├── remove.c │ │ ├── remove.h │ │ ├── remove_first.c │ │ ├── remove_first.h │ │ ├── remove_first_if.c │ │ ├── remove_first_if.h │ │ ├── remove_if.c │ │ ├── remove_if.h │ │ ├── rfind.c │ │ ├── rfind.h │ │ ├── rfind_if.c │ │ ├── rfind_if.h │ │ ├── rfor.h │ │ ├── rfor_if.h │ │ ├── rwalk.c │ │ ├── rwalk.h │ │ ├── sort.c │ │ ├── sort.h │ │ ├── walk.c │ │ └── walk.h │ ├── asio │ │ ├── asio.h │ │ ├── deprecated │ │ │ ├── aice.h │ │ │ ├── aico.c │ │ │ ├── aico.h │ │ │ ├── aicp.c │ │ │ ├── aicp.h │ │ │ ├── aioe.h │ │ │ ├── aioo.c │ │ │ ├── aioo.h │ │ │ ├── aiop.c │ │ │ ├── aiop.h │ │ │ ├── asio.h │ │ │ ├── deprecated.h │ │ │ ├── dns.c │ │ │ ├── dns.h │ │ │ ├── http.c │ │ │ ├── http.h │ │ │ ├── impl │ │ │ │ ├── aicp_aiop.c │ │ │ │ ├── aicp_file.c │ │ │ │ └── prefix.h │ │ │ ├── prefix.h │ │ │ ├── ssl.c │ │ │ └── ssl.h │ │ └── prefix.h │ ├── charset │ │ ├── ascii.c │ │ ├── charset.c │ │ ├── charset.h │ │ ├── gb2312.c │ │ ├── gb2312.g │ │ ├── iso8859.c │ │ ├── prefix.h │ │ ├── ucs2.c │ │ ├── ucs4.c │ │ ├── utf16.c │ │ ├── utf32.c │ │ └── utf8.c │ ├── config.h │ ├── container │ │ ├── bloom_filter.c │ │ ├── bloom_filter.h │ │ ├── circle_queue.c │ │ ├── circle_queue.h │ │ ├── container.h │ │ ├── element.h │ │ ├── element │ │ │ ├── hash.c │ │ │ ├── hash.h │ │ │ ├── long.c │ │ │ ├── mem.c │ │ │ ├── null.c │ │ │ ├── obj.c │ │ │ ├── prefix.h │ │ │ ├── ptr.c │ │ │ ├── size.c │ │ │ ├── str.c │ │ │ ├── true.c │ │ │ ├── uint16.c │ │ │ ├── uint32.c │ │ │ └── uint8.c │ │ ├── hash_map.c │ │ ├── hash_map.h │ │ ├── hash_set.c │ │ ├── hash_set.h │ │ ├── heap.c │ │ ├── heap.h │ │ ├── iterator.c │ │ ├── iterator.h │ │ ├── iterator │ │ │ ├── long.c │ │ │ ├── mem.c │ │ │ ├── prefix.h │ │ │ ├── ptr.c │ │ │ ├── size.c │ │ │ └── str.c │ │ ├── list.c │ │ ├── list.h │ │ ├── list_entry.c │ │ ├── list_entry.h │ │ ├── prefix.h │ │ ├── priority_queue.c │ │ ├── priority_queue.h │ │ ├── queue.c │ │ ├── queue.h │ │ ├── single_list.c │ │ ├── single_list.h │ │ ├── single_list_entry.c │ │ ├── single_list_entry.h │ │ ├── stack.c │ │ ├── stack.h │ │ ├── vector.c │ │ └── vector.h │ ├── coroutine │ │ ├── channel.c │ │ ├── channel.h │ │ ├── coroutine.c │ │ ├── coroutine.h │ │ ├── impl │ │ │ ├── coroutine.c │ │ │ ├── coroutine.h │ │ │ ├── impl.h │ │ │ ├── prefix.h │ │ │ ├── scheduler.c │ │ │ ├── scheduler.h │ │ │ ├── scheduler_io.c │ │ │ ├── scheduler_io.h │ │ │ └── stackless │ │ │ │ ├── coroutine.h │ │ │ │ ├── prefix.h │ │ │ │ ├── scheduler.h │ │ │ │ ├── scheduler_io.c │ │ │ │ ├── scheduler_io.h │ │ │ │ └── stackless.h │ │ ├── lock.c │ │ ├── lock.h │ │ ├── prefix.h │ │ ├── scheduler.c │ │ ├── scheduler.h │ │ ├── semaphore.c │ │ ├── semaphore.h │ │ └── stackless │ │ │ ├── core.h │ │ │ ├── coroutine.c │ │ │ ├── coroutine.h │ │ │ ├── lock.h │ │ │ ├── prefix.h │ │ │ ├── scheduler.c │ │ │ ├── scheduler.h │ │ │ ├── semaphore.h │ │ │ └── stackless.h │ ├── database │ │ ├── database.h │ │ ├── impl │ │ │ ├── mysql.c │ │ │ ├── mysql.h │ │ │ ├── prefix.h │ │ │ ├── sqlite3.c │ │ │ └── sqlite3.h │ │ ├── prefix.h │ │ ├── sql.c │ │ ├── sql.h │ │ ├── value.c │ │ └── value.h │ ├── hash │ │ ├── adler32.c │ │ ├── adler32.h │ │ ├── ap.c │ │ ├── ap.h │ │ ├── arch │ │ │ ├── arm │ │ │ │ └── crc32.S │ │ │ └── crc32.S │ │ ├── bkdr.c │ │ ├── bkdr.h │ │ ├── blizzard.c │ │ ├── blizzard.h │ │ ├── crc16.c │ │ ├── crc16.h │ │ ├── crc32.c │ │ ├── crc32.h │ │ ├── crc8.c │ │ ├── crc8.h │ │ ├── djb2.c │ │ ├── djb2.h │ │ ├── fnv32.c │ │ ├── fnv32.h │ │ ├── fnv64.c │ │ ├── fnv64.h │ │ ├── hash.h │ │ ├── md5.c │ │ ├── md5.h │ │ ├── murmur.c │ │ ├── murmur.h │ │ ├── prefix.h │ │ ├── rs.c │ │ ├── rs.h │ │ ├── sdbm.c │ │ ├── sdbm.h │ │ ├── sha.c │ │ ├── sha.h │ │ ├── uuid.c │ │ └── uuid.h │ ├── libc │ │ ├── impl │ │ │ ├── impl.h │ │ │ ├── libc.c │ │ │ ├── libc.h │ │ │ └── prefix.h │ │ ├── libc.h │ │ ├── misc │ │ │ ├── ctype.h │ │ │ ├── limits.h │ │ │ ├── misc.h │ │ │ ├── prefix.h │ │ │ ├── setjmp.h │ │ │ ├── signal.h │ │ │ ├── stdarg.h │ │ │ └── time │ │ │ │ ├── gmmktime.c │ │ │ │ ├── gmtime.c │ │ │ │ ├── localtime.c │ │ │ │ ├── mktime.c │ │ │ │ ├── prefix.h │ │ │ │ ├── time.c │ │ │ │ ├── time.h │ │ │ │ └── type.h │ │ ├── prefix.h │ │ ├── stdio │ │ │ ├── prefix.h │ │ │ ├── printf.c │ │ │ ├── printf_object.c │ │ │ ├── printf_object.h │ │ │ ├── puts.c │ │ │ ├── snprintf.c │ │ │ ├── sprintf.c │ │ │ ├── stdio.h │ │ │ ├── swprintf.c │ │ │ ├── vsnprintf.c │ │ │ ├── vswprintf.c │ │ │ ├── wprintf.c │ │ │ └── wputs.c │ │ ├── stdlib │ │ │ ├── mbstowcs.c │ │ │ ├── prefix.h │ │ │ ├── random.c │ │ │ ├── stdlib.c │ │ │ ├── stdlib.h │ │ │ └── wcstombs.c │ │ └── string │ │ │ ├── impl │ │ │ ├── arm │ │ │ │ ├── memcmp.c │ │ │ │ ├── memcpy.c │ │ │ │ ├── memmov.c │ │ │ │ ├── memset.c │ │ │ │ ├── prefix.h │ │ │ │ ├── strcmp.c │ │ │ │ ├── strcpy.c │ │ │ │ ├── strlcpy.c │ │ │ │ ├── strlen.c │ │ │ │ ├── strncmp.c │ │ │ │ ├── strncpy.c │ │ │ │ └── strnlen.c │ │ │ ├── prefix.h │ │ │ ├── sh4 │ │ │ │ ├── memcmp.c │ │ │ │ ├── memcpy.c │ │ │ │ ├── memmov.c │ │ │ │ ├── memset.c │ │ │ │ ├── prefix.h │ │ │ │ ├── strcmp.c │ │ │ │ ├── strcpy.c │ │ │ │ ├── strlen.c │ │ │ │ ├── strncmp.c │ │ │ │ ├── strncpy.c │ │ │ │ └── strnlen.c │ │ │ └── x86 │ │ │ │ ├── memcmp.c │ │ │ │ ├── memcpy.c │ │ │ │ ├── memmov.c │ │ │ │ ├── memset.c │ │ │ │ ├── prefix.h │ │ │ │ ├── strcmp.c │ │ │ │ ├── strcpy.c │ │ │ │ ├── strlcpy.c │ │ │ │ ├── strlen.c │ │ │ │ ├── strncmp.c │ │ │ │ ├── strncpy.c │ │ │ │ └── strnlen.c │ │ │ ├── memcmp.c │ │ │ ├── memcpy.c │ │ │ ├── memdup.c │ │ │ ├── memmem.c │ │ │ ├── memmov.c │ │ │ ├── memset.c │ │ │ ├── prefix.h │ │ │ ├── strcat.c │ │ │ ├── strchr.c │ │ │ ├── strcmp.c │ │ │ ├── strcpy.c │ │ │ ├── strdup.c │ │ │ ├── strichr.c │ │ │ ├── stricmp.c │ │ │ ├── string.h │ │ │ ├── strirchr.c │ │ │ ├── strirstr.c │ │ │ ├── stristr.c │ │ │ ├── strlcpy.c │ │ │ ├── strlen.c │ │ │ ├── strncat.c │ │ │ ├── strncmp.c │ │ │ ├── strncpy.c │ │ │ ├── strndup.c │ │ │ ├── strnicmp.c │ │ │ ├── strnirchr.c │ │ │ ├── strnirstr.c │ │ │ ├── strnistr.c │ │ │ ├── strnlen.c │ │ │ ├── strnrchr.c │ │ │ ├── strnrstr.c │ │ │ ├── strnstr.c │ │ │ ├── strrchr.c │ │ │ ├── strrstr.c │ │ │ ├── strstr.c │ │ │ ├── wcscat.c │ │ │ ├── wcschr.c │ │ │ ├── wcscmp.c │ │ │ ├── wcscpy.c │ │ │ ├── wcsdup.c │ │ │ ├── wcsichr.c │ │ │ ├── wcsicmp.c │ │ │ ├── wcsirchr.c │ │ │ ├── wcsirstr.c │ │ │ ├── wcsistr.c │ │ │ ├── wcslcpy.c │ │ │ ├── wcslen.c │ │ │ ├── wcsncat.c │ │ │ ├── wcsncmp.c │ │ │ ├── wcsncpy.c │ │ │ ├── wcsndup.c │ │ │ ├── wcsnicmp.c │ │ │ ├── wcsnirchr.c │ │ │ ├── wcsnirstr.c │ │ │ ├── wcsnlen.c │ │ │ ├── wcsnrchr.c │ │ │ ├── wcsnrstr.c │ │ │ ├── wcsrchr.c │ │ │ ├── wcsrstr.c │ │ │ └── wcsstr.c │ ├── libm │ │ ├── acos.c │ │ ├── acosf.c │ │ ├── asin.c │ │ ├── asinf.c │ │ ├── atan.c │ │ ├── atan2.c │ │ ├── atan2f.c │ │ ├── atanf.c │ │ ├── ceil.h │ │ ├── cos.c │ │ ├── cosf.c │ │ ├── exp.c │ │ ├── exp1.c │ │ ├── exp1f.c │ │ ├── expf.c │ │ ├── expi.c │ │ ├── expif.c │ │ ├── fabs.h │ │ ├── floor.h │ │ ├── fmod.c │ │ ├── fmodf.c │ │ ├── idivi8.c │ │ ├── ilog2i.c │ │ ├── impl │ │ │ ├── impl.h │ │ │ ├── libm.c │ │ │ ├── libm.h │ │ │ └── prefix.h │ │ ├── inf.h │ │ ├── isfin.c │ │ ├── isfinf.c │ │ ├── isinf.c │ │ ├── isinff.c │ │ ├── isnan.c │ │ ├── isnanf.c │ │ ├── isqrti.c │ │ ├── isqrti64.c │ │ ├── libm.h │ │ ├── log2.c │ │ ├── log2f.c │ │ ├── maf.h │ │ ├── math.h │ │ ├── mif.h │ │ ├── nan.h │ │ ├── pi.h │ │ ├── pow.c │ │ ├── powf.c │ │ ├── prefix.h │ │ ├── round.h │ │ ├── sin.c │ │ ├── sincos.c │ │ ├── sincosf.c │ │ ├── sinf.c │ │ ├── sqrt.c │ │ ├── sqrtf.c │ │ ├── tan.c │ │ └── tanf.c │ ├── math │ │ ├── fixed.h │ │ ├── fixed16.c │ │ ├── fixed16.h │ │ ├── fixed30.h │ │ ├── fixed6.h │ │ ├── impl │ │ │ ├── fixed16_arm.h │ │ │ ├── fixed30_arm.h │ │ │ ├── impl.h │ │ │ ├── math.c │ │ │ ├── math.h │ │ │ └── prefix.h │ │ ├── int32.c │ │ ├── int32.h │ │ ├── math.h │ │ ├── prefix.h │ │ └── random │ │ │ ├── linear.c │ │ │ ├── linear.h │ │ │ ├── prefix.h │ │ │ ├── random.c │ │ │ └── random.h │ ├── memory │ │ ├── allocator.c │ │ ├── allocator.h │ │ ├── buffer.c │ │ ├── buffer.h │ │ ├── default_allocator.c │ │ ├── default_allocator.h │ │ ├── fixed_pool.c │ │ ├── fixed_pool.h │ │ ├── impl │ │ │ ├── impl.h │ │ │ ├── memory.c │ │ │ ├── memory.h │ │ │ ├── native_large_allocator.c │ │ │ ├── native_large_allocator.h │ │ │ ├── prefix.c │ │ │ ├── prefix.h │ │ │ ├── static_fixed_pool.c │ │ │ ├── static_fixed_pool.h │ │ │ ├── static_large_allocator.c │ │ │ └── static_large_allocator.h │ │ ├── large_allocator.c │ │ ├── large_allocator.h │ │ ├── memory.h │ │ ├── native_allocator.c │ │ ├── native_allocator.h │ │ ├── prefix.h │ │ ├── queue_buffer.c │ │ ├── queue_buffer.h │ │ ├── small_allocator.c │ │ ├── small_allocator.h │ │ ├── static_allocator.c │ │ ├── static_allocator.h │ │ ├── static_buffer.c │ │ ├── static_buffer.h │ │ ├── string_pool.c │ │ └── string_pool.h │ ├── micro.lua │ ├── network │ │ ├── cookies.c │ │ ├── cookies.h │ │ ├── dns │ │ │ ├── cache.c │ │ │ ├── cache.h │ │ │ ├── dns.h │ │ │ ├── looker.c │ │ │ ├── looker.h │ │ │ ├── prefix.h │ │ │ ├── server.c │ │ │ └── server.h │ │ ├── http.c │ │ ├── http.h │ │ ├── hwaddr.c │ │ ├── hwaddr.h │ │ ├── impl │ │ │ ├── http │ │ │ │ ├── date.c │ │ │ │ ├── date.h │ │ │ │ ├── method.c │ │ │ │ ├── method.h │ │ │ │ ├── option.c │ │ │ │ ├── option.h │ │ │ │ ├── prefix.h │ │ │ │ ├── status.c │ │ │ │ └── status.h │ │ │ ├── impl.h │ │ │ ├── network.c │ │ │ ├── network.h │ │ │ ├── prefix.h │ │ │ └── ssl │ │ │ │ ├── mbedtls.c │ │ │ │ ├── openssl.c │ │ │ │ ├── polarssl.c │ │ │ │ └── prefix.h │ │ ├── ipaddr.c │ │ ├── ipaddr.h │ │ ├── ipv4.c │ │ ├── ipv4.h │ │ ├── ipv6.c │ │ ├── ipv6.h │ │ ├── network.h │ │ ├── prefix.h │ │ ├── ssl.h │ │ ├── url.c │ │ └── url.h │ ├── object │ │ ├── array.c │ │ ├── array.h │ │ ├── boolean.c │ │ ├── boolean.h │ │ ├── data.c │ │ ├── data.h │ │ ├── date.c │ │ ├── date.h │ │ ├── deprecated │ │ │ ├── array.h │ │ │ ├── boolean.h │ │ │ ├── data.h │ │ │ ├── date.h │ │ │ ├── deprecated.h │ │ │ ├── dictionary.h │ │ │ ├── null.h │ │ │ ├── number.h │ │ │ ├── prefix.h │ │ │ └── string.h │ │ ├── dictionary.c │ │ ├── dictionary.h │ │ ├── impl │ │ │ ├── impl.h │ │ │ ├── object.c │ │ │ ├── object.h │ │ │ ├── prefix.h │ │ │ ├── reader │ │ │ │ ├── bin.c │ │ │ │ ├── bin.h │ │ │ │ ├── bplist.c │ │ │ │ ├── bplist.h │ │ │ │ ├── json.c │ │ │ │ ├── json.h │ │ │ │ ├── prefix.h │ │ │ │ ├── reader.c │ │ │ │ ├── reader.h │ │ │ │ ├── xml.c │ │ │ │ ├── xml.h │ │ │ │ ├── xplist.c │ │ │ │ └── xplist.h │ │ │ └── writer │ │ │ │ ├── bin.c │ │ │ │ ├── bin.h │ │ │ │ ├── bplist.c │ │ │ │ ├── bplist.h │ │ │ │ ├── json.c │ │ │ │ ├── json.h │ │ │ │ ├── prefix.h │ │ │ │ ├── writer.c │ │ │ │ ├── writer.h │ │ │ │ ├── xml.c │ │ │ │ ├── xml.h │ │ │ │ ├── xplist.c │ │ │ │ └── xplist.h │ │ ├── null.c │ │ ├── null.h │ │ ├── number.c │ │ ├── number.h │ │ ├── object.c │ │ ├── object.h │ │ ├── prefix.h │ │ ├── string.c │ │ └── string.h │ ├── platform │ │ ├── addrinfo.c │ │ ├── addrinfo.h │ │ ├── android │ │ │ ├── android.c │ │ │ ├── android.h │ │ │ ├── backtrace.c │ │ │ ├── directory.c │ │ │ ├── dns.c │ │ │ ├── prefix.h │ │ │ └── print.c │ │ ├── arch │ │ │ ├── arm │ │ │ │ ├── context.S │ │ │ │ ├── frame.h │ │ │ │ └── prefix.h │ │ │ ├── arm64 │ │ │ │ ├── context.S │ │ │ │ └── prefix.h │ │ │ ├── atomic.h │ │ │ ├── barrier.h │ │ │ ├── context.S │ │ │ ├── frame.h │ │ │ ├── mips │ │ │ │ ├── context.S │ │ │ │ └── prefix.h │ │ │ ├── prefix.h │ │ │ ├── x64 │ │ │ │ ├── atomic.h │ │ │ │ ├── barrier.h │ │ │ │ ├── context.S │ │ │ │ ├── context.asm │ │ │ │ ├── frame.h │ │ │ │ └── prefix.h │ │ │ └── x86 │ │ │ │ ├── atomic.h │ │ │ │ ├── barrier.h │ │ │ │ ├── context.S │ │ │ │ ├── context.asm │ │ │ │ ├── frame.h │ │ │ │ └── prefix.h │ │ ├── atomic.h │ │ ├── atomic64.c │ │ ├── atomic64.h │ │ ├── backtrace.c │ │ ├── backtrace.h │ │ ├── barrier.h │ │ ├── cache_time.c │ │ ├── cache_time.h │ │ ├── compiler │ │ │ ├── gcc │ │ │ │ ├── atomic.h │ │ │ │ ├── atomic64.h │ │ │ │ ├── barrier.h │ │ │ │ └── prefix.h │ │ │ └── prefix.h │ │ ├── context.c │ │ ├── context.h │ │ ├── deprecated │ │ │ ├── aicp.c │ │ │ ├── aicp_iocp.c │ │ │ ├── aioo.c │ │ │ ├── aioo_poll.c │ │ │ ├── aioo_select.c │ │ │ ├── aiop.c │ │ │ ├── aiop_epoll.c │ │ │ ├── aiop_kqueue.c │ │ │ ├── aiop_poll.c │ │ │ ├── aiop_select.c │ │ │ ├── deprecated.h │ │ │ └── prefix.h │ │ ├── directory.c │ │ ├── directory.h │ │ ├── dynamic.c │ │ ├── dynamic.h │ │ ├── environment.c │ │ ├── environment.h │ │ ├── event.c │ │ ├── event.h │ │ ├── exception.c │ │ ├── exception.h │ │ ├── file.c │ │ ├── file.h │ │ ├── hostname.c │ │ ├── hostname.h │ │ ├── ifaddrs.c │ │ ├── ifaddrs.h │ │ ├── impl │ │ │ ├── dns.c │ │ │ ├── dns.h │ │ │ ├── exception.h │ │ │ ├── impl.h │ │ │ ├── platform.c │ │ │ ├── platform.h │ │ │ ├── prefix.h │ │ │ ├── socket.h │ │ │ └── thread_local.h │ │ ├── libc │ │ │ ├── backtrace.c │ │ │ ├── environment.c │ │ │ ├── exception.c │ │ │ ├── exception.h │ │ │ ├── memory.c │ │ │ ├── prefix.h │ │ │ ├── print.c │ │ │ └── random.c │ │ ├── linux │ │ │ ├── ifaddrs.c │ │ │ ├── ifaddrs2.c │ │ │ ├── poller_epoll.c │ │ │ └── prefix.h │ │ ├── ltimer.c │ │ ├── ltimer.h │ │ ├── mach │ │ │ ├── barrier.h │ │ │ ├── dns.c │ │ │ ├── ios │ │ │ │ ├── directory.m │ │ │ │ ├── prefix.h │ │ │ │ └── print.c │ │ │ ├── poller_kqueue.c │ │ │ ├── prefix.h │ │ │ └── semaphore.c │ │ ├── memory.c │ │ ├── memory.h │ │ ├── mutex.c │ │ ├── mutex.h │ │ ├── page.c │ │ ├── page.h │ │ ├── path.c │ │ ├── path.h │ │ ├── platform.h │ │ ├── poller.c │ │ ├── poller.h │ │ ├── posix │ │ │ ├── addrinfo.c │ │ │ ├── context.c │ │ │ ├── directory.c │ │ │ ├── dynamic.c │ │ │ ├── event.c │ │ │ ├── file.c │ │ │ ├── hostname.c │ │ │ ├── ifaddrs.c │ │ │ ├── mutex.c │ │ │ ├── page.c │ │ │ ├── poller_poll.c │ │ │ ├── poller_select.c │ │ │ ├── prefix.h │ │ │ ├── process.c │ │ │ ├── processor.c │ │ │ ├── regex.c │ │ │ ├── sched.c │ │ │ ├── semaphore.c │ │ │ ├── sockaddr.h │ │ │ ├── socket.c │ │ │ ├── socket_poll.c │ │ │ ├── socket_select.c │ │ │ ├── thread.c │ │ │ ├── thread_local.c │ │ │ └── time.c │ │ ├── prefix.h │ │ ├── print.c │ │ ├── print.h │ │ ├── process.c │ │ ├── process.h │ │ ├── processor.c │ │ ├── processor.h │ │ ├── sched.c │ │ ├── sched.h │ │ ├── semaphore.c │ │ ├── semaphore.h │ │ ├── socket.c │ │ ├── socket.h │ │ ├── spinlock.h │ │ ├── systemv │ │ │ ├── prefix.h │ │ │ └── semaphore.c │ │ ├── thread.c │ │ ├── thread.h │ │ ├── thread_local.c │ │ ├── thread_local.h │ │ ├── thread_pool.c │ │ ├── thread_pool.h │ │ ├── time.c │ │ ├── time.h │ │ ├── timer.c │ │ ├── timer.h │ │ ├── unix │ │ │ ├── dns.c │ │ │ ├── prefix.h │ │ │ └── syscall.h │ │ └── windows │ │ │ ├── addrinfo.c │ │ │ ├── atomic.h │ │ │ ├── atomic64.h │ │ │ ├── backtrace.c │ │ │ ├── barrier.h │ │ │ ├── context.c │ │ │ ├── directory.c │ │ │ ├── dns.c │ │ │ ├── dynamic.c │ │ │ ├── environment.c │ │ │ ├── event.c │ │ │ ├── exception.c │ │ │ ├── exception.h │ │ │ ├── file.c │ │ │ ├── hostname.c │ │ │ ├── ifaddrs.c │ │ │ ├── interface │ │ │ ├── dbghelp.c │ │ │ ├── dbghelp.h │ │ │ ├── interface.c │ │ │ ├── interface.h │ │ │ ├── iphlpapi.c │ │ │ ├── iphlpapi.h │ │ │ ├── kernel32.c │ │ │ ├── kernel32.h │ │ │ ├── mswsock.c │ │ │ ├── mswsock.h │ │ │ ├── ole32.c │ │ │ ├── ole32.h │ │ │ ├── prefix.h │ │ │ ├── shell32.c │ │ │ ├── shell32.h │ │ │ ├── user32.c │ │ │ ├── user32.h │ │ │ ├── ws2_32.c │ │ │ └── ws2_32.h │ │ │ ├── memory.c │ │ │ ├── mutex.c │ │ │ ├── ntstatus.h │ │ │ ├── page.c │ │ │ ├── prefix.h │ │ │ ├── print.c │ │ │ ├── process.c │ │ │ ├── processor.c │ │ │ ├── sched.c │ │ │ ├── semaphore.c │ │ │ ├── socket.c │ │ │ ├── socket_pool.c │ │ │ ├── socket_pool.h │ │ │ ├── thread.c │ │ │ ├── thread_local.c │ │ │ ├── time.c │ │ │ └── uuid.c │ ├── prefix.h │ ├── prefix │ │ ├── abort.h │ │ ├── arch.h │ │ ├── arm │ │ │ └── prefix.S │ │ ├── arm64 │ │ │ └── prefix.S │ │ ├── assembler.h │ │ ├── assert.h │ │ ├── cache.h │ │ ├── check.h │ │ ├── compiler.h │ │ ├── config.h │ │ ├── cpu.h │ │ ├── endian.h │ │ ├── keyword.h │ │ ├── limits.h │ │ ├── malloc.h │ │ ├── mips │ │ │ └── prefix.S │ │ ├── packed.h │ │ ├── prefix.S │ │ ├── prefix.h │ │ ├── state.c │ │ ├── state.h │ │ ├── trace.h │ │ ├── type.h │ │ ├── utils.h │ │ ├── version.h │ │ ├── x64 │ │ │ └── prefix.S │ │ └── x86 │ │ │ └── prefix.S │ ├── regex │ │ ├── impl │ │ │ ├── impl.h │ │ │ ├── pcre.c │ │ │ ├── pcre2.c │ │ │ └── prefix.h │ │ ├── prefix.h │ │ ├── regex.c │ │ └── regex.h │ ├── stream │ │ ├── deprecated │ │ │ ├── async_stream.c │ │ │ ├── async_stream.h │ │ │ ├── async_transfer.c │ │ │ ├── async_transfer.h │ │ │ ├── deprecated.h │ │ │ ├── impl │ │ │ │ ├── async_stream │ │ │ │ │ ├── data.c │ │ │ │ │ ├── file.c │ │ │ │ │ ├── filter.c │ │ │ │ │ ├── http.c │ │ │ │ │ ├── prefix.c │ │ │ │ │ ├── prefix.h │ │ │ │ │ └── sock.c │ │ │ │ └── prefix.h │ │ │ ├── prefix.h │ │ │ ├── transfer_pool.c │ │ │ └── transfer_pool.h │ │ ├── filter.c │ │ ├── filter.h │ │ ├── impl │ │ │ ├── filter.h │ │ │ ├── filter │ │ │ │ ├── cache.c │ │ │ │ ├── charset.c │ │ │ │ ├── chunked.c │ │ │ │ ├── prefix.h │ │ │ │ └── zip.c │ │ │ ├── prefix.h │ │ │ ├── stream.h │ │ │ └── stream │ │ │ │ ├── data.c │ │ │ │ ├── file.c │ │ │ │ ├── filter.c │ │ │ │ ├── http.c │ │ │ │ ├── prefix.h │ │ │ │ └── sock.c │ │ ├── prefix.h │ │ ├── static_stream.c │ │ ├── static_stream.h │ │ ├── stream.c │ │ ├── stream.h │ │ ├── transfer.c │ │ └── transfer.h │ ├── string │ │ ├── prefix.h │ │ ├── static_string.c │ │ ├── static_string.h │ │ ├── string.c │ │ └── string.h │ ├── tbox.c │ ├── tbox.h │ ├── utils │ │ ├── base32.c │ │ ├── base32.h │ │ ├── base64.c │ │ ├── base64.h │ │ ├── bits.c │ │ ├── bits.h │ │ ├── dump.c │ │ ├── dump.h │ │ ├── impl │ │ │ ├── bits_arm.h │ │ │ ├── bits_gcc.h │ │ │ ├── bits_sh4.h │ │ │ ├── bits_x86.h │ │ │ ├── impl.h │ │ │ └── prefix.h │ │ ├── lock_profiler.c │ │ ├── lock_profiler.h │ │ ├── option.c │ │ ├── option.h │ │ ├── prefix.h │ │ ├── singleton.c │ │ ├── singleton.h │ │ ├── trace.c │ │ ├── trace.h │ │ ├── url.c │ │ ├── url.h │ │ ├── used.c │ │ ├── used.h │ │ └── utils.h │ ├── xmake.lua │ ├── xml │ │ ├── node.c │ │ ├── node.h │ │ ├── prefix.h │ │ ├── reader.c │ │ ├── reader.h │ │ ├── writer.c │ │ ├── writer.h │ │ └── xml.h │ └── zip │ │ ├── gzip.c │ │ ├── gzip.h │ │ ├── prefix.h │ │ ├── zip.c │ │ ├── zip.h │ │ ├── zlib.c │ │ ├── zlib.h │ │ ├── zlibraw.c │ │ └── zlibraw.h └── xmake.lua └── xmake.lua /.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.b 3 | *.o 4 | *.exe 5 | *.obj 6 | *.dll 7 | *.lib 8 | *.out 9 | *.suo 10 | *~ 11 | *.swp 12 | *.swo 13 | *.bak 14 | *.orig 15 | *.pdb 16 | *.idb 17 | *.ilk 18 | *.gcov 19 | *.gcda 20 | *.gcno 21 | *.stackdump 22 | *.manifest 23 | .ccache 24 | .xmake 25 | build 26 | .svn 27 | .DS_Store 28 | cscope.* 29 | gmon.out 30 | tags 31 | Doxyfile 32 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | os: 2 | - Visual Studio 2015 3 | - Visual Studio 2013 4 | 5 | platform: 6 | - Win32 7 | - Win64 8 | 9 | before_build: 10 | - cmd: git clone --branch=dev https://github.com/waruqi/xmake.git waruqi\xmake 11 | - cmd: cd waruqi\xmake 12 | - cmd: call install.bat noinput 13 | - cmd: cd ..\.. 14 | 15 | build_script: 16 | - cmd: xmake 17 | - cmd: xmake p 18 | - cmd: if %platform%==Win32 xmake f -m debug 19 | - cmd: if %platform%==Win64 xmake f -m debug -a x64 20 | - cmd: xmake -r 21 | 22 | test_script: 23 | - cmd: xmake r demo 24 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | all: build/.xmake/bin/xmake .null 2 | build/.xmake/bin/xmake 3 | 4 | clean: build/.xmake/bin/xmake .null 5 | build/.xmake/bin/xmake clean 6 | 7 | distclean: build/.xmake/bin/xmake .null 8 | build/.xmake/bin/xmake clean --all 9 | 10 | rebuild: build/.xmake/bin/xmake .null 11 | build/.xmake/bin/xmake --rebuild 12 | 13 | install: build/.xmake/bin/xmake .null 14 | build/.xmake/bin/xmake install 15 | 16 | uninstall: build/.xmake/bin/xmake .null 17 | build/.xmake/bin/xmake uninstall 18 | 19 | build/.xmake/bin/xmake: 20 | if [ ! -d build/.xmake ]; then mkdir -p build/.xmake; fi 21 | if [ ! -f build/.xmake/xmake.zip ]; then wget https://coding.net/u/waruqi/p/xmake/git/archive/master -O build/.xmake/xmake.zip; fi 22 | if [ ! -f build/.xmake/xmake.zip ]; then wget https://github.com/waruqi/xmake/archive/master.zip -O build/.xmake/xmake.zip; fi 23 | cd build/.xmake; unzip xmake.zip; cd xmake-master; ./install `pwd`/.. 24 | 25 | .PHONY:all clean distclean rebuild install uninstall .null 26 | .null: 27 | 28 | -------------------------------------------------------------------------------- /pkg/base.pkg/xmake.lua: -------------------------------------------------------------------------------- 1 | -- the base package 2 | option("base") 3 | 4 | -- set category 5 | set_category("package") 6 | 7 | -- add links 8 | if is_os("windows") then add_links("ws2_32") 9 | elseif is_os("android") then add_links("m", "c") 10 | else add_links("pthread", "dl", "m", "c") end 11 | 12 | -------------------------------------------------------------------------------- /pkg/mbedtls.pkg/inc/mbedtls/mbedtls.h: -------------------------------------------------------------------------------- 1 | #ifndef PKG_MBEDTLS_H 2 | #define PKG_MBEDTLS_H 3 | 4 | /* ////////////////////////////////////////////////////////////////////////////////////// 5 | * includes 6 | */ 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /pkg/mbedtls.pkg/xmake.lua: -------------------------------------------------------------------------------- 1 | -- add mbedtls package 2 | option("mbedtls") 3 | 4 | -- show menu 5 | set_showmenu(true) 6 | 7 | -- set category 8 | set_category("package") 9 | 10 | -- set description 11 | set_description("The mbedtls package") 12 | 13 | -- add defines to config.h if checking ok 14 | add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_MBEDTLS") 15 | 16 | -- add links for checking 17 | add_links("mbedtls", "mbedcrypto", "mbedx509") 18 | 19 | -- add link directories 20 | add_linkdirs("lib/$(plat)/$(arch)") 21 | 22 | -- add c includes for checking 23 | add_cincludes("mbedtls/mbedtls.h") 24 | 25 | -- add include directories 26 | add_includedirs("inc/$(plat)", "inc") 27 | 28 | -- add c functions 29 | add_cfuncs("mbedtls_ssl_setup") 30 | -------------------------------------------------------------------------------- /pkg/mysql.pkg/inc/mysql/mysql.h: -------------------------------------------------------------------------------- 1 | #ifndef PKG_MYSQL_H 2 | #define PKG_MYSQL_H 3 | 4 | /* ////////////////////////////////////////////////////////////////////////////////////// 5 | * includes 6 | */ 7 | #include 8 | #include 9 | #include 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /pkg/mysql.pkg/xmake.lua: -------------------------------------------------------------------------------- 1 | -- the mysql package 2 | option("mysql") 3 | 4 | -- show menu 5 | set_showmenu(true) 6 | 7 | -- set category 8 | set_category("package") 9 | 10 | -- set description 11 | set_description("The mysql package") 12 | 13 | -- add defines to config.h if checking ok 14 | add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_MYSQL") 15 | 16 | -- add links for checking 17 | add_links("mysqlclient") 18 | 19 | -- add link directories 20 | add_linkdirs("lib/$(plat)/$(arch)") 21 | 22 | -- add c includes for checking 23 | add_cincludes("mysql/mysql.h") 24 | 25 | -- add include directories 26 | add_includedirs("inc/$(plat)", "inc") 27 | 28 | 29 | -------------------------------------------------------------------------------- /pkg/openssl.pkg/inc/openssl/openssl.h: -------------------------------------------------------------------------------- 1 | #ifndef PKG_OPENSSL_H 2 | #define PKG_OPENSSL_H 3 | 4 | /* ////////////////////////////////////////////////////////////////////////////////////// 5 | * includes 6 | */ 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /pkg/openssl.pkg/xmake.lua: -------------------------------------------------------------------------------- 1 | -- the openssl package 2 | option("openssl") 3 | 4 | -- show menu 5 | set_showmenu(true) 6 | 7 | -- set category 8 | set_category("package") 9 | 10 | -- set description 11 | set_description("The openssl package") 12 | 13 | -- add defines to config.h if checking ok 14 | add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_OPENSSL") 15 | 16 | -- add links for checking 17 | add_links("ssl", "crypto") 18 | 19 | -- add link directories 20 | add_linkdirs("lib/$(plat)/$(arch)") 21 | 22 | -- add c includes for checking 23 | add_cincludes("openssl/openssl.h") 24 | 25 | -- add include directories 26 | add_includedirs("inc/$(plat)", "inc") 27 | 28 | -- add c functions 29 | add_cfuncs("SSL_new") 30 | -------------------------------------------------------------------------------- /pkg/pcre.pkg/lib/macosx/x86_64/libpcre.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/pcre.pkg/lib/macosx/x86_64/libpcre.a -------------------------------------------------------------------------------- /pkg/pcre.pkg/lib/macosx/x86_64/libpcreposix.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/pcre.pkg/lib/macosx/x86_64/libpcreposix.a -------------------------------------------------------------------------------- /pkg/pcre.pkg/xmake.lua: -------------------------------------------------------------------------------- 1 | -- add pcre package 2 | option("pcre") 3 | 4 | -- show menu 5 | set_showmenu(true) 6 | 7 | -- set category 8 | set_category("package") 9 | 10 | -- set description 11 | set_description("The pcre package") 12 | 13 | -- add defines to config.h if checking ok 14 | add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_PCRE") 15 | 16 | -- add links for checking 17 | add_links("pcre") 18 | 19 | -- add link directories 20 | add_linkdirs("lib/$(plat)/$(arch)") 21 | 22 | -- add c includes for checking 23 | add_cincludes("pcre/pcre.h") 24 | 25 | -- add include directories 26 | add_includedirs("inc/$(plat)", "inc") 27 | 28 | -- add c functions 29 | add_cfuncs("pcre_compile") 30 | -------------------------------------------------------------------------------- /pkg/pcre2.pkg/lib/android/arm64-v8a/libpcre2-8.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/pcre2.pkg/lib/android/arm64-v8a/libpcre2-8.a -------------------------------------------------------------------------------- /pkg/pcre2.pkg/lib/android/armv7-a/libpcre2-8.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/pcre2.pkg/lib/android/armv7-a/libpcre2-8.a -------------------------------------------------------------------------------- /pkg/pcre2.pkg/lib/iphoneos/arm64/libpcre2-8.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/pcre2.pkg/lib/iphoneos/arm64/libpcre2-8.a -------------------------------------------------------------------------------- /pkg/pcre2.pkg/lib/iphoneos/armv7/libpcre2-8.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/pcre2.pkg/lib/iphoneos/armv7/libpcre2-8.a -------------------------------------------------------------------------------- /pkg/pcre2.pkg/lib/iphoneos/armv7s/libpcre2-8.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/pcre2.pkg/lib/iphoneos/armv7s/libpcre2-8.a -------------------------------------------------------------------------------- /pkg/pcre2.pkg/lib/iphoneos/universal/libpcre2-8.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/pcre2.pkg/lib/iphoneos/universal/libpcre2-8.a -------------------------------------------------------------------------------- /pkg/pcre2.pkg/lib/linux/i386/libpcre2-8.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/pcre2.pkg/lib/linux/i386/libpcre2-8.a -------------------------------------------------------------------------------- /pkg/pcre2.pkg/lib/linux/x86_64/libpcre2-8.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/pcre2.pkg/lib/linux/x86_64/libpcre2-8.a -------------------------------------------------------------------------------- /pkg/pcre2.pkg/lib/macosx/x86_64/libpcre2-8.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/pcre2.pkg/lib/macosx/x86_64/libpcre2-8.a -------------------------------------------------------------------------------- /pkg/pcre2.pkg/lib/windows/x86/pcre2-8.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/pcre2.pkg/lib/windows/x86/pcre2-8.lib -------------------------------------------------------------------------------- /pkg/pcre2.pkg/xmake.lua: -------------------------------------------------------------------------------- 1 | -- add pcre2 package 2 | option("pcre2") 3 | 4 | -- show menu 5 | set_showmenu(true) 6 | 7 | -- set category 8 | set_category("package") 9 | 10 | -- set description 11 | set_description("The pcre2 package") 12 | 13 | -- add defines to config.h if checking ok 14 | add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_PCRE2") 15 | 16 | -- add defines for checking 17 | add_defines("PCRE2_CODE_UNIT_WIDTH=8") 18 | 19 | -- add links for checking 20 | add_links("pcre2-8") 21 | 22 | -- add link directories 23 | add_linkdirs("lib/$(plat)/$(arch)") 24 | 25 | -- add c includes for checking 26 | add_cincludes("pcre2/pcre2.h") 27 | 28 | -- add include directories 29 | add_includedirs("inc/$(plat)", "inc") 30 | 31 | -- add c functions 32 | add_cfuncs("pcre2_compile") 33 | -------------------------------------------------------------------------------- /pkg/polarssl.pkg/inc/polarssl/polarssl.h: -------------------------------------------------------------------------------- 1 | #ifndef PKG_POLARSSL_H 2 | #define PKG_POLARSSL_H 3 | 4 | /* ////////////////////////////////////////////////////////////////////////////////////// 5 | * includes 6 | */ 7 | #include "ssl.h" 8 | #include "certs.h" 9 | #include "error.h" 10 | #include "entropy.h" 11 | #include "ctr_drbg.h" 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /pkg/polarssl.pkg/lib/android/armv5te/libpolarssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/polarssl.pkg/lib/android/armv5te/libpolarssl.a -------------------------------------------------------------------------------- /pkg/polarssl.pkg/lib/android/armv6/libpolarssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/polarssl.pkg/lib/android/armv6/libpolarssl.a -------------------------------------------------------------------------------- /pkg/polarssl.pkg/lib/iphoneos/arm64/libpolarssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/polarssl.pkg/lib/iphoneos/arm64/libpolarssl.a -------------------------------------------------------------------------------- /pkg/polarssl.pkg/lib/iphoneos/armv7/libpolarssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/polarssl.pkg/lib/iphoneos/armv7/libpolarssl.a -------------------------------------------------------------------------------- /pkg/polarssl.pkg/lib/iphoneos/armv7s/libpolarssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/polarssl.pkg/lib/iphoneos/armv7s/libpolarssl.a -------------------------------------------------------------------------------- /pkg/polarssl.pkg/lib/iphoneos/i386/libpolarssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/polarssl.pkg/lib/iphoneos/i386/libpolarssl.a -------------------------------------------------------------------------------- /pkg/polarssl.pkg/lib/iphoneos/x86_64/libpolarssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/polarssl.pkg/lib/iphoneos/x86_64/libpolarssl.a -------------------------------------------------------------------------------- /pkg/polarssl.pkg/lib/linux/x86_64/libpolarssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/polarssl.pkg/lib/linux/x86_64/libpolarssl.a -------------------------------------------------------------------------------- /pkg/polarssl.pkg/lib/macosx/i386/libpolarssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/polarssl.pkg/lib/macosx/i386/libpolarssl.a -------------------------------------------------------------------------------- /pkg/polarssl.pkg/lib/macosx/x86_64/libpolarssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/polarssl.pkg/lib/macosx/x86_64/libpolarssl.a -------------------------------------------------------------------------------- /pkg/polarssl.pkg/lib/mingw/i386/libpolarssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/polarssl.pkg/lib/mingw/i386/libpolarssl.a -------------------------------------------------------------------------------- /pkg/polarssl.pkg/lib/windows/i386/polarssl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/polarssl.pkg/lib/windows/i386/polarssl.lib -------------------------------------------------------------------------------- /pkg/polarssl.pkg/xmake.lua: -------------------------------------------------------------------------------- 1 | -- add polarssl package 2 | option("polarssl") 3 | 4 | -- show menu 5 | set_showmenu(true) 6 | 7 | -- set category 8 | set_category("package") 9 | 10 | -- set description 11 | set_description("The polarssl package") 12 | 13 | -- add defines to config.h if checking ok 14 | add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_POLARSSL") 15 | 16 | -- add links for checking 17 | add_links("polarssl") 18 | 19 | -- add link directories 20 | add_linkdirs("lib/$(plat)/$(arch)") 21 | 22 | -- add c includes for checking 23 | add_cincludes("polarssl/polarssl.h") 24 | 25 | -- add include directories 26 | add_includedirs("inc/$(plat)", "inc") 27 | 28 | -- add c functions 29 | add_cfuncs("ssl_init") 30 | -------------------------------------------------------------------------------- /pkg/sqlite3.pkg/inc/iphoneos/sqlite3/sqlite3.h: -------------------------------------------------------------------------------- 1 | #ifndef PKG_SQLITE3_H 2 | #define PKG_SQLITE3_H 3 | 4 | /* ////////////////////////////////////////////////////////////////////////////////////// 5 | * includes 6 | */ 7 | #include 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /pkg/sqlite3.pkg/inc/macosx/sqlite3/sqlite3.h: -------------------------------------------------------------------------------- 1 | #ifndef PKG_SQLITE3_H 2 | #define PKG_SQLITE3_H 3 | 4 | /* ////////////////////////////////////////////////////////////////////////////////////// 5 | * includes 6 | */ 7 | #include 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /pkg/sqlite3.pkg/lib/mingw/i386/libsqlite3.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/sqlite3.pkg/lib/mingw/i386/libsqlite3.a -------------------------------------------------------------------------------- /pkg/sqlite3.pkg/lib/windows/i386/sqlite3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/sqlite3.pkg/lib/windows/i386/sqlite3.lib -------------------------------------------------------------------------------- /pkg/sqlite3.pkg/xmake.lua: -------------------------------------------------------------------------------- 1 | -- add sqlite3 package 2 | option("sqlite3") 3 | 4 | -- show menu 5 | set_showmenu(true) 6 | 7 | -- set category 8 | set_category("package") 9 | 10 | -- set description 11 | set_description("The sqlite3 package") 12 | 13 | -- add defines to config.h if checking ok 14 | add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_SQLITE3") 15 | 16 | -- add links for checking 17 | add_links("sqlite3") 18 | 19 | -- add link directories 20 | add_linkdirs("lib/$(plat)/$(arch)") 21 | 22 | -- add c includes for checking 23 | add_cincludes("sqlite3/sqlite3.h") 24 | 25 | -- add include directories 26 | add_includedirs("inc/$(plat)", "inc") 27 | 28 | -- add c functions 29 | add_cfuncs("sqlite3_open_v2") 30 | -------------------------------------------------------------------------------- /pkg/zlib.pkg/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | 19 | Jean-loup Gailly 20 | Mark Adler -------------------------------------------------------------------------------- /pkg/zlib.pkg/lib/linux/i386/libz.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/zlib.pkg/lib/linux/i386/libz.a -------------------------------------------------------------------------------- /pkg/zlib.pkg/lib/mingw/i386/libz.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/zlib.pkg/lib/mingw/i386/libz.a -------------------------------------------------------------------------------- /pkg/zlib.pkg/lib/windows/i386/z.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiveMirror/tbox/69dd88e11490d4711cd6473a560020ca5ce40806/pkg/zlib.pkg/lib/windows/i386/z.lib -------------------------------------------------------------------------------- /pkg/zlib.pkg/xmake.lua: -------------------------------------------------------------------------------- 1 | -- add zlib package 2 | option("zlib") 3 | 4 | -- show menu 5 | set_showmenu(true) 6 | 7 | -- set category 8 | set_category("package") 9 | 10 | -- set description 11 | set_description("The zlib package") 12 | 13 | -- add defines to config.h if checking ok 14 | add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_ZLIB") 15 | 16 | -- add links for checking 17 | add_links("z") 18 | 19 | -- add link directories 20 | add_linkdirs("lib/$(plat)/$(arch)") 21 | 22 | -- add c includes for checking 23 | add_cincludes("zlib/zlib.h") 24 | 25 | -- add include directories 26 | add_includedirs("inc/$(plat)", "inc") 27 | -------------------------------------------------------------------------------- /src/demo/container/hash_set.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_container_hash_set_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /src/demo/hash/adler32.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_hash_adler32_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // trace 12 | tb_trace_i("[adler32]: %x", tb_adler32_make_from_cstr(argv[1], 0)); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /src/demo/hash/crc16.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_hash_crc16_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_trace_i("[crc16_ansi]: %x\n", tb_crc16_make_from_cstr(argv[1], 0)); 12 | tb_trace_i("[crc16_ccitt]: %x\n", tb_crc16_ccitt_make_from_cstr(argv[1], 0)); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /src/demo/hash/crc32.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_hash_crc32_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_trace_i("[crc32_ieee]: %x\n", tb_crc32_make_from_cstr(argv[1], 0)); 12 | tb_trace_i("[crc32_ieee_le]: %x\n", tb_crc32_le_make_from_cstr(argv[1], 0)); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /src/demo/hash/crc8.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_hash_crc8_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_trace_i("[crc8]: %x\n", tb_crc8_make_from_cstr(argv[1], 0)); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /src/demo/hash/djb2.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_hash_djb2_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // trace 12 | tb_trace_i("[djb2]: %lx", tb_djb2_make_from_cstr(argv[1], 0)); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /src/demo/hash/fnv32.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_hash_fnv32_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // trace 12 | tb_trace_i("[fnv32]: %x", tb_fnv32_make_from_cstr(argv[1], 0)); 13 | tb_trace_i("[fnv32-1a]: %x", tb_fnv32_1a_make_from_cstr(argv[1], 0)); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /src/demo/hash/fnv64.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_hash_fnv64_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // trace 12 | tb_trace_i("[fnv64]: %llx", tb_fnv64_make_from_cstr(argv[1], 0)); 13 | tb_trace_i("[fnv64-1a]: %llx", tb_fnv64_1a_make_from_cstr(argv[1], 0)); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /src/demo/hash/md5.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_hash_md5_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_byte_t ob[16]; 12 | tb_size_t on = tb_md5_make((tb_byte_t const*)argv[1], tb_strlen(argv[1]), ob, 16); 13 | if (on != 16) return 0; 14 | 15 | tb_size_t i = 0; 16 | tb_char_t md5[256] = {0}; 17 | for (i = 0; i < 16; ++i) tb_snprintf(md5 + (i << 1), 3, "%02x", ob[i]); 18 | tb_printf("%s: %lu\n", md5, on); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /src/demo/hash/sdbm.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_hash_sdbm_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // trace 12 | tb_trace_i("[sdbm]: %lx", tb_sdbm_make_from_cstr(argv[1], 0)); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /src/demo/hash/sha.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | static tb_void_t tb_test_sha(tb_size_t mode, tb_char_t const* data) 7 | { 8 | tb_byte_t ob[32]; 9 | tb_size_t on = tb_sha_make(mode, (tb_byte_t const*)data, tb_strlen(data), ob, 32); 10 | tb_assert_and_check_return((on << 3) == mode); 11 | 12 | tb_size_t i = 0; 13 | tb_char_t sha[256] = {0}; 14 | for (i = 0; i < on; ++i) tb_snprintf(sha + (i << 1), 3, "%02X", ob[i]); 15 | tb_printf("[sha]: %d = %s\n", mode, sha); 16 | } 17 | 18 | /* ////////////////////////////////////////////////////////////////////////////////////// 19 | * main 20 | */ 21 | tb_int_t tb_demo_hash_sha_main(tb_int_t argc, tb_char_t** argv) 22 | { 23 | tb_test_sha(TB_SHA_MODE_SHA1_160, argv[1]); 24 | tb_test_sha(TB_SHA_MODE_SHA2_224, argv[1]); 25 | tb_test_sha(TB_SHA_MODE_SHA2_256, argv[1]); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /src/demo/hash/uuid.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_hash_uuid_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // trace 12 | tb_char_t uuid[37]; 13 | tb_trace_i("[uuid]: %s", tb_uuid_make_cstr(uuid, argv[1])); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /src/demo/libc/mbstowcs.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_libc_mbstowcs_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // convert it 12 | tb_wchar_t data[256]; 13 | tb_size_t size = tb_mbstowcs(data, "中文", tb_arrayn(data)); 14 | tb_assert_and_check_return_val(size != -1, 0); 15 | 16 | // trace 17 | tb_wprintf(L"中文: %s\n", data); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /src/demo/libc/time.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_libc_time_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // time 12 | tb_time_t now = tb_time(); 13 | 14 | // the local time 15 | tb_tm_t lt = {0}; 16 | if (tb_localtime(now, <)) 17 | { 18 | tb_trace_i("LMT: %04ld-%02ld-%02ld %02ld:%02ld:%02ld, week: %d, time: %lld ?= %lld" 19 | , lt.year 20 | , lt.month 21 | , lt.mday 22 | , lt.hour 23 | , lt.minute 24 | , lt.second 25 | , lt.week 26 | , tb_mktime(<) 27 | , now); 28 | } 29 | 30 | // the gmt time 31 | tb_tm_t gt = {0}; 32 | if (tb_gmtime(now, >)) 33 | { 34 | tb_trace_i("GMT: %04ld-%02ld-%02ld %02ld:%02ld:%02ld, week: %d, time: %lld ?= %lld" 35 | , gt.year 36 | , gt.month 37 | , gt.mday 38 | , gt.hour 39 | , gt.minute 40 | , gt.second 41 | , gt.week 42 | , tb_gmmktime(>) 43 | , now); 44 | } 45 | 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /src/demo/libc/wcstombs.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_libc_wcstombs_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // convert it 12 | tb_char_t data[256]; 13 | tb_size_t size = tb_wcstombs(data, L"中文", tb_arrayn(data)); 14 | tb_assert_and_check_return_val(size != -1, 0); 15 | 16 | // trace 17 | tb_printf("中文: %s\n", data); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /src/demo/memory/buffer.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_memory_buffer_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_buffer_t b; 12 | tb_buffer_init(&b); 13 | 14 | tb_buffer_memncpy(&b, (tb_byte_t const*)"hello ", 6); 15 | tb_buffer_memncat(&b, (tb_byte_t const*)"world", 6); 16 | tb_trace_i("%s", tb_buffer_data(&b)); 17 | 18 | tb_buffer_exit(&b); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /src/demo/memory/queue_buffer.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_memory_queue_buffer_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_char_t d[1024]; 12 | tb_queue_buffer_t b; 13 | tb_queue_buffer_init(&b, 1024); 14 | 15 | tb_queue_buffer_writ(&b, (tb_byte_t const*)"hello", 5); 16 | tb_queue_buffer_writ(&b, (tb_byte_t const*)" ", 1); 17 | tb_queue_buffer_writ(&b, (tb_byte_t const*)"world", 6); 18 | tb_queue_buffer_read(&b, (tb_byte_t*)d, 1024); 19 | tb_trace_i("%s", d); 20 | 21 | tb_queue_buffer_exit(&b); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /src/demo/memory/static_buffer.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_memory_static_buffer_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_byte_t data[1024]; 12 | 13 | tb_static_buffer_t b; 14 | tb_static_buffer_init(&b, data, 1024); 15 | 16 | tb_static_buffer_memncpy(&b, (tb_byte_t const*)"hello ", 6); 17 | tb_static_buffer_memncat(&b, (tb_byte_t const*)"world", 6); 18 | tb_trace_i("%s", tb_static_buffer_data(&b)); 19 | 20 | tb_static_buffer_exit(&b); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /src/demo/memory/string_pool.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_memory_string_pool_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | #if 0 12 | // hello 13 | tb_char_t const* hello = tb_string_pool_insert(tb_string_pool(), "hello world"); 14 | tb_trace_i("hello: %s", hello); 15 | 16 | // performance 17 | tb_char_t s[256] = {0}; 18 | tb_hong_t t = tb_mclock(); 19 | __tb_volatile__ tb_size_t n = 1000000; 20 | while (n--) 21 | { 22 | tb_int_t r = tb_snprintf(s, 256, "%u", tb_random_range(0, 10000)); 23 | s[r] = '\0'; 24 | #if 1 25 | tb_string_pool_insert(tb_string_pool(), s); 26 | if (!(n & 15)) tb_string_pool_remove(tb_string_pool(), s); 27 | #else 28 | tb_free(tb_strdup(s)); 29 | #endif 30 | } 31 | t = tb_mclock() - t; 32 | tb_trace_i("time: %lld", t); 33 | 34 | // del hello 35 | tb_string_pool_remove(tb_string_pool(), hello); 36 | #endif 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /src/demo/micro.lua: -------------------------------------------------------------------------------- 1 | 2 | -- add target 3 | target("demo") 4 | 5 | -- add the dependent target 6 | add_deps("tbox") 7 | 8 | -- make as a binary 9 | set_kind("binary") 10 | 11 | -- add defines 12 | add_defines("__tb_prefix__=\"demo\"") 13 | 14 | -- set the object files directory 15 | set_objectdir("$(buildir)/.objs") 16 | 17 | -- add links directory 18 | add_linkdirs("$(buildir)") 19 | 20 | -- add includes directory 21 | add_includedirs("$(buildir)") 22 | add_includedirs("$(buildir)/tbox") 23 | 24 | -- add links 25 | add_links("tbox") 26 | 27 | -- add packages 28 | add_packages("base") 29 | 30 | -- add the source files 31 | add_files("micro.c") 32 | add_files("libc/stdlib.c") 33 | add_files("utils/bits.c") 34 | add_files("other/test.c") 35 | add_files("platform/addrinfo.c") 36 | add_files("container/list_entry.c") 37 | add_files("container/single_list_entry.c") 38 | 39 | -- add the source files for coroutine 40 | if is_option("coroutine") then 41 | add_files("coroutine/stackless/*.c") 42 | end 43 | 44 | -------------------------------------------------------------------------------- /src/demo/network/hwaddr.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_network_hwaddr_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // done 12 | tb_hwaddr_t addr; 13 | tb_hwaddr_clear(&addr); 14 | if (tb_hwaddr_cstr_set(&addr, argv[1])) 15 | { 16 | // trace 17 | tb_trace_i("%s => %{hwaddr}", argv[1], &addr); 18 | } 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /src/demo/network/impl/date.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../../demo.h" 5 | #include "../../../tbox/network/impl/http/date.h" 6 | 7 | /* ////////////////////////////////////////////////////////////////////////////////////// 8 | * test 9 | */ 10 | static tb_void_t tb_demo_test_date(tb_char_t const* cstr) 11 | { 12 | tb_tm_t date = {0}; 13 | if (tb_gmtime(tb_http_date_from_cstr(cstr, tb_strlen(cstr)), &date)) 14 | { 15 | tb_trace_i("%s => %04ld-%02ld-%02ld %02ld:%02ld:%02ld GMT, week: %d" 16 | , cstr 17 | , date.year 18 | , date.month 19 | , date.mday 20 | , date.hour 21 | , date.minute 22 | , date.second 23 | , date.week); 24 | } 25 | } 26 | 27 | /* ////////////////////////////////////////////////////////////////////////////////////// 28 | * main 29 | */ 30 | tb_int_t tb_demo_network_impl_date_main(tb_int_t argc, tb_char_t** argv) 31 | { 32 | tb_demo_test_date("Sun, 06 Nov 1994 08:49:37 GMT"); 33 | tb_demo_test_date("Sun Nov 6 08:49:37 1994"); 34 | tb_demo_test_date("Sun, 06-Nov-1994 08:49:37 GMT"); 35 | tb_demo_test_date("Mon, 19 May 2014 07:21:56 GMT"); 36 | tb_demo_test_date("Thu, 31-Dec-37 23:55:55 GMT"); 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /src/demo/network/ipaddr.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_network_ipaddr_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // done 12 | tb_ipaddr_t addr; 13 | tb_ipaddr_clear(&addr); 14 | if (tb_ipaddr_ip_cstr_set(&addr, argv[1], TB_IPADDR_FAMILY_NONE)) 15 | { 16 | // trace 17 | tb_trace_i("%s => %{ipaddr}", argv[1], &addr); 18 | } 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /src/demo/network/ipv4.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_network_ipv4_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // done 12 | tb_ipv4_t ipv4; 13 | if (tb_ipv4_cstr_set(&ipv4, argv[1])) 14 | { 15 | // trace 16 | tb_trace_i("%s => %{ipv4}", argv[1], &ipv4); 17 | } 18 | 19 | // end 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /src/demo/network/ipv6.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_network_ipv6_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // done 12 | tb_ipv6_t ipv6; 13 | if (tb_ipv6_cstr_set(&ipv6, argv[1])) 14 | { 15 | // trace 16 | tb_trace_i("%s => %{ipv6}", argv[1], &ipv6); 17 | } 18 | 19 | // end 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /src/demo/object/bin.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_object_bin_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // read object 12 | tb_object_ref_t object = tb_object_read_from_url(argv[1]); 13 | 14 | // writ 15 | if (object) 16 | { 17 | // writ object 18 | tb_object_writ_to_url(object, argv[2], TB_OBJECT_FORMAT_BIN); 19 | 20 | // exit object 21 | tb_object_exit(object); 22 | } 23 | 24 | return 0; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/demo/object/bplist.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_object_bplist_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // read object 12 | tb_object_ref_t object = tb_object_read_from_url(argv[1]); 13 | 14 | // writ 15 | if (object) 16 | { 17 | // writ object 18 | tb_object_writ_to_url(object, argv[2], TB_OBJECT_FORMAT_BPLIST); 19 | 20 | // exit object 21 | tb_object_exit(object); 22 | } 23 | 24 | return 0; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/demo/object/dump.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_object_dump_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // read 12 | tb_object_ref_t root = tb_object_read_from_url(argv[1]); 13 | if (root) 14 | { 15 | // seek? 16 | tb_object_ref_t object = root; 17 | if (argv[2]) object = tb_object_seek(root, argv[2], tb_true); 18 | 19 | // dump object 20 | if (object) tb_object_dump(object, TB_OBJECT_FORMAT_XML); 21 | 22 | // exit object 23 | tb_object_exit(root); 24 | } 25 | 26 | return 0; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /src/demo/object/json.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_object_json_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // read object 12 | tb_object_ref_t object = tb_object_read_from_url(argv[1]); 13 | 14 | // writ 15 | if (object) 16 | { 17 | // writ object 18 | tb_object_writ_to_url(object, argv[2], TB_OBJECT_FORMAT_JSON); 19 | 20 | // exit object 21 | tb_object_exit(object); 22 | } 23 | 24 | return 0; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/demo/object/xml.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_object_xml_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // read object 12 | tb_object_ref_t object = tb_object_read_from_url(argv[1]); 13 | 14 | // writ 15 | if (object) 16 | { 17 | // writ object 18 | tb_object_writ_to_url(object, argv[2], TB_OBJECT_FORMAT_XML); 19 | 20 | // exit object 21 | tb_object_exit(object); 22 | } 23 | 24 | return 0; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/demo/object/xplist.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_object_xplist_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // read object 12 | tb_object_ref_t object = tb_object_read_from_url(argv[1]); 13 | 14 | // writ 15 | if (object) 16 | { 17 | // writ object 18 | tb_object_writ_to_url(object, argv[2], TB_OBJECT_FORMAT_XPLIST); 19 | 20 | // exit object 21 | tb_object_exit(object); 22 | } 23 | 24 | return 0; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/demo/other/test.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_other_test_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /src/demo/platform/addrinfo.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * implementation 8 | */ 9 | static tb_void_t tb_demo_addrinfo_test(tb_char_t const* name) 10 | { 11 | // get the default address (ipv4) 12 | tb_ipaddr_t addr = {0}; 13 | tb_char_t host[256]; 14 | if (tb_addrinfo_addr(name, &addr)) 15 | tb_trace_i("%s: %{ipaddr} => %s", name, &addr, tb_addrinfo_name(&addr, host, sizeof(host))); 16 | 17 | // get the ipv6 address by the hint info 18 | tb_ipaddr_clear(&addr); 19 | tb_ipaddr_family_set(&addr, TB_IPADDR_FAMILY_IPV6); 20 | if (tb_addrinfo_addr(name, &addr)) 21 | tb_trace_i("%s: %{ipaddr} => %s", name, &addr, tb_addrinfo_name(&addr, host, sizeof(host))); 22 | } 23 | 24 | /* ////////////////////////////////////////////////////////////////////////////////////// 25 | * main 26 | */ 27 | tb_int_t tb_demo_platform_addrinfo_main(tb_int_t argc, tb_char_t** argv) 28 | { 29 | // test address 30 | tb_demo_addrinfo_test(argv[1]); 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /src/demo/platform/atomic.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_platform_atomic_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_atomic_t a; 12 | tb_atomic_set0(&a); 13 | tb_trace_i("%ld", tb_atomic_get(&a)); 14 | tb_trace_i("%ld", tb_atomic_fetch_and_set(&a, 1)); 15 | tb_trace_i("%ld", tb_atomic_fetch_and_pset(&a, 1, 2)); 16 | tb_trace_i("%ld", tb_atomic_fetch_and_inc(&a)); 17 | tb_trace_i("%ld", tb_atomic_fetch_and_dec(&a)); 18 | tb_trace_i("%ld", tb_atomic_fetch_and_add(&a, 10)); 19 | tb_trace_i("%ld", tb_atomic_fetch_and_sub(&a, 10)); 20 | tb_trace_i("%ld", tb_atomic_fetch_and_and(&a, 0xff)); 21 | tb_trace_i("%ld", tb_atomic_fetch_and_xor(&a, 0xff)); 22 | tb_trace_i("%ld", tb_atomic_fetch_and_or(&a, 0xff)); 23 | tb_trace_i("%ld", tb_atomic_get(&a)); 24 | tb_trace_i("%ld", tb_atomic_inc_and_fetch(&a)); 25 | tb_trace_i("%ld", tb_atomic_dec_and_fetch(&a)); 26 | tb_trace_i("%ld", tb_atomic_add_and_fetch(&a, 10)); 27 | tb_trace_i("%ld", tb_atomic_sub_and_fetch(&a, 10)); 28 | tb_trace_i("%ld", tb_atomic_and_and_fetch(&a, 0xff)); 29 | tb_trace_i("%ld", tb_atomic_xor_and_fetch(&a, 0xff)); 30 | tb_trace_i("%ld", tb_atomic_or_and_fetch(&a, 0xff)); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /src/demo/platform/backtrace.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * test 8 | */ 9 | tb_void_t tb_demo_test3(tb_noarg_t); 10 | tb_void_t tb_demo_test3() 11 | { 12 | tb_backtrace_dump("\t", tb_null, 10); 13 | } 14 | static tb_void_t tb_demo_test2() 15 | { 16 | tb_demo_test3(); 17 | } 18 | tb_void_t tb_demo_test(tb_size_t size); 19 | tb_void_t tb_demo_test(tb_size_t size) 20 | { 21 | if (size) tb_demo_test(size - 1); 22 | else tb_demo_test2(); 23 | } 24 | 25 | /* ////////////////////////////////////////////////////////////////////////////////////// 26 | * main 27 | */ 28 | tb_int_t tb_demo_platform_backtrace_main(tb_int_t argc, tb_char_t** argv) 29 | { 30 | // done 31 | tb_demo_test(argv[1]? tb_atoi(argv[1]) : 10); 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /src/demo/platform/barrier.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_platform_barrier_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // barrier 12 | tb_barrier(); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /src/demo/platform/cache_time.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_platform_cache_time_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_trace_i("%lld %lld", tb_cache_time_spak(), tb_cache_time_mclock()); 12 | tb_sleep(1); 13 | tb_trace_i("%lld %lld", tb_cache_time_spak(), tb_cache_time_mclock()); 14 | tb_sleep(1); 15 | tb_trace_i("%lld %lld", tb_cache_time_spak(), tb_cache_time_mclock()); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /src/demo/platform/hostname.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_platform_hostname_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_char_t name[256] = {0}; 12 | if (tb_hostname(name, sizeof(name))) 13 | { 14 | tb_trace_i("hostname: %s", name); 15 | } 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /src/demo/platform/ifaddrs.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_platform_ifaddrs_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | #ifdef __tb_debug__ 12 | // dump ifaddrs 13 | tb_ifaddrs_dump(tb_ifaddrs()); 14 | #endif 15 | 16 | // dump hwaddr 17 | tb_hwaddr_t hwaddr; 18 | if (tb_ifaddrs_hwaddr(tb_ifaddrs(), argv[1], tb_false, &hwaddr)) 19 | { 20 | // trace 21 | tb_trace_i("name: %s, hwaddr: %{hwaddr}", argv[1], &hwaddr); 22 | } 23 | 24 | // dump ipaddr4 25 | tb_ipaddr_t ipaddr4; 26 | if (tb_ifaddrs_ipaddr(tb_ifaddrs(), argv[1], tb_false, TB_IPADDR_FAMILY_IPV4, &ipaddr4)) 27 | { 28 | // trace 29 | tb_trace_i("name: %s, ipaddr4: %{ipaddr}", argv[1], &ipaddr4); 30 | } 31 | 32 | // dump ipaddr6 33 | tb_ipaddr_t ipaddr6; 34 | if (tb_ifaddrs_ipaddr(tb_ifaddrs(), argv[1], tb_false, TB_IPADDR_FAMILY_IPV6, &ipaddr6)) 35 | { 36 | // trace 37 | tb_trace_i("name: %s, ipaddr6: %{ipaddr}", argv[1], &ipaddr6); 38 | } 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /src/demo/platform/path.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_platform_path_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // the absolute path 12 | tb_char_t path[TB_PATH_MAXN] = {0}; 13 | tb_trace_i("%s", tb_path_relative_to(argv[2], argv[1], path, TB_PATH_MAXN)); 14 | // tb_trace_i("%s", tb_path_absolute_to(argv[2], argv[1], path, TB_PATH_MAXN)); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /src/demo/platform/processor.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_platform_processor_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // trace 12 | tb_trace_i("cpu: %lu", tb_processor_count()); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /src/demo/platform/thread.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * implementation 8 | */ 9 | static tb_int_t tb_demo_thread_func(tb_cpointer_t priv) 10 | { 11 | // self 12 | tb_size_t self = tb_thread_self(); 13 | 14 | // trace 15 | tb_trace_i("thread[%lx: %s]: init", self, priv); 16 | 17 | // exit 18 | tb_thread_return(-1); 19 | 20 | // trace 21 | tb_trace_i("thread[%lx: %s]: exit", self, priv); 22 | 23 | // ok 24 | return 0; 25 | } 26 | 27 | /* ////////////////////////////////////////////////////////////////////////////////////// 28 | * main 29 | */ 30 | tb_int_t tb_demo_platform_thread_main(tb_int_t argc, tb_char_t** argv) 31 | { 32 | // init thread 33 | tb_thread_ref_t thread = tb_thread_init(tb_null, tb_demo_thread_func, "hello", 0); 34 | if (thread) 35 | { 36 | // wait thread 37 | tb_int_t retval = 0; 38 | if (tb_thread_wait(thread, -1, &retval) > 0) 39 | { 40 | // trace 41 | tb_trace_i("wait: ok, retval: %d", retval); 42 | } 43 | 44 | // exit thread 45 | tb_thread_exit(thread); 46 | } 47 | 48 | // wait 49 | getchar(); 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /src/demo/platform/utils.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_platform_utils_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // hostname 12 | tb_char_t hostname[4096] = {0}; 13 | if (tb_hostname(hostname, 4096)) tb_trace_i("hostname: %s", hostname); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /src/demo/stream/stream/cache.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_stream_cache_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // init istream 12 | tb_stream_ref_t istream = tb_stream_init_from_url(argv[1]); 13 | 14 | // init ostream 15 | tb_stream_ref_t ostream = tb_stream_init_from_file(argv[2], TB_FILE_MODE_RW | TB_FILE_MODE_CREAT | TB_FILE_MODE_BINARY | TB_FILE_MODE_TRUNC); 16 | 17 | // filter istream or ostream? 18 | tb_stream_ref_t iostream = istream; 19 | // tb_stream_ref_t iostream = ostream; 20 | 21 | // init fstream 22 | tb_stream_ref_t fstream = tb_stream_init_filter_from_cache(iostream, 0); 23 | 24 | // done 25 | if (istream && ostream && fstream) 26 | { 27 | // save it 28 | tb_hong_t save = 0; 29 | if (iostream == istream) save = tb_transfer(fstream, ostream, 0, tb_null, tb_null); 30 | else save = tb_transfer(istream, fstream, 0, tb_null, tb_null); 31 | 32 | // trace 33 | tb_trace_i("save: %lld bytes, size: %lld bytes", save, tb_stream_size(istream)); 34 | } 35 | 36 | // exit fstream 37 | tb_stream_exit(fstream); 38 | 39 | // exit istream 40 | tb_stream_exit(istream); 41 | 42 | // exit ostream 43 | tb_stream_exit(ostream); 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /src/demo/stream/stream/null.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_stream_null_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // init istream 12 | tb_stream_ref_t istream = tb_stream_init_from_url(argv[1]); 13 | 14 | // init ostream 15 | tb_stream_ref_t ostream = tb_stream_init_from_file(argv[2], TB_FILE_MODE_RW | TB_FILE_MODE_CREAT | TB_FILE_MODE_BINARY | TB_FILE_MODE_TRUNC); 16 | 17 | // filter istream or ostream? 18 | tb_stream_ref_t iostream = istream; 19 | // tb_stream_ref_t iostream = ostream; 20 | 21 | // init fstream 22 | tb_stream_ref_t fstream = tb_stream_init_filter_from_null(iostream); 23 | 24 | // done 25 | if (istream && ostream && fstream) 26 | { 27 | // save it 28 | tb_hong_t save = 0; 29 | if (iostream == istream) save = tb_transfer(fstream, ostream, 0, tb_null, tb_null); 30 | else save = tb_transfer(istream, fstream, 0, tb_null, tb_null); 31 | 32 | // trace 33 | tb_trace_i("save: %lld bytes, size: %lld bytes", save, tb_stream_size(istream)); 34 | } 35 | 36 | // exit fstream 37 | tb_stream_exit(fstream); 38 | 39 | // exit istream 40 | tb_stream_exit(istream); 41 | 42 | // exit ostream 43 | tb_stream_exit(ostream); 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /src/demo/string/static_string.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_string_static_string_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_static_string_t s; 12 | tb_char_t b[4096]; 13 | tb_static_string_init(&s, b, 4096); 14 | 15 | tb_static_string_cstrcpy(&s, "hello"); 16 | tb_static_string_chrcat(&s, ' '); 17 | tb_static_string_cstrfcat(&s, "%s", "world"); 18 | tb_trace_i("%s", tb_static_string_cstr(&s)); 19 | 20 | tb_static_string_exit(&s); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /src/demo/string/string.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_string_string_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_string_t s; 12 | tb_string_init(&s); 13 | 14 | tb_string_cstrcpy(&s, "hello"); 15 | tb_string_chrcat(&s, ' '); 16 | tb_string_cstrfcat(&s, "%s", "world"); 17 | tb_string_chrcat(&s, ' '); 18 | tb_string_chrncat(&s, 'x', 5); 19 | tb_trace_i("%d: %s", tb_string_size(&s), tb_string_cstr(&s)); 20 | 21 | tb_string_exit(&s); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /src/demo/utils/base32.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_utils_base32_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_char_t ob[4096]; 12 | //tb_size_t on = tb_base32_encode(argv[1], tb_strlen(argv[1]), ob, 4096); 13 | tb_size_t on = tb_base32_decode((tb_byte_t const*)argv[1], tb_strlen(argv[1]), ob, 4096); 14 | tb_printf("%s: %lu\n", ob, on); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /src/demo/utils/base64.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_utils_base64_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_char_t ob[4096] = {0}; 12 | tb_size_t on = tb_base64_encode((tb_byte_t*)argv[1], tb_strlen(argv[1]), ob, 4096); 13 | //tb_size_t on = tb_base64_decode((tb_byte_t*)argv[1], tb_strlen(argv[1]), ob, 4096); 14 | tb_printf("%s: %lu\n", ob, on); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /src/demo/utils/dump.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_utils_dump_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // dump 12 | tb_dump_data((tb_byte_t const*)argv[1], tb_strlen(argv[1])); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /src/demo/utils/url.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_utils_url_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | tb_char_t ob[4096]; 12 | //tb_size_t on = tb_url_encode(argv[1], tb_strlen(argv[1]), ob, 4096); 13 | tb_size_t on = tb_url_decode(argv[1], tb_strlen(argv[1]), ob, 4096); 14 | tb_trace_i("%s: %lu", ob, on); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /src/demo/xml/document.c: -------------------------------------------------------------------------------- 1 | /* ////////////////////////////////////////////////////////////////////////////////////// 2 | * includes 3 | */ 4 | #include "../demo.h" 5 | 6 | /* ////////////////////////////////////////////////////////////////////////////////////// 7 | * main 8 | */ 9 | tb_int_t tb_demo_xml_document_main(tb_int_t argc, tb_char_t** argv) 10 | { 11 | // init reader and writer 12 | tb_xml_reader_ref_t reader = tb_xml_reader_init(); 13 | tb_xml_writer_ref_t writer = tb_xml_writer_init(); 14 | if (reader && writer) 15 | { 16 | // open reader and writer 17 | if ( tb_xml_reader_open(reader, tb_stream_init_from_url(argv[1]), tb_true) 18 | && tb_xml_writer_open(writer, tb_true, tb_stream_init_from_url(argv[2]), tb_true)) 19 | { 20 | // goto 21 | tb_bool_t ok = tb_true; 22 | if (argv[3]) ok = tb_xml_reader_goto(reader, argv[3]); 23 | 24 | // load & save 25 | tb_xml_node_ref_t root = tb_null; 26 | if (ok) tb_xml_writer_save(writer, root = tb_xml_reader_load(reader)); 27 | 28 | // exit root 29 | if (root) tb_xml_node_exit(root); 30 | } 31 | } 32 | 33 | // exit reader 34 | if (reader) tb_xml_reader_exit(reader); 35 | reader = tb_null; 36 | 37 | // exit writer 38 | if (writer) tb_xml_writer_exit(writer); 39 | writer = tb_null; 40 | 41 | return 0; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /src/tbox/algorithm/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * @ingroup algorithm 24 | * 25 | */ 26 | #ifndef TB_ALGORITHM_PREFIX_H 27 | #define TB_ALGORITHM_PREFIX_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "../prefix.h" 33 | #include "../container/container.h" 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/asio/asio.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file asio.h 23 | * 24 | */ 25 | #ifndef TB_ASIO_H 26 | #define TB_ASIO_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "prefix.h" 32 | #ifdef TB_CONFIG_API_HAVE_DEPRECATED 33 | # include "deprecated/deprecated.h" 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/tbox/asio/deprecated/asio.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file asio.h 23 | * @defgroup asio 24 | * 25 | */ 26 | #ifndef TB_ASIO_DEPRECATED_H 27 | #define TB_ASIO_DEPRECATED_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | #include "aioo.h" 34 | #include "aioe.h" 35 | #include "aiop.h" 36 | #include "aico.h" 37 | #include "aice.h" 38 | #include "aicp.h" 39 | #include "http.h" 40 | #include "dns.h" 41 | #include "ssl.h" 42 | 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/tbox/asio/deprecated/deprecated.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file deprecated.h 23 | * @defgroup asio 24 | * 25 | */ 26 | #ifndef TB_ASIO_DEPRECATED_H 27 | #define TB_ASIO_DEPRECATED_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "asio.h" 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/asio/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_ASIO_PREFIX_H 26 | #define TB_ASIO_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/charset/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_CHARSET_PREFIX_H 26 | #define TB_CHARSET_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/config.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file config.h 23 | * 24 | */ 25 | #ifndef TB_TBOX_CONFIG_H 26 | #define TB_TBOX_CONFIG_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "tbox.config.h" 32 | 33 | #endif 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/tbox/coroutine/impl/impl.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file impl.h 23 | * 24 | */ 25 | #ifndef TB_COROUTINE_IMPL_H 26 | #define TB_COROUTINE_IMPL_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "prefix.h" 32 | #include "coroutine.h" 33 | #include "scheduler.h" 34 | #include "scheduler_io.h" 35 | #include "stackless/stackless.h" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/tbox/coroutine/impl/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_COROUTINE_IMPL_PREFIX_H 26 | #define TB_COROUTINE_IMPL_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | #include "../coroutine.h" 33 | #include "../../libc/libc.h" 34 | #include "../../utils/utils.h" 35 | #include "../../platform/platform.h" 36 | #include "../../container/container.h" 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/tbox/coroutine/impl/stackless/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_COROUTINE_IMPL_STACKLESS_PREFIX_H 26 | #define TB_COROUTINE_IMPL_STACKLESS_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | #include "../../stackless/coroutine.h" 33 | #include "../../../container/container.h" 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/tbox/coroutine/impl/stackless/stackless.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file coroutine.h 23 | * 24 | */ 25 | #ifndef TB_COROUTINE_IMPL_STACKLESS_H 26 | #define TB_COROUTINE_IMPL_STACKLESS_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "coroutine.h" 32 | #include "scheduler.h" 33 | #include "scheduler_io.h" 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/coroutine/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_COROUTINE_PREFIX_H 26 | #define TB_COROUTINE_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/coroutine/stackless/stackless.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file stackless.h 23 | * @ingroup coroutine 24 | * 25 | */ 26 | #ifndef TB_COROUTINE_STACKLESS_H 27 | #define TB_COROUTINE_STACKLESS_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "coroutine.h" 33 | #include "scheduler.h" 34 | #include "semaphore.h" 35 | #include "lock.h" 36 | 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/tbox/database/database.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file database.h 23 | * @defgroup database 24 | */ 25 | #ifndef TB_DATABASE_H 26 | #define TB_DATABASE_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "prefix.h" 32 | #include "sql.h" 33 | 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/tbox/database/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * @ingroup database 24 | * 25 | */ 26 | #ifndef TB_DATABASE_PREFIX_H 27 | #define TB_DATABASE_PREFIX_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "../prefix.h" 33 | #include "../libc/libc.h" 34 | #include "../network/url.h" 35 | #include "../container/iterator.h" 36 | 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/tbox/hash/arch/crc32.S: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file crc32.S 23 | * 24 | */ 25 | /* ////////////////////////////////////////////////////////////////////////////////////// 26 | * includes 27 | */ 28 | #include "../../prefix/prefix.S" 29 | 30 | /* ////////////////////////////////////////////////////////////////////////////////////// 31 | * implementation 32 | */ 33 | #if defined(TB_ARCH_ARM) && !defined(TB_ARCH_ARM64) 34 | # include "arm/crc32.S" 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/hash/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_HASH_PREFIX_H 26 | #define TB_HASH_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | #include "../libc/libc.h" 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/libc/impl/impl.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file libc.h 23 | * @ingroup libc 24 | * 25 | */ 26 | #ifndef TB_LIBC_IMPL_H 27 | #define TB_LIBC_IMPL_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "libc.h" 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/libc/impl/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_LIBC_IMPL_PREFIX_H 26 | #define TB_LIBC_IMPL_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/libc/libc.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file libc.h 23 | * @defgroup libc 24 | * 25 | */ 26 | #ifndef TB_LIBC_H 27 | #define TB_LIBC_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | #include "misc/misc.h" 34 | #include "stdio/stdio.h" 35 | #include "stdlib/stdlib.h" 36 | #include "string/string.h" 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/tbox/libc/misc/limits.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file limits.h 23 | * @ingroup libc 24 | * 25 | */ 26 | #ifndef TB_LIBC_MISC_LIMITS_H 27 | #define TB_LIBC_MISC_LIMITS_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | 34 | /* ////////////////////////////////////////////////////////////////////////////////////// 35 | * macros 36 | */ 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/tbox/libc/misc/misc.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file misc.h 23 | * @ingroup libc 24 | * 25 | */ 26 | #ifndef TB_LIBC_MISC_H 27 | #define TB_LIBC_MISC_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | #include "ctype.h" 34 | #include "stdarg.h" 35 | #include "setjmp.h" 36 | #include "signal.h" 37 | #include "limits.h" 38 | #include "./time/time.h" 39 | 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/tbox/libc/misc/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_LIBC_MISC_PREFIX_H 26 | #define TB_LIBC_MISC_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/libc/misc/time/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_LIBC_MISC_TIME_PREFIX_H 26 | #define TB_LIBC_MISC_TIME_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | #include "type.h" 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/libc/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_LIBC_PREFIX_H 26 | #define TB_LIBC_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | #include "./misc/ctype.h" 33 | #include "./misc/limits.h" 34 | #include "./misc/stdarg.h" 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/tbox/libc/stdio/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_LIBC_STDIO_PREFIX_H 26 | #define TB_LIBC_STDIO_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/libc/stdio/snprintf.c: -------------------------------------------------------------------------------- 1 | /*!The Treasure Arch Library 2 | * 3 | * TArch is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * TArch is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with TArch; 15 | * If not, see http://www.gnu.org/licenses/ 16 | * 17 | * Copyright (C) 2009 - 2017, ruki All rights reserved. 18 | * 19 | * @author ruki 20 | * @file snprintf.c 21 | * @ingroup libc 22 | * 23 | */ 24 | 25 | /* ////////////////////////////////////////////////////////////////////////////////////// 26 | * includes 27 | */ 28 | #include "stdio.h" 29 | 30 | /* ////////////////////////////////////////////////////////////////////////////////////// 31 | * implementation 32 | */ 33 | 34 | tb_long_t tb_snprintf(tb_char_t* s, tb_size_t n, tb_char_t const* fmt, ...) 35 | { 36 | tb_long_t ret = 0; 37 | tb_vsnprintf_format(s, n, fmt, &ret); 38 | return ret; 39 | } 40 | -------------------------------------------------------------------------------- /src/tbox/libc/stdio/sprintf.c: -------------------------------------------------------------------------------- 1 | /*!The Treasure Arch Library 2 | * 3 | * TArch is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * TArch is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with TArch; 15 | * If not, see http://www.gnu.org/licenses/ 16 | * 17 | * Copyright (C) 2009 - 2017, ruki All rights reserved. 18 | * 19 | * @author ruki 20 | * @file sprintf.c 21 | * @ingroup libc 22 | * 23 | */ 24 | 25 | /* ////////////////////////////////////////////////////////////////////////////////////// 26 | * includes 27 | */ 28 | #include "stdio.h" 29 | 30 | /* ////////////////////////////////////////////////////////////////////////////////////// 31 | * implementation 32 | */ 33 | 34 | tb_long_t tb_sprintf(tb_char_t* s, tb_char_t const* fmt, ...) 35 | { 36 | tb_long_t ret = 0; 37 | tb_vsnprintf_format(s, TB_MAXU32, fmt, &ret); 38 | return ret; 39 | } 40 | -------------------------------------------------------------------------------- /src/tbox/libc/stdio/swprintf.c: -------------------------------------------------------------------------------- 1 | /*!The Treasure Arch Library 2 | * 3 | * TArch is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * TArch is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with TArch; 15 | * If not, see http://www.gnu.org/licenses/ 16 | * 17 | * Copyright (C) 2009 - 2017, ruki All rights reserved. 18 | * 19 | * @author ruki 20 | * @file swprintf.c 21 | * @ingroup libc 22 | * 23 | */ 24 | 25 | /* ////////////////////////////////////////////////////////////////////////////////////// 26 | * includes 27 | */ 28 | #include "stdio.h" 29 | 30 | /* ////////////////////////////////////////////////////////////////////////////////////// 31 | * implementation 32 | */ 33 | 34 | tb_long_t tb_swprintf(tb_wchar_t* s, tb_size_t n, tb_wchar_t const* fmt, ...) 35 | { 36 | tb_long_t ret = 0; 37 | tb_vswprintf_format(s, n, fmt, &ret); 38 | return ret; 39 | } 40 | -------------------------------------------------------------------------------- /src/tbox/libc/stdlib/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_LIBC_STDLIB_PREFIX_H 26 | #define TB_LIBC_STDLIB_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/libc/string/impl/arm/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_LIBC_STRING_IMPL_ARM_PREFIX_H 26 | #define TB_LIBC_STRING_IMPL_ARM_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/libc/string/impl/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_LIBC_STRING_IMPL_PREFIX_H 26 | #define TB_LIBC_STRING_IMPL_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/libc/string/impl/sh4/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_LIBC_STRING_IMPL_SH4_PREFIX_H 26 | #define TB_LIBC_STRING_IMPL_SH4_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/libc/string/impl/x86/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_LIBC_STRING_IMPL_x86_PREFIX_H 26 | #define TB_LIBC_STRING_IMPL_x86_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/libc/string/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_LIBC_STRING_PREFIX_H 26 | #define TB_LIBC_STRING_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/libm/ceil.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file ceil.h 23 | * @ingroup libm 24 | * 25 | */ 26 | #ifndef TB_LIBM_CEIL_H 27 | #define TB_LIBM_CEIL_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | 34 | /* ////////////////////////////////////////////////////////////////////////////////////// 35 | * macros 36 | */ 37 | #define tb_ceil(x) ((x) > 0? (tb_int32_t)((x) + 0.9999999999) : (tb_int32_t)(x)) 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/tbox/libm/exp1.c: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file exp1.c 23 | * @ingroup libm 24 | * 25 | */ 26 | 27 | /* ////////////////////////////////////////////////////////////////////////////////////// 28 | * includes 29 | */ 30 | #include "math.h" 31 | 32 | /* ////////////////////////////////////////////////////////////////////////////////////// 33 | * implementation 34 | */ 35 | tb_double_t tb_exp1(tb_double_t x) 36 | { 37 | tb_assert(x >= -1 && x <= 1); 38 | return (1 + (x) + ((x) * (x)) / 2 + ((x) * (x) * (x)) / 6); 39 | } 40 | -------------------------------------------------------------------------------- /src/tbox/libm/exp1f.c: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file exp1f.c 23 | * @ingroup libm 24 | * 25 | */ 26 | 27 | /* ////////////////////////////////////////////////////////////////////////////////////// 28 | * includes 29 | */ 30 | #include "math.h" 31 | 32 | /* ////////////////////////////////////////////////////////////////////////////////////// 33 | * implementation 34 | */ 35 | tb_float_t tb_exp1f(tb_float_t x) 36 | { 37 | tb_assert(x >= -1 && x <= 1); 38 | return (1 + (x) + ((x) * (x)) / 2 + ((x) * (x) * (x)) / 6); 39 | } 40 | -------------------------------------------------------------------------------- /src/tbox/libm/fabs.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file fabs.h 23 | * @ingroup libm 24 | * 25 | */ 26 | #ifndef TB_LIBM_FABS_H 27 | #define TB_LIBM_FABS_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | 34 | /* ////////////////////////////////////////////////////////////////////////////////////// 35 | * macros 36 | */ 37 | #define tb_fabs tb_abs 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/tbox/libm/floor.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file floor.h 23 | * @ingroup libm 24 | * 25 | */ 26 | #ifndef TB_LIBM_FLOOR_H 27 | #define TB_LIBM_FLOOR_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | 34 | /* ////////////////////////////////////////////////////////////////////////////////////// 35 | * macros 36 | */ 37 | #define tb_floor(x) ((x) > 0? (tb_int32_t)(x) : (tb_int32_t)((x) - 0.9999999999)) 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/tbox/libm/impl/impl.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file libm.h 23 | * @ingroup libm 24 | * 25 | */ 26 | #ifndef TB_LIBM_IMPL_H 27 | #define TB_LIBM_IMPL_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "libm.h" 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/libm/impl/libm.c: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file libm.c 23 | * @ingroup libm 24 | * 25 | */ 26 | /* ////////////////////////////////////////////////////////////////////////////////////// 27 | * includes 28 | */ 29 | #include "libm.h" 30 | 31 | /* ////////////////////////////////////////////////////////////////////////////////////// 32 | * implementation 33 | */ 34 | tb_bool_t tb_libm_init_env() 35 | { 36 | return tb_true; 37 | } 38 | tb_void_t tb_libm_exit_env() 39 | { 40 | } 41 | 42 | -------------------------------------------------------------------------------- /src/tbox/libm/impl/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_LIBM_IMPL_PREFIX_H 26 | #define TB_LIBM_IMPL_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/libm/libm.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file libm.h 23 | * @defgroup libm 24 | * 25 | */ 26 | #ifndef TB_LIBM_H 27 | #define TB_LIBM_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "math.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/libm/mif.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file mif.h 23 | * @ingroup libm 24 | * 25 | */ 26 | #ifndef TB_LIBM_MIF_H 27 | #define TB_LIBM_MIF_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | #include "maf.h" 34 | 35 | /* ////////////////////////////////////////////////////////////////////////////////////// 36 | * macros 37 | */ 38 | #define TB_MIF (-TB_MAF) 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/tbox/libm/pi.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file pi.h 23 | * @ingroup libm 24 | * 25 | */ 26 | #ifndef TB_LIBM_PI_H 27 | #define TB_LIBM_PI_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | 34 | /* ////////////////////////////////////////////////////////////////////////////////////// 35 | * macros 36 | */ 37 | #define TB_PI (3.141592653589793) 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/tbox/libm/round.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file round.h 23 | * @ingroup libm 24 | * 25 | */ 26 | #ifndef TB_LIBM_ROUND_H 27 | #define TB_LIBM_ROUND_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | 34 | /* ////////////////////////////////////////////////////////////////////////////////////// 35 | * macros 36 | */ 37 | #define tb_round(x) ((x) > 0? (tb_int32_t)((x) + 0.5) : (tb_int32_t)((x) - 0.5)) 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/tbox/math/impl/impl.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file impl.h 23 | * 24 | */ 25 | #ifndef TB_MATH_IMPL_H 26 | #define TB_MATH_IMPL_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "math.h" 32 | 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/math/impl/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_MATH_IMPL_PREFIX_H 26 | #define TB_MATH_IMPL_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/math/math.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file math.h 23 | * @defgroup math 24 | * 25 | */ 26 | #ifndef TB_MATH_H 27 | #define TB_MATH_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | #include "int32.h" 34 | #include "fixed6.h" 35 | #include "fixed16.h" 36 | #include "fixed30.h" 37 | #include "fixed.h" 38 | #include "random/random.h" 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /src/tbox/math/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_MATH_PREFIX_H 26 | #define TB_MATH_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/math/random/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_MATH_RANDOM_PREFIX_H 26 | #define TB_MATH_RANDOM_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/memory/impl/impl.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file impl.h 23 | * 24 | */ 25 | #ifndef TB_MEMORY_IMPL_H 26 | #define TB_MEMORY_IMPL_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "prefix.h" 32 | #include "memory.h" 33 | #include "native_large_allocator.h" 34 | #include "static_large_allocator.h" 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/tbox/memory/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_MEMORY_PREFIX_H 26 | #define TB_MEMORY_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/network/dns/dns.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file dns.h 23 | * @ingroup network 24 | * 25 | */ 26 | #ifndef TB_NETWORK_DNS_H 27 | #define TB_NETWORK_DNS_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | #include "cache.h" 34 | #include "server.h" 35 | #include "looker.h" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/tbox/network/impl/impl.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file network.h 23 | * @ingroup network 24 | * 25 | */ 26 | #ifndef TB_NETWORK_IMPL_H 27 | #define TB_NETWORK_IMPL_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "network.h" 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/network/impl/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_NETWORK_IMPL_PREFIX_H 26 | #define TB_NETWORK_IMPL_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/network/impl/ssl/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_NETWORK_IMPL_SSL_PREFIX_H 26 | #define TB_NETWORK_IMPL_SSL_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | #include "../../ssl.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/network/network.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file network.h 23 | * @defgroup network 24 | * 25 | */ 26 | #ifndef TB_NETWORK_H 27 | #define TB_NETWORK_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | #include "ssl.h" 34 | #include "url.h" 35 | #include "ipv4.h" 36 | #include "ipv6.h" 37 | #include "ipaddr.h" 38 | #include "hwaddr.h" 39 | #include "http.h" 40 | #include "cookies.h" 41 | #include "dns/dns.h" 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/tbox/network/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_NETWORK_PREFIX_H 26 | #define TB_NETWORK_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/object/deprecated/deprecated.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file deprecated.h 23 | * 24 | */ 25 | #ifndef TB_OBJECT_DEPRECATED_H 26 | #define TB_OBJECT_DEPRECATED_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "null.h" 32 | #include "data.h" 33 | #include "date.h" 34 | #include "array.h" 35 | #include "string.h" 36 | #include "number.h" 37 | #include "boolean.h" 38 | #include "dictionary.h" 39 | 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/tbox/object/deprecated/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_OBJECT_DEPRECATED_PREFIX_H 26 | #define TB_OBJECT_DEPRECATED_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/object/impl/impl.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file impl.h 23 | * @ingroup object 24 | * 25 | */ 26 | #ifndef TB_OBJECT_IMPL_H 27 | #define TB_OBJECT_IMPL_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "object.h" 33 | #include "reader/reader.h" 34 | #include "writer/writer.h" 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/tbox/platform/android/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * @ingroup platform 24 | */ 25 | #ifndef TB_PLATFORM_ANDROID_PREFIX_H 26 | #define TB_PLATFORM_ANDROID_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | #include "../../libc/libc.h" 33 | #include "../../utils/utils.h" 34 | #include 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/tbox/platform/arch/arm/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_ARCH_ARM_PREFIX_H 26 | #define TB_PLATFORM_ARCH_ARM_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/platform/arch/arm64/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_ARCH_ARM64_PREFIX_H 26 | #define TB_PLATFORM_ARCH_ARM64_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/platform/arch/atomic.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file atomic.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_ARCH_ATOMIC_H 26 | #define TB_PLATFORM_ARCH_ATOMIC_H 27 | 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | #if defined(TB_ARCH_x86) 34 | # include "x86/atomic.h" 35 | #elif defined(TB_ARCH_x64) 36 | # include "x64/atomic.h" 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/tbox/platform/arch/barrier.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file barrier.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_ARCH_BARRIER_H 26 | #define TB_PLATFORM_ARCH_BARRIER_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "prefix.h" 32 | #if defined(TB_ARCH_x86) 33 | # include "x86/barrier.h" 34 | #elif defined(TB_ARCH_x64) 35 | # include "x64/barrier.h" 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/tbox/platform/arch/mips/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_ARCH_MIPS_PREFIX_H 26 | #define TB_PLATFORM_ARCH_MIPS_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/platform/arch/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_ARCH_PREFIX_H 26 | #define TB_PLATFORM_ARCH_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/platform/arch/x64/atomic.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file atomic.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_ARCH_x64_ATOMIC_H 26 | #define TB_PLATFORM_ARCH_x64_ATOMIC_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../x86/atomic.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/platform/arch/x64/barrier.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file barrier.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_ARCH_x64_BARRIER_H 26 | #define TB_PLATFORM_ARCH_x64_BARRIER_H 27 | 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "../x86/barrier.h" 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/platform/arch/x64/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_ARCH_x64_PREFIX_H 26 | #define TB_PLATFORM_ARCH_x64_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/platform/arch/x86/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_ARCH_x86_PREFIX_H 26 | #define TB_PLATFORM_ARCH_x86_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/platform/compiler/gcc/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_COMPILER_GCC_PREFIX_H 26 | #define TB_PLATFORM_COMPILER_GCC_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/platform/compiler/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_COMPILER_PREFIX_H 26 | #define TB_PLATFORM_COMPILER_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/platform/deprecated/deprecated.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file deprecated.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_DEPRECATED_H 26 | #define TB_PLATFORM_DEPRECATED_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "prefix.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/platform/deprecated/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_DEPRECATED_PREFIX_H 26 | #define TB_PLATFORM_DEPRECATED_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/platform/impl/impl.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file impl.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_IMPL_H 26 | #define TB_PLATFORM_IMPL_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "dns.h" 32 | #include "socket.h" 33 | #include "exception.h" 34 | #include "thread_local.h" 35 | #include "platform.h" 36 | 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/tbox/platform/impl/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_IMPL_PREFIX_H 26 | #define TB_PLATFORM_IMPL_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/platform/libc/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_LIBC_PREFIX_H 26 | #define TB_PLATFORM_LIBC_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | #include "../platform.h" 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/platform/linux/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * @ingroup platform 24 | */ 25 | #ifndef TB_PLATFORM_LINUX_PREFIX_H 26 | #define TB_PLATFORM_LINUX_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | #include "../../libc/libc.h" 33 | #include "../../utils/utils.h" 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/platform/mach/barrier.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file barrier.h 23 | * 24 | */ 25 | #ifndef TB_PLATFORM_MACH_BARRIER_H 26 | #define TB_PLATFORM_MACH_BARRIER_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "prefix.h" 32 | #include 33 | 34 | /* ////////////////////////////////////////////////////////////////////////////////////// 35 | * macros 36 | */ 37 | #define tb_barrier() OSMemoryBarrier() 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/tbox/platform/mach/ios/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * @ingroup platform 24 | */ 25 | #ifndef TB_PLATFORM_MACH_IOS_PREFIX_H 26 | #define TB_PLATFORM_MACH_IOS_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/platform/mach/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * @ingroup platform 24 | */ 25 | #ifndef TB_PLATFORM_MACH_PREFIX_H 26 | #define TB_PLATFORM_MACH_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../platform.h" 32 | #include "../../libc/libc.h" 33 | #include "../../utils/utils.h" 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/platform/memory.c: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file memory.c 23 | * @ingroup platform 24 | */ 25 | 26 | /* ////////////////////////////////////////////////////////////////////////////////////// 27 | * includes 28 | */ 29 | #include "memory.h" 30 | 31 | /* ////////////////////////////////////////////////////////////////////////////////////// 32 | * implementation 33 | */ 34 | #ifdef TB_CONFIG_OS_WINDOWS 35 | # include "windows/memory.c" 36 | #else 37 | # include "libc/memory.c" 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /src/tbox/platform/posix/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * @ingroup platform 24 | */ 25 | #ifndef TB_PLATFORM_POSIX_PREFIX_H 26 | #define TB_PLATFORM_POSIX_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../platform.h" 32 | #include "../../libc/libc.h" 33 | #include "../../utils/utils.h" 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/platform/posix/sched.c: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file sched.c 23 | * @ingroup platform 24 | * 25 | */ 26 | 27 | /* ////////////////////////////////////////////////////////////////////////////////////// 28 | * includes 29 | */ 30 | #include "../sched.h" 31 | #include 32 | 33 | /* ////////////////////////////////////////////////////////////////////////////////////// 34 | * implementation 35 | */ 36 | tb_bool_t tb_sched_yield() 37 | { 38 | // yield it in thread 39 | return !sched_yield()? tb_true : tb_false; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /src/tbox/platform/systemv/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * @ingroup platform 24 | */ 25 | #ifndef TB_PLATFORM_SYSTEMV_PREFIX_H 26 | #define TB_PLATFORM_SYSTEMV_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../platform.h" 32 | #include "../../libc/libc.h" 33 | #include "../../utils/utils.h" 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/platform/unix/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * @ingroup platform 24 | */ 25 | #ifndef TB_PLATFORM_UNIX_PREFIX_H 26 | #define TB_PLATFORM_UNIX_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | #include "../../libc/libc.h" 33 | #include "../../utils/utils.h" 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/platform/windows/exception.c: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file exception.c 23 | * @ingroup platform 24 | * 25 | */ 26 | 27 | /* ////////////////////////////////////////////////////////////////////////////////////// 28 | * includes 29 | */ 30 | #include "exception.h" 31 | 32 | /* ////////////////////////////////////////////////////////////////////////////////////// 33 | * implementation 34 | */ 35 | tb_bool_t tb_exception_init_env() 36 | { 37 | return tb_true; 38 | } 39 | tb_void_t tb_exception_exit_env() 40 | { 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/tbox/platform/windows/interface/interface.c: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file interface.c 23 | * 24 | */ 25 | 26 | /* ////////////////////////////////////////////////////////////////////////////////////// 27 | * includes 28 | */ 29 | #include "interface.h" 30 | 31 | -------------------------------------------------------------------------------- /src/tbox/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_PREFIX_H 26 | #define TB_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "prefix/prefix.h" 32 | 33 | #endif 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/tbox/prefix/config.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file config.h 23 | * 24 | */ 25 | #ifndef TB_PREFIX_CONFIG_H 26 | #define TB_PREFIX_CONFIG_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../config.h" 32 | 33 | #endif 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/tbox/prefix/x64/prefix.S: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.S 23 | * 24 | */ 25 | 26 | /* ////////////////////////////////////////////////////////////////////////////////////// 27 | * includes 28 | */ 29 | #include "../x86/prefix.S" 30 | -------------------------------------------------------------------------------- /src/tbox/regex/impl/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_REGEX_IMPL_PREFIX_H 26 | #define TB_REGEX_IMPL_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | /* ////////////////////////////////////////////////////////////////////////////////////// 34 | * types 35 | */ 36 | 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/tbox/regex/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * @ingroup regex 24 | * 25 | */ 26 | #ifndef TB_REGEX_PREFIX_H 27 | #define TB_REGEX_PREFIX_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "../prefix.h" 33 | #include "../libc/libc.h" 34 | #include "../container/container.h" 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/tbox/stream/deprecated/deprecated.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file deprecated.h 23 | * @ingroup stream 24 | * 25 | */ 26 | #ifndef TB_STREAM_DEPRECATED_H 27 | #define TB_STREAM_DEPRECATED_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | #include "async_stream.h" 34 | #include "transfer_pool.h" 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/tbox/stream/deprecated/impl/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_STREAM_DEPRECATED_IMPL_PREFIX_H 26 | #define TB_STREAM_DEPRECATED_IMPL_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/stream/deprecated/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_STREAM_DEPRECATED_PREFIX_H 26 | #define TB_STREAM_DEPRECATED_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/stream/impl/filter/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_STREAM_IMPL_FILTER_PREFIX_H 26 | #define TB_STREAM_IMPL_FILTER_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | #include "../filter.h" 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/stream/impl/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_STREAM_IMPL_PREFIX_H 26 | #define TB_STREAM_IMPL_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | #include "../stream.h" 33 | #include "../../utils/utils.h" 34 | #include "../../memory/memory.h" 35 | #include "../../string/string.h" 36 | #include "../../network/network.h" 37 | #include "../../platform/platform.h" 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/tbox/stream/impl/stream/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_STREAM_IMPL_STREAM_PREFIX_H 26 | #define TB_STREAM_IMPL_STREAM_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/tbox/string/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_STRING_PREFIX_H 26 | #define TB_STRING_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/utils/impl/impl.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file impl.h 23 | * 24 | */ 25 | #ifndef TB_UTILS_IMPL_H 26 | #define TB_UTILS_IMPL_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "singleton.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/utils/impl/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_UTILS_IMPL_PREFIX_H 26 | #define TB_UTILS_IMPL_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/tbox/utils/prefix.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file prefix.h 23 | * 24 | */ 25 | #ifndef TB_UTILS_PREFIX_H 26 | #define TB_UTILS_PREFIX_H 27 | 28 | /* ////////////////////////////////////////////////////////////////////////////////////// 29 | * includes 30 | */ 31 | #include "../prefix.h" 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/tbox/utils/used.c: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file used.c 23 | * @ingroup utils 24 | * 25 | */ 26 | 27 | /* ////////////////////////////////////////////////////////////////////////////////////// 28 | * includes 29 | */ 30 | #include "used.h" 31 | 32 | /* ////////////////////////////////////////////////////////////////////////////////////// 33 | * implementation 34 | */ 35 | tb_void_t tb_used_ptr(tb_cpointer_t variable) 36 | { 37 | } 38 | 39 | -------------------------------------------------------------------------------- /src/tbox/xml/xml.h: -------------------------------------------------------------------------------- 1 | /*!The Treasure Box Library 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Copyright (C) 2009 - 2017, TBOOX Open Source Group. 20 | * 21 | * @author ruki 22 | * @file xml.h 23 | * @defgroup xml 24 | * 25 | */ 26 | #ifndef TB_XML_H 27 | #define TB_XML_H 28 | 29 | /* ////////////////////////////////////////////////////////////////////////////////////// 30 | * includes 31 | */ 32 | #include "prefix.h" 33 | #include "node.h" 34 | #include "reader.h" 35 | #include "writer.h" 36 | 37 | #endif 38 | --------------------------------------------------------------------------------