├── test ├── fuzznames │ ├── name01 │ ├── name02 │ ├── name07 │ ├── name06 │ ├── name08 │ ├── name05 │ ├── name04 │ ├── name09 │ └── name03 ├── buildconf ├── gmock-1.7.0 │ ├── scripts │ │ └── generator │ │ │ ├── cpp │ │ │ ├── __init__.py │ │ │ ├── utils.py │ │ │ └── keywords.py │ │ │ ├── gmock_gen.py │ │ │ └── README │ ├── gtest │ │ ├── xcode │ │ │ ├── Config │ │ │ │ ├── TestTarget.xcconfig │ │ │ │ ├── FrameworkTarget.xcconfig │ │ │ │ ├── StaticLibraryTarget.xcconfig │ │ │ │ ├── DebugProject.xcconfig │ │ │ │ ├── ReleaseProject.xcconfig │ │ │ │ └── General.xcconfig │ │ │ ├── Samples │ │ │ │ └── FrameworkSample │ │ │ │ │ └── Info.plist │ │ │ └── Resources │ │ │ │ └── Info.plist │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── test │ │ │ ├── production.cc │ │ │ ├── gtest_main_unittest.cc │ │ │ ├── gtest_uninitialized_test_.cc │ │ │ ├── gtest_xml_outfile1_test_.cc │ │ │ ├── gtest_xml_outfile2_test_.cc │ │ │ ├── gtest-typed-test2_test.cc │ │ │ └── gtest_help_test_.cc │ │ ├── src │ │ │ ├── gtest_main.cc │ │ │ └── gtest-all.cc │ │ ├── fused-src │ │ │ └── gtest │ │ │ │ └── gtest_main.cc │ │ ├── codegear │ │ │ ├── gtest_all.cc │ │ │ ├── gtest_link.cc │ │ │ └── gtest.groupproj │ │ ├── samples │ │ │ ├── sample4_unittest.cc │ │ │ ├── sample1.h │ │ │ ├── sample4.cc │ │ │ └── sample4.h │ │ └── build-aux │ │ │ └── config.h.in │ ├── msvc │ │ ├── 2005 │ │ │ ├── gmock_config.vsprops │ │ │ └── gmock.sln │ │ └── 2010 │ │ │ ├── gmock_config.props │ │ │ └── gmock.sln │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── test │ │ ├── gmock_link2_test.cc │ │ ├── gmock_link_test.cc │ │ └── gmock-port_test.cc │ ├── build-aux │ │ └── config.h.in │ └── src │ │ └── gmock-all.cc ├── fuzzinput │ ├── answer_a │ ├── answer_aaaa │ ├── 182cad2a342ed7317b7c21a5d17020d1 │ ├── 004a216d3cff18b0c5c6b68b807f1529 │ ├── 00539467ca159b36aea95e61f9729115 │ ├── 00e846db8f43f2f507cd1666ed5a753e │ ├── 0177b7566f08c013699eaea9a77abeb3 │ ├── 020a4fa317715bfdb236ed13751e6b65 │ ├── 0310f2e81bea31f4fe3f330872a877dd │ ├── 0449be67df1730b2d0887d412a9b7cc4 │ ├── 0449dd14f7aa94bf0d716bfe09b287a8 │ ├── 04c93cdf7208979aa4df80a3a0d5a2d8 │ ├── 0567e7171e08e75f3f91c4ca74c17adc │ ├── 05ba948578a397e9cbc6a7b3e78622fa │ ├── 060afe5ed25f3e2e86167e545f27edca │ ├── 06d47d3681493f1b1d41236f460d896f │ ├── 0724a810b0e131c2fddb6de9003b9064 │ ├── 0b5279148826f5b962bcf1896bdb4ede │ ├── 114048c0f6b10bdc67ce9166405d195e │ ├── 11b8464a0ef8735d202955c34c36b0c7 │ ├── 11cb626f1668c7b41954ce7d768fe528 │ ├── 14b133bf18125b75a1976fa63a1df6b7 │ ├── 153c6b3afa8faa03c8bc28f936a6d4cf │ ├── 1c61a61bb7057b52c5b15188345a5238 │ ├── 1dbe2cf62ed2e4fa1c3cb473f08710b5 │ ├── 21199be504fcfece5c7096ee0dbba507 │ ├── 21891480074b5635dbbe7137bdcabccd │ ├── 233aea42e15aa73e131eefabf16088c9 │ ├── 24660d4e7ac7aa21d600ea7a3d198bbb │ ├── 25589deb55c08429345f289d1c9b0254 │ ├── 2573bd823e4da11f727a17f8e1f35c26 │ ├── 276f12da56866273e76059ad0e7be97e │ ├── 29198a2e380cb19babec9e02116d213e │ ├── 2c94ba9434b1a1b9396fc5364f101363 │ ├── 2d578c357dc2f5e02dc55cddb30641d1 │ ├── 2dff6cc5a223e67fde9e5e79af456992 │ ├── 2f103b1f9477f2d8934bd84328d51c75 │ ├── 31cd3a8413de13d9624adbb1613784bf │ ├── 36415bdf1d180098fe6234b4186e69f3 │ ├── 3a04a80f0242e8dff0cd732e7c4767da │ ├── 44d0f973b7b0fb3e4a07770c943dcd5a │ ├── 50bc00daa0ddcd6cfb2b5d9f62c81f47 │ ├── 51ed2d1fb77b3078b54e94e85606b7df │ ├── 5c5e0e899cf2e7d053a9e45fb76f6e5a │ ├── 70152ed033f139443fbfb1b858bb3b1b │ ├── 7030ca2b24e5a7f9dd8f62096a48eb33 │ ├── 71eec1a0ef2d25bb9e2ef17f23be7e9e │ ├── 7a6b0177210ea4ef40b254daf99393c5 │ ├── 7f1567733711ffb61839621af0cbfa33 │ ├── 850c6d57c5bb7be8205fc2438d14d7e5 │ ├── a5c8cd2784a5792b9e91c2d7895b3b34 │ ├── a9135cdc7151d023300ff194bad90af9 │ ├── af2597e8ac7dec1e8b4a47518312912a │ ├── b3f53ef826b831bb09dd25c7f5960249 │ ├── cda0f8751f5c4993974c2b549d29bcc8 │ ├── ce6c26c0e469339873d0e7f616ab0945 │ ├── e4dd7e7c2dd4ed7c2e17a6af5d04f9c9 │ ├── ed50ed8ee36230a5a69746ad830437e5 │ ├── f1b900d50806021953321c3b604ee497 │ ├── f89f6c8176b564a7dd646f14305573ce │ └── f9ad508d2dbd08d3aaaabc7d1174677d ├── fuzzcheck.sh ├── .gitignore ├── configure.ac ├── ares-test-fuzz-name.c ├── Makefile.inc ├── dns-dump.cc ├── ares-test-main.cc ├── ares-test-fuzz.c ├── Makefile.m32 └── ares-fuzz.c ├── ares_get_servers_ports.3 ├── ares_set_servers_ports.3 ├── CHANGES.0 ├── ares_set_servers_ports_csv.3 ├── cares.rc ├── acountry.c ├── m4 ├── .gitignore ├── ax_check_user_namespace.m4 ├── cares-override.m4 └── ax_check_uts_namespace.m4 ├── travis ├── covupload.sh ├── test.sh ├── distcheck.sh └── build.sh ├── ares_version.c ├── CHANGES ├── GIT-INFO ├── windows_port.c ├── c-ares-config.cmake.in ├── vc ├── cares │ └── vc6cares.dsw └── vc6aws.dsw ├── libcares.pc.in ├── appveyor.yml ├── README.cares ├── ares_version.h ├── CONTRIBUTING.md ├── .gitignore ├── TODO ├── LICENSE.md ├── NEWS ├── ares_free_string.c ├── ares_strdup.h ├── ares_getenv.c ├── ares_getenv.h ├── bitncmp.h ├── ares_mkquery.c ├── ares_build.h.cmake ├── ares_inet_net_pton.h ├── ares_strcasecmp.h ├── ares_set_socket_callback.3 ├── ares_writev.h ├── get_ver.awk ├── ares_free_string.3 ├── ares_platform.h ├── ares_set_socket_configure_callback.3 ├── ares_library_initialized.3 ├── ares_set_local_ip4.3 ├── ares_llist.h ├── ares_destroy_options.3 ├── ares_free_hostent.c ├── ares_strerror.3 ├── ares_set_local_ip6.3 ├── ares_strdup.c ├── ares_version.3 ├── ares_dup.3 ├── AUTHORS ├── ares_destroy.3 ├── ares_library_init.h ├── ares_set_local_dev.3 ├── ares_cancel.3 ├── ares_free_hostent.3 ├── bitncmp.c ├── ares_inet_pton.3 ├── ares_strcasecmp.c ├── acountry.1 ├── ares_nowarn.h ├── Makefile.dj ├── RELEASE-NOTES ├── git2changes.pl ├── ares_fds.3 ├── ares_timeout.3 ├── ares_llist.c ├── ares_strerror.c ├── ares_writev.c ├── ares_inet_ntop.3 ├── ares_expand_string.c ├── ares_fds.c ├── Makefile.m32 ├── ahost.1 ├── ares__close_sockets.c ├── ares_set_sortlist.3 ├── ares_getopt.h ├── ares_expand_string.3 ├── ares_ipv6.h └── ares_parse_ns_reply.3 /test/fuzznames/name01: -------------------------------------------------------------------------------- 1 | normal.name -------------------------------------------------------------------------------- /test/fuzznames/name02: -------------------------------------------------------------------------------- 1 | singlelabel -------------------------------------------------------------------------------- /test/fuzznames/name07: -------------------------------------------------------------------------------- 1 | empty..label -------------------------------------------------------------------------------- /test/fuzznames/name06: -------------------------------------------------------------------------------- 1 | absolute.name. -------------------------------------------------------------------------------- /test/fuzznames/name08: -------------------------------------------------------------------------------- 1 | utf8.££.data.com -------------------------------------------------------------------------------- /test/buildconf: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | autoreconf -iv -------------------------------------------------------------------------------- /test/fuzznames/name05: -------------------------------------------------------------------------------- 1 | escaped.dot.at.end\. -------------------------------------------------------------------------------- /test/fuzznames/name04: -------------------------------------------------------------------------------- 1 | labelwithescaped\.dot.dot -------------------------------------------------------------------------------- /test/fuzznames/name09: -------------------------------------------------------------------------------- 1 | astral.plane.utf8.name.𐀀.org -------------------------------------------------------------------------------- /test/gmock-1.7.0/scripts/generator/cpp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ares_get_servers_ports.3: -------------------------------------------------------------------------------- 1 | .so man3/ares_get_servers.3 2 | -------------------------------------------------------------------------------- /ares_set_servers_ports.3: -------------------------------------------------------------------------------- 1 | .so man3/ares_set_servers.3 2 | -------------------------------------------------------------------------------- /CHANGES.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/CHANGES.0 -------------------------------------------------------------------------------- /ares_set_servers_ports_csv.3: -------------------------------------------------------------------------------- 1 | .so man3/ares_set_servers_csv.3 2 | -------------------------------------------------------------------------------- /cares.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/cares.rc -------------------------------------------------------------------------------- /acountry.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/acountry.c -------------------------------------------------------------------------------- /test/fuzzinput/answer_a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/answer_a -------------------------------------------------------------------------------- /test/fuzzinput/answer_aaaa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/answer_aaaa -------------------------------------------------------------------------------- /test/fuzzinput/182cad2a342ed7317b7c21a5d17020d1: -------------------------------------------------------------------------------- 1 | (܄wwwfirstcomwwwfirstcom -------------------------------------------------------------------------------- /test/fuzznames/name03: -------------------------------------------------------------------------------- 1 | www.labelismuchtoolong012345678901234567890123456789012345678901234567890123456789.com 2 | -------------------------------------------------------------------------------- /m4/.gitignore: -------------------------------------------------------------------------------- 1 | libtool.m4 2 | libtool.m4.tmp 3 | ltoptions.m4 4 | ltsugar.m4 5 | ltversion.m4 6 | lt~obsolete.m4 7 | -------------------------------------------------------------------------------- /test/fuzzcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Check that all of the base fuzzing corpus parse without errors 3 | ./aresfuzz fuzzinput/* 4 | -------------------------------------------------------------------------------- /test/fuzzinput/004a216d3cff18b0c5c6b68b807f1529: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/004a216d3cff18b0c5c6b68b807f1529 -------------------------------------------------------------------------------- /test/fuzzinput/00539467ca159b36aea95e61f9729115: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/00539467ca159b36aea95e61f9729115 -------------------------------------------------------------------------------- /test/fuzzinput/00e846db8f43f2f507cd1666ed5a753e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/00e846db8f43f2f507cd1666ed5a753e -------------------------------------------------------------------------------- /test/fuzzinput/0177b7566f08c013699eaea9a77abeb3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/0177b7566f08c013699eaea9a77abeb3 -------------------------------------------------------------------------------- /test/fuzzinput/020a4fa317715bfdb236ed13751e6b65: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/020a4fa317715bfdb236ed13751e6b65 -------------------------------------------------------------------------------- /test/fuzzinput/0310f2e81bea31f4fe3f330872a877dd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/0310f2e81bea31f4fe3f330872a877dd -------------------------------------------------------------------------------- /test/fuzzinput/0449be67df1730b2d0887d412a9b7cc4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/0449be67df1730b2d0887d412a9b7cc4 -------------------------------------------------------------------------------- /test/fuzzinput/0449dd14f7aa94bf0d716bfe09b287a8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/0449dd14f7aa94bf0d716bfe09b287a8 -------------------------------------------------------------------------------- /test/fuzzinput/04c93cdf7208979aa4df80a3a0d5a2d8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/04c93cdf7208979aa4df80a3a0d5a2d8 -------------------------------------------------------------------------------- /test/fuzzinput/0567e7171e08e75f3f91c4ca74c17adc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/0567e7171e08e75f3f91c4ca74c17adc -------------------------------------------------------------------------------- /test/fuzzinput/05ba948578a397e9cbc6a7b3e78622fa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/05ba948578a397e9cbc6a7b3e78622fa -------------------------------------------------------------------------------- /test/fuzzinput/060afe5ed25f3e2e86167e545f27edca: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/060afe5ed25f3e2e86167e545f27edca -------------------------------------------------------------------------------- /test/fuzzinput/06d47d3681493f1b1d41236f460d896f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/06d47d3681493f1b1d41236f460d896f -------------------------------------------------------------------------------- /test/fuzzinput/0724a810b0e131c2fddb6de9003b9064: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/0724a810b0e131c2fddb6de9003b9064 -------------------------------------------------------------------------------- /test/fuzzinput/0b5279148826f5b962bcf1896bdb4ede: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/0b5279148826f5b962bcf1896bdb4ede -------------------------------------------------------------------------------- /test/fuzzinput/114048c0f6b10bdc67ce9166405d195e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/114048c0f6b10bdc67ce9166405d195e -------------------------------------------------------------------------------- /test/fuzzinput/11b8464a0ef8735d202955c34c36b0c7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/11b8464a0ef8735d202955c34c36b0c7 -------------------------------------------------------------------------------- /test/fuzzinput/11cb626f1668c7b41954ce7d768fe528: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/11cb626f1668c7b41954ce7d768fe528 -------------------------------------------------------------------------------- /test/fuzzinput/14b133bf18125b75a1976fa63a1df6b7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/14b133bf18125b75a1976fa63a1df6b7 -------------------------------------------------------------------------------- /test/fuzzinput/153c6b3afa8faa03c8bc28f936a6d4cf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/153c6b3afa8faa03c8bc28f936a6d4cf -------------------------------------------------------------------------------- /test/fuzzinput/1c61a61bb7057b52c5b15188345a5238: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/1c61a61bb7057b52c5b15188345a5238 -------------------------------------------------------------------------------- /test/fuzzinput/1dbe2cf62ed2e4fa1c3cb473f08710b5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/1dbe2cf62ed2e4fa1c3cb473f08710b5 -------------------------------------------------------------------------------- /test/fuzzinput/21199be504fcfece5c7096ee0dbba507: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/21199be504fcfece5c7096ee0dbba507 -------------------------------------------------------------------------------- /test/fuzzinput/21891480074b5635dbbe7137bdcabccd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/21891480074b5635dbbe7137bdcabccd -------------------------------------------------------------------------------- /test/fuzzinput/233aea42e15aa73e131eefabf16088c9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/233aea42e15aa73e131eefabf16088c9 -------------------------------------------------------------------------------- /test/fuzzinput/24660d4e7ac7aa21d600ea7a3d198bbb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/24660d4e7ac7aa21d600ea7a3d198bbb -------------------------------------------------------------------------------- /test/fuzzinput/25589deb55c08429345f289d1c9b0254: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/25589deb55c08429345f289d1c9b0254 -------------------------------------------------------------------------------- /test/fuzzinput/2573bd823e4da11f727a17f8e1f35c26: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/2573bd823e4da11f727a17f8e1f35c26 -------------------------------------------------------------------------------- /test/fuzzinput/276f12da56866273e76059ad0e7be97e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/276f12da56866273e76059ad0e7be97e -------------------------------------------------------------------------------- /test/fuzzinput/29198a2e380cb19babec9e02116d213e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/29198a2e380cb19babec9e02116d213e -------------------------------------------------------------------------------- /test/fuzzinput/2c94ba9434b1a1b9396fc5364f101363: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/2c94ba9434b1a1b9396fc5364f101363 -------------------------------------------------------------------------------- /test/fuzzinput/2d578c357dc2f5e02dc55cddb30641d1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/2d578c357dc2f5e02dc55cddb30641d1 -------------------------------------------------------------------------------- /test/fuzzinput/2dff6cc5a223e67fde9e5e79af456992: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/2dff6cc5a223e67fde9e5e79af456992 -------------------------------------------------------------------------------- /test/fuzzinput/2f103b1f9477f2d8934bd84328d51c75: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/2f103b1f9477f2d8934bd84328d51c75 -------------------------------------------------------------------------------- /test/fuzzinput/31cd3a8413de13d9624adbb1613784bf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/31cd3a8413de13d9624adbb1613784bf -------------------------------------------------------------------------------- /test/fuzzinput/36415bdf1d180098fe6234b4186e69f3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/36415bdf1d180098fe6234b4186e69f3 -------------------------------------------------------------------------------- /test/fuzzinput/3a04a80f0242e8dff0cd732e7c4767da: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/3a04a80f0242e8dff0cd732e7c4767da -------------------------------------------------------------------------------- /test/fuzzinput/44d0f973b7b0fb3e4a07770c943dcd5a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/44d0f973b7b0fb3e4a07770c943dcd5a -------------------------------------------------------------------------------- /test/fuzzinput/50bc00daa0ddcd6cfb2b5d9f62c81f47: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/50bc00daa0ddcd6cfb2b5d9f62c81f47 -------------------------------------------------------------------------------- /test/fuzzinput/51ed2d1fb77b3078b54e94e85606b7df: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/51ed2d1fb77b3078b54e94e85606b7df -------------------------------------------------------------------------------- /test/fuzzinput/5c5e0e899cf2e7d053a9e45fb76f6e5a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/5c5e0e899cf2e7d053a9e45fb76f6e5a -------------------------------------------------------------------------------- /test/fuzzinput/70152ed033f139443fbfb1b858bb3b1b: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/70152ed033f139443fbfb1b858bb3b1b -------------------------------------------------------------------------------- /test/fuzzinput/7030ca2b24e5a7f9dd8f62096a48eb33: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/7030ca2b24e5a7f9dd8f62096a48eb33 -------------------------------------------------------------------------------- /test/fuzzinput/71eec1a0ef2d25bb9e2ef17f23be7e9e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/71eec1a0ef2d25bb9e2ef17f23be7e9e -------------------------------------------------------------------------------- /test/fuzzinput/7a6b0177210ea4ef40b254daf99393c5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/7a6b0177210ea4ef40b254daf99393c5 -------------------------------------------------------------------------------- /test/fuzzinput/7f1567733711ffb61839621af0cbfa33: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/7f1567733711ffb61839621af0cbfa33 -------------------------------------------------------------------------------- /test/fuzzinput/850c6d57c5bb7be8205fc2438d14d7e5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/850c6d57c5bb7be8205fc2438d14d7e5 -------------------------------------------------------------------------------- /test/fuzzinput/a5c8cd2784a5792b9e91c2d7895b3b34: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/a5c8cd2784a5792b9e91c2d7895b3b34 -------------------------------------------------------------------------------- /test/fuzzinput/a9135cdc7151d023300ff194bad90af9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/a9135cdc7151d023300ff194bad90af9 -------------------------------------------------------------------------------- /test/fuzzinput/af2597e8ac7dec1e8b4a47518312912a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/af2597e8ac7dec1e8b4a47518312912a -------------------------------------------------------------------------------- /test/fuzzinput/b3f53ef826b831bb09dd25c7f5960249: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/b3f53ef826b831bb09dd25c7f5960249 -------------------------------------------------------------------------------- /test/fuzzinput/cda0f8751f5c4993974c2b549d29bcc8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/cda0f8751f5c4993974c2b549d29bcc8 -------------------------------------------------------------------------------- /test/fuzzinput/ce6c26c0e469339873d0e7f616ab0945: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/ce6c26c0e469339873d0e7f616ab0945 -------------------------------------------------------------------------------- /test/fuzzinput/e4dd7e7c2dd4ed7c2e17a6af5d04f9c9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/e4dd7e7c2dd4ed7c2e17a6af5d04f9c9 -------------------------------------------------------------------------------- /test/fuzzinput/ed50ed8ee36230a5a69746ad830437e5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/ed50ed8ee36230a5a69746ad830437e5 -------------------------------------------------------------------------------- /test/fuzzinput/f1b900d50806021953321c3b604ee497: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/f1b900d50806021953321c3b604ee497 -------------------------------------------------------------------------------- /test/fuzzinput/f89f6c8176b564a7dd646f14305573ce: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/f89f6c8176b564a7dd646f14305573ce -------------------------------------------------------------------------------- /test/fuzzinput/f9ad508d2dbd08d3aaaabc7d1174677d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceph/c-ares/master/test/fuzzinput/f9ad508d2dbd08d3aaaabc7d1174677d -------------------------------------------------------------------------------- /travis/covupload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | if [ "$BUILD_TYPE" = "coverage" ]; then 4 | coveralls --gcov /usr/bin/gcov-4.8 --gcov-options '\-lp' 5 | fi 6 | -------------------------------------------------------------------------------- /ares_version.c: -------------------------------------------------------------------------------- 1 | 2 | #include "ares_setup.h" 3 | #include "ares.h" 4 | 5 | const char *ares_version(int *version) 6 | { 7 | if(version) 8 | *version = ARES_VERSION; 9 | 10 | return ARES_VERSION_STR; 11 | } 12 | -------------------------------------------------------------------------------- /CHANGES: -------------------------------------------------------------------------------- 1 | This file no longer holds the changelog. Now you can generate it yourself 2 | like this: 3 | 4 | $ git log --pretty=fuller --no-color --date=short --decorate=full -1000 | 5 | ./git2changes.pl 6 | 7 | The older, manually edited, changelog is found in git named CHANGES.0 8 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/xcode/Config/TestTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // TestTarget.xcconfig 3 | // 4 | // These are Test target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | 7 | PRODUCT_NAME = $(TARGET_NAME) 8 | HEADER_SEARCH_PATHS = ../include 9 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | libgtest.a 3 | libgmock.a 4 | arestest 5 | aresfuzz 6 | aresfuzzname 7 | arestest.log 8 | arestest.trs 9 | fuzzcheck.sh.log 10 | fuzzcheck.sh.trs 11 | test-suite.log 12 | fuzzoutput 13 | config.h.in 14 | config.h 15 | dnsdump 16 | ares-libfuzzer 17 | ares-libfuzzer-name 18 | libFuzzer.a 19 | Fuzzer -------------------------------------------------------------------------------- /travis/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | if [ "$BUILD_TYPE" != "ios" -a "$BUILD_TYPE" != "analyse" -a "$BUILD_TYPE" != "cmake" ]; then 4 | $TEST_WRAP ./adig www.google.com 5 | $TEST_WRAP ./acountry www.google.com 6 | $TEST_WRAP ./ahost www.google.com 7 | cd test 8 | make 9 | $TEST_WRAP ./arestest -v $TEST_FILTER 10 | ./fuzzcheck.sh 11 | cd .. 12 | fi 13 | -------------------------------------------------------------------------------- /GIT-INFO: -------------------------------------------------------------------------------- 1 | 2 | GIT-INFO 3 | 4 | This file is only present in git - never in release archives. It is used as a 5 | sentinel file in buildconf.bat in order to differentiate a git checkout from 6 | release and daily snapshot archives. 7 | 8 | On *nix-like systems, run the ./buildconf script first to generate a fresh 9 | configure script. This requires autotools to be installed locally. 10 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/msvc/2005/gmock_config.vsprops: -------------------------------------------------------------------------------- 1 | 2 | 7 | 11 | 15 | 16 | -------------------------------------------------------------------------------- /travis/distcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if [ "$BUILD_TYPE" = "normal" -a "$TRAVIS_OS_NAME" = "linux" ]; then 5 | ./maketgz 99.98.97 6 | tar xvf c-ares-99.98.97.tar.gz 7 | cd c-ares-99.98.97 8 | ./configure --disable-symbol-hiding --enable-expose-statics --enable-maintainer-mode --enable-debug 9 | make 10 | 11 | cd test 12 | make 13 | $TEST_WRAP ./arestest -v $TEST_FILTER 14 | cd .. 15 | 16 | cd .. 17 | fi 18 | -------------------------------------------------------------------------------- /windows_port.c: -------------------------------------------------------------------------------- 1 | #include "ares_setup.h" 2 | 3 | 4 | /* only do the following on windows 5 | */ 6 | #if (defined(WIN32) || defined(WATT32)) && !defined(MSDOS) 7 | 8 | #ifdef __WATCOMC__ 9 | /* 10 | * Watcom needs a DllMain() in order to initialise the clib startup code. 11 | */ 12 | BOOL 13 | WINAPI DllMain (HINSTANCE hnd, DWORD reason, LPVOID reserved) 14 | { 15 | (void) hnd; 16 | (void) reason; 17 | (void) reserved; 18 | return (TRUE); 19 | } 20 | #endif 21 | 22 | #endif /* WIN32 builds only */ 23 | -------------------------------------------------------------------------------- /travis/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if [ "$BUILD_TYPE" != "cmake" ]; then 5 | ./buildconf 6 | $SCAN_WRAP ./configure --disable-symbol-hiding --enable-expose-statics --enable-maintainer-mode --enable-debug $CONFIG_OPTS 7 | $SCAN_WRAP make 8 | else 9 | mkdir cmakebld 10 | cd cmakebld 11 | cmake -DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON .. 12 | make 13 | ./bin/adig www.google.com 14 | ./bin/acountry www.google.com 15 | ./bin/ahost www.google.com 16 | cd .. 17 | fi 18 | -------------------------------------------------------------------------------- /c-ares-config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | set_and_check(c-ares_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") 4 | 5 | include("${CMAKE_CURRENT_LIST_DIR}/c-ares-targets.cmake") 6 | 7 | set(c-ares_LIBRARY c-ares::cares) 8 | 9 | if(@CARES_SHARED@) 10 | add_library(c-ares::cares_shared ALIAS c-ares::cares) 11 | set(c-ares_SHARED_LIBRARY c-ares::cares_shared) 12 | elseif(@CARES_STATIC@) 13 | add_library(c-ares::cares_static ALIAS c-ares::cares) 14 | endif() 15 | 16 | if(@CARES_STATIC@) 17 | set(c-ares_STATIC_LIBRARY c-ares::cares_static) 18 | endif() 19 | -------------------------------------------------------------------------------- /test/configure.ac: -------------------------------------------------------------------------------- 1 | AC_PREREQ(2.57) 2 | AC_INIT([c-ares-test],[-],[-]) 3 | AC_CONFIG_SRCDIR([ares-test.cc]) 4 | AC_CONFIG_MACRO_DIR([../m4]) 5 | 6 | AM_INIT_AUTOMAKE([no-define]) 7 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 8 | 9 | dnl Checks for programs. 10 | AC_PROG_CXX 11 | AX_CXX_COMPILE_STDCXX_11([noext],[mandatory]) 12 | LT_INIT 13 | AC_SUBST(LIBTOOL_DEPS) 14 | AX_PTHREAD 15 | AX_CODE_COVERAGE 16 | AX_CHECK_USER_NAMESPACE 17 | AX_CHECK_UTS_NAMESPACE 18 | 19 | AC_CHECK_HEADERS(netdb.h netinet/tcp.h) 20 | AC_CONFIG_HEADERS([config.h]) 21 | AC_CONFIG_FILES([Makefile]) 22 | AC_OUTPUT 23 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/xcode/Config/FrameworkTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // FrameworkTarget.xcconfig 3 | // 4 | // These are Framework target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Dynamic libs need to be position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Dynamic libs should not have their external symbols stripped. 14 | STRIP_STYLE = non-global 15 | 16 | // Let the user install by specifying the $DSTROOT with xcodebuild 17 | SKIP_INSTALL = NO 18 | -------------------------------------------------------------------------------- /vc/cares/vc6cares.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "cares"=".\vc6cares.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /libcares.pc.in: -------------------------------------------------------------------------------- 1 | #*************************************************************************** 2 | # Project ___ __ _ _ __ ___ ___ 3 | # / __|____ / _` | '__/ _ \/ __| 4 | # | (_|_____| (_| | | | __/\__ \ 5 | # \___| \__,_|_| \___||___/ 6 | # 7 | prefix=@prefix@ 8 | exec_prefix=@exec_prefix@ 9 | libdir=@libdir@ 10 | includedir=@includedir@ 11 | 12 | Name: c-ares 13 | URL: http://daniel.haxx.se/projects/c-ares/ 14 | Description: asynchronous DNS lookup library 15 | Version: @VERSION@ 16 | Requires: 17 | Requires.private: 18 | Cflags: -I${includedir} @CPPFLAG_CARES_STATICLIB@ 19 | Libs: -L${libdir} -lcares 20 | Libs.private: @CARES_PRIVATE_LIBS@ 21 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | platform: 2 | - x64 3 | - x86 4 | - mingw 5 | build_script: 6 | - if "%platform%" == "x86" call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" 7 | - if "%platform%" == "x64" "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 8 | - if "%platform%" == "x64" call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64 9 | - if "%platform%" == "mingw" set PATH=%PATH%;C:\MinGW\bin;C:\MinGW\MSYS\1.0\local\bin;C:\MinGW\MSYS\1.0\bin 10 | - copy ares_build.h.dist ares_build.h 11 | - if "%platform%" == "mingw" ( make -f Makefile.m32 demos ) else ( nmake /f Makefile.msvc ) 12 | - cd test 13 | - if "%platform%" == "mingw" ( make -f Makefile.m32 ) else ( nmake /f Makefile.msvc vtest ) 14 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/xcode/Config/StaticLibraryTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // StaticLibraryTarget.xcconfig 3 | // 4 | // These are static library target settings for libgtest.a. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Static libs can be included in bundles so make them position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Static libs should not have their internal globals or external symbols 14 | // stripped. 15 | STRIP_STYLE = debugging 16 | 17 | // Let the user install by specifying the $DSTROOT with xcodebuild 18 | SKIP_INSTALL = NO 19 | -------------------------------------------------------------------------------- /test/ares-test-fuzz-name.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "ares.h" 6 | // Include ares internal file for DNS protocol constants 7 | #include "nameser.h" 8 | 9 | // Entrypoint for Clang's libfuzzer, exercising query creation. 10 | int LLVMFuzzerTestOneInput(const unsigned char *data, 11 | unsigned long size) { 12 | // Null terminate the data. 13 | char *name = malloc(size + 1); 14 | name[size] = '\0'; 15 | memcpy(name, data, size); 16 | 17 | unsigned char *buf = NULL; 18 | int buflen = 0; 19 | ares_create_query(name, ns_c_in, ns_t_aaaa, 1234, 0, &buf, &buflen, 1024); 20 | free(buf); 21 | free(name); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /README.cares: -------------------------------------------------------------------------------- 1 | c-ares 2 | ====== 3 | 4 | This package is based on ares 1.1.1 (written by Greg Hudson). Daniel Stenberg 5 | decided to fork and release a separate project since the original ares author 6 | didn't want the improvements that were vital for our use of it. 7 | 8 | This package is dubbed 'c-ares' since Daniel wanted this for use within the 9 | curl project (hence the letter C) and it makes a nice pun. c-ares is not API 10 | compatible with ares: a new name makes that more obvious to the public. 11 | 12 | The original libares was distributed at 13 | ftp://athena-dist.mit.edu:pub/ATHENA/ares (which seems to not be alive 14 | anymore). A local copy of the original ares package is kept here: 15 | https://c-ares.haxx.se/download/ares-1.1.1.tar.gz 16 | -------------------------------------------------------------------------------- /ares_version.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ARES__VERSION_H 3 | #define ARES__VERSION_H 4 | 5 | /* This is the global package copyright */ 6 | #define ARES_COPYRIGHT "2004 - 2016 Daniel Stenberg, ." 7 | 8 | #define ARES_VERSION_MAJOR 1 9 | #define ARES_VERSION_MINOR 12 10 | #define ARES_VERSION_PATCH 1 11 | #define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\ 12 | (ARES_VERSION_MINOR<<8)|\ 13 | (ARES_VERSION_PATCH)) 14 | #define ARES_VERSION_STR "1.12.1-DEV" 15 | 16 | #if (ARES_VERSION >= 0x010700) 17 | # define CARES_HAVE_ARES_LIBRARY_INIT 1 18 | # define CARES_HAVE_ARES_LIBRARY_CLEANUP 1 19 | #else 20 | # undef CARES_HAVE_ARES_LIBRARY_INIT 21 | # undef CARES_HAVE_ARES_LIBRARY_CLEANUP 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing to c-ares 2 | ====================== 3 | 4 | To contribute patches to c-ares, please generate a GitHub pull request 5 | and follow these guidelines: 6 | 7 | - Check that the Travis builds are green for your pull request. 8 | - Please update the test suite to add a test case for any new functionality. 9 | - Build the library with `./configure --enable-debug --enable-maintainer-mode` and 10 | ensure there are no new warnings. 11 | 12 | To improve the chances of the c-ares maintainers responding to your request: 13 | 14 | - Also send an email to the mailing list at `c-ares@cool.haxx.se` describing your change. 15 | - To follow any associated discussion, please subscribe to the [mailing list](http://cool.haxx.se/mailman/listinfo/c-ares). 16 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/msvc/2010/gmock_config.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ../../gtest 5 | 6 | 7 | <_ProjectFileVersion>10.0.30319.1 8 | 9 | 10 | 11 | $(GTestDir)/include;%(AdditionalIncludeDirectories) 12 | 13 | 14 | 15 | 16 | $(GTestDir) 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .deps 2 | .libs 3 | *.lib 4 | *.pdb 5 | *.dll 6 | *.exe 7 | *.obj 8 | .*.swp 9 | Debug 10 | Release 11 | *.exp 12 | Makefile 13 | Makefile.in 14 | aclocal.m4 15 | autom4te.cache 16 | config.guess 17 | config.log 18 | config.status 19 | config.sub 20 | configure 21 | depcomp 22 | libtool 23 | ltmain.sh 24 | compile 25 | libcares.pc 26 | missing 27 | test-driver 28 | c-ares-*.tar.gz 29 | INSTALL 30 | install-sh 31 | *.o 32 | *.lo 33 | *.la 34 | *.gcno 35 | *.gcda 36 | *.gcov 37 | c-ares---coverage.info 38 | c-ares---coverage 39 | mkinstalldirs 40 | tags 41 | TAGS 42 | *~ 43 | aclocal.m4.bak 44 | acountry 45 | adig 46 | ahost 47 | ares_build.h 48 | ares_config.h 49 | ares_config.h.in 50 | stamp-h1 51 | stamp-h2 52 | ares_*pdf 53 | CHANGES.dist 54 | c-ares-*.tar.gz.asc 55 | ares_parse_mx_reply.pdf 56 | /[0-9]*.patch 57 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 4 | ares_reinit() 5 | 6 | - To allow an app to force a re-read of /etc/resolv.conf etc, pretty much 7 | like the res_init() resolver function offers 8 | 9 | ares_gethostbyname 10 | 11 | - When built to support IPv6, it needs to also support PF_UNSPEC or similar, 12 | so that an application can ask for any protocol and then c-ares would return 13 | all known resolves and not just explicitly IPv4 _or_ IPv6 resolves. 14 | 15 | ares_process 16 | 17 | - Upon next ABI breakage ares_process() should be changed to return 'int' 18 | and return ARES_ENOTINITIALIZED if ares_library_init() has not been called. 19 | 20 | ares_process_fd 21 | 22 | - Upon next ABI breakage ares_process_fd() should be changed to return 23 | 'int' and return ARES_ENOTINITIALIZED if library has not been initialized. 24 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # c-ares license 2 | 3 | Copyright (c) 2007 - 2016, Daniel Stenberg with many contributors, see AUTHORS 4 | file. 5 | 6 | Copyright 1998 by the Massachusetts Institute of Technology. 7 | 8 | Permission to use, copy, modify, and distribute this software and its 9 | documentation for any purpose and without fee is hereby granted, provided that 10 | the above copyright notice appear in all copies and that both that copyright 11 | notice and this permission notice appear in supporting documentation, and that 12 | the name of M.I.T. not be used in advertising or publicity pertaining to 13 | distribution of the software without specific, written prior permission. 14 | M.I.T. makes no representations about the suitability of this software for any 15 | purpose. It is provided "as is" without express or implied warranty. 16 | -------------------------------------------------------------------------------- /test/Makefile.inc: -------------------------------------------------------------------------------- 1 | TESTSOURCES = ares-test-main.cc \ 2 | ares-test-init.cc \ 3 | ares-test.cc \ 4 | ares-test-ns.cc \ 5 | ares-test-parse.cc \ 6 | ares-test-parse-a.cc \ 7 | ares-test-parse-aaaa.cc \ 8 | ares-test-parse-mx.cc \ 9 | ares-test-parse-naptr.cc \ 10 | ares-test-parse-ns.cc \ 11 | ares-test-parse-ptr.cc \ 12 | ares-test-parse-soa.cc \ 13 | ares-test-parse-srv.cc \ 14 | ares-test-parse-txt.cc \ 15 | ares-test-misc.cc \ 16 | ares-test-live.cc \ 17 | ares-test-mock.cc \ 18 | ares-test-internal.cc \ 19 | dns-proto.cc \ 20 | dns-proto-test.cc 21 | 22 | TESTHEADERS = ares-test.h \ 23 | dns-proto.h 24 | 25 | FUZZSOURCES = ares-test-fuzz.c \ 26 | ares-fuzz.c 27 | 28 | FUZZNAMESOURCES = ares-test-fuzz-name.c \ 29 | ares-fuzz.c 30 | 31 | DUMPSOURCES = dns-proto.cc \ 32 | dns-dump.cc 33 | -------------------------------------------------------------------------------- /test/dns-dump.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #include "dns-proto.h" 9 | 10 | namespace ares { 11 | 12 | static void ShowFile(const char* filename) { 13 | int fd = open(filename, O_RDONLY); 14 | if (fd < 0) { 15 | std::cerr << "Failed to open '" << filename << "'" << std::endl; 16 | return; 17 | } 18 | std::vector contents; 19 | while (true) { 20 | unsigned char buffer[1024]; 21 | int len = read(fd, buffer, sizeof(buffer)); 22 | if (len <= 0) break; 23 | contents.insert(contents.end(), buffer, buffer + len); 24 | } 25 | std::cout << PacketToString(contents) << std::endl; 26 | } 27 | 28 | } // namespace ares 29 | 30 | int main(int argc, char* argv[]) { 31 | for (int ii = 1; ii < argc; ++ii) { 32 | ares::ShowFile(argv[ii]); 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | Major changes since: 2 | * see the CHANGES file 3 | 4 | Major changes in release 1.1.1: 5 | * ares should now compile as C++ code (no longer uses reserved word 6 | "class"). 7 | * Added SRV support to adig test program. 8 | * Fixed a few error handling bugs in query processing. 9 | 10 | Major changes in release 1.1.0: 11 | * Added ares_free_string() function so that memory can be freed in the 12 | same layer as it is allocated, a desirable feature in some 13 | environments. 14 | * A few of the ares_dns.h macros are fixed to use the proper bitwise 15 | operator. 16 | * Fixed a couple of fenceposts fixed in ares_expand_name()'s 17 | bounds-checking. 18 | * In process_timeouts(), extract query->next before calling 19 | next_server() and possibly freeing the query structure. 20 | * Casted arguments to ctype macros casted to unsigned char, since not 21 | all char values are valid inputs to those macros according to ANSI. 22 | -------------------------------------------------------------------------------- /ares_free_string.c: -------------------------------------------------------------------------------- 1 | 2 | /* Copyright 2000 by the Massachusetts Institute of Technology. 3 | * 4 | * Permission to use, copy, modify, and distribute this 5 | * software and its documentation for any purpose and without 6 | * fee is hereby granted, provided that the above copyright 7 | * notice appear in all copies and that both that copyright 8 | * notice and this permission notice appear in supporting 9 | * documentation, and that the name of M.I.T. not be used in 10 | * advertising or publicity pertaining to distribution of the 11 | * software without specific, written prior permission. 12 | * M.I.T. makes no representations about the suitability of 13 | * this software for any purpose. It is provided "as is" 14 | * without express or implied warranty. 15 | */ 16 | 17 | #include "ares_setup.h" 18 | 19 | #include "ares.h" 20 | #include "ares_private.h" 21 | 22 | void ares_free_string(void *str) 23 | { 24 | ares_free(str); 25 | } 26 | -------------------------------------------------------------------------------- /ares_strdup.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CARES_STRDUP_H 2 | #define HEADER_CARES_STRDUP_H 3 | 4 | 5 | /* Copyright 1998 by the Massachusetts Institute of Technology. 6 | * 7 | * Permission to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose and without 9 | * fee is hereby granted, provided that the above copyright 10 | * notice appear in all copies and that both that copyright 11 | * notice and this permission notice appear in supporting 12 | * documentation, and that the name of M.I.T. not be used in 13 | * advertising or publicity pertaining to distribution of the 14 | * software without specific, written prior permission. 15 | * M.I.T. makes no representations about the suitability of 16 | * this software for any purpose. It is provided "as is" 17 | * without express or implied warranty. 18 | */ 19 | 20 | #include "ares_setup.h" 21 | 22 | extern char *ares_strdup(const char *s1); 23 | 24 | #endif /* HEADER_CARES_STRDUP_H */ 25 | -------------------------------------------------------------------------------- /test/ares-test-main.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "ares-test.h" 5 | 6 | int main(int argc, char* argv[]) { 7 | std::vector gtest_argv = {argv[0]}; 8 | for (int ii = 1; ii < argc; ii++) { 9 | if (strcmp(argv[ii], "-v") == 0) { 10 | ares::test::verbose = true; 11 | } else if ((strcmp(argv[ii], "-p") == 0) && (ii + 1 < argc)) { 12 | ii++; 13 | ares::test::mock_port = atoi(argv[ii]); 14 | } else { 15 | gtest_argv.push_back(argv[ii]); 16 | } 17 | } 18 | int gtest_argc = gtest_argv.size(); 19 | gtest_argv.push_back(nullptr); 20 | ::testing::InitGoogleTest(>est_argc, gtest_argv.data()); 21 | 22 | #ifdef WIN32 23 | WORD wVersionRequested = MAKEWORD(2, 2); 24 | WSADATA wsaData; 25 | WSAStartup(wVersionRequested, &wsaData); 26 | #else 27 | signal(SIGPIPE, SIG_IGN); 28 | #endif 29 | 30 | int rc = RUN_ALL_TESTS(); 31 | 32 | #ifdef WIN32 33 | WSACleanup(); 34 | #endif 35 | 36 | return rc; 37 | } 38 | -------------------------------------------------------------------------------- /ares_getenv.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* Copyright 1998 by the Massachusetts Institute of Technology. 4 | * 5 | * Permission to use, copy, modify, and distribute this 6 | * software and its documentation for any purpose and without 7 | * fee is hereby granted, provided that the above copyright 8 | * notice appear in all copies and that both that copyright 9 | * notice and this permission notice appear in supporting 10 | * documentation, and that the name of M.I.T. not be used in 11 | * advertising or publicity pertaining to distribution of the 12 | * software without specific, written prior permission. 13 | * M.I.T. makes no representations about the suitability of 14 | * this software for any purpose. It is provided "as is" 15 | * without express or implied warranty. 16 | */ 17 | 18 | #include "ares_setup.h" 19 | #include "ares_getenv.h" 20 | 21 | #ifndef HAVE_GETENV 22 | 23 | char *ares_getenv(const char *name) 24 | { 25 | #ifdef _WIN32_WCE 26 | return NULL; 27 | #endif 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /ares_getenv.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CARES_GETENV_H 2 | #define HEADER_CARES_GETENV_H 3 | 4 | 5 | /* Copyright 1998 by the Massachusetts Institute of Technology. 6 | * 7 | * Permission to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose and without 9 | * fee is hereby granted, provided that the above copyright 10 | * notice appear in all copies and that both that copyright 11 | * notice and this permission notice appear in supporting 12 | * documentation, and that the name of M.I.T. not be used in 13 | * advertising or publicity pertaining to distribution of the 14 | * software without specific, written prior permission. 15 | * M.I.T. makes no representations about the suitability of 16 | * this software for any purpose. It is provided "as is" 17 | * without express or implied warranty. 18 | */ 19 | 20 | #include "ares_setup.h" 21 | 22 | #ifndef HAVE_GETENV 23 | extern char *ares_getenv(const char *name); 24 | #endif 25 | 26 | #endif /* HEADER_CARES_GETENV_H */ 27 | -------------------------------------------------------------------------------- /bitncmp.h: -------------------------------------------------------------------------------- 1 | #ifndef __ARES_BITNCMP_H 2 | #define __ARES_BITNCMP_H 3 | 4 | 5 | /* Copyright (C) 2005, 2013 by Dominick Meglio 6 | * 7 | * Permission to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose and without 9 | * fee is hereby granted, provided that the above copyright 10 | * notice appear in all copies and that both that copyright 11 | * notice and this permission notice appear in supporting 12 | * documentation, and that the name of M.I.T. not be used in 13 | * advertising or publicity pertaining to distribution of the 14 | * software without specific, written prior permission. 15 | * M.I.T. makes no representations about the suitability of 16 | * this software for any purpose. It is provided "as is" 17 | * without express or implied warranty. 18 | */ 19 | 20 | #ifndef HAVE_BITNCMP 21 | int ares__bitncmp(const void *l, const void *r, int n); 22 | #else 23 | #define ares__bitncmp(x,y,z) bitncmp(x,y,z) 24 | #endif 25 | 26 | #endif /* __ARES_BITNCMP_H */ 27 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/xcode/Samples/FrameworkSample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.gtest.${PRODUCT_NAME:identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | CSResourcesFileMapped 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /ares_mkquery.c: -------------------------------------------------------------------------------- 1 | 2 | /* Copyright 1998 by the Massachusetts Institute of Technology. 3 | * 4 | * Permission to use, copy, modify, and distribute this 5 | * software and its documentation for any purpose and without 6 | * fee is hereby granted, provided that the above copyright 7 | * notice appear in all copies and that both that copyright 8 | * notice and this permission notice appear in supporting 9 | * documentation, and that the name of M.I.T. not be used in 10 | * advertising or publicity pertaining to distribution of the 11 | * software without specific, written prior permission. 12 | * M.I.T. makes no representations about the suitability of 13 | * this software for any purpose. It is provided "as is" 14 | * without express or implied warranty. 15 | */ 16 | 17 | #include "ares_setup.h" 18 | #include "ares.h" 19 | 20 | int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id, 21 | int rd, unsigned char **buf, int *buflen) 22 | { 23 | return ares_create_query(name, dnsclass, type, id, rd, buf, buflen, 0); 24 | } 25 | -------------------------------------------------------------------------------- /ares_build.h.cmake: -------------------------------------------------------------------------------- 1 | #ifndef __CARES_BUILD_H 2 | #define __CARES_BUILD_H 3 | 4 | #define CARES_TYPEOF_ARES_SOCKLEN_T @CARES_TYPEOF_ARES_SOCKLEN_T@ 5 | 6 | /* Prefix names with CARES_ to make sure they don't conflict with other config.h 7 | * files. We need to include some dependent headers that may be system specific 8 | * for C-Ares */ 9 | #cmakedefine CARES_HAVE_SYS_TYPES_H 10 | #cmakedefine CARES_HAVE_SYS_SOCKET_H 11 | #cmakedefine CARES_HAVE_WINDOWS_H 12 | #cmakedefine CARES_HAVE_WS2TCPIP_H 13 | #cmakedefine CARES_HAVE_WINSOCK2_H 14 | #cmakedefine CARES_HAVE_WINDOWS_H 15 | 16 | #ifdef CARES_HAVE_SYS_TYPES_H 17 | # include 18 | #endif 19 | 20 | #ifdef CARES_HAVE_SYS_SOCKET_H 21 | # include 22 | #endif 23 | 24 | #ifdef CARES_HAVE_WINSOCK2_H 25 | # include 26 | #endif 27 | 28 | #ifdef CARES_HAVE_WS2TCPIP_H 29 | # include 30 | #endif 31 | 32 | #ifdef CARES_HAVE_WINDOWS_H 33 | # include 34 | #endif 35 | 36 | 37 | typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t; 38 | 39 | #endif /* __CARES_BUILD_H */ 40 | -------------------------------------------------------------------------------- /ares_inet_net_pton.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CARES_INET_NET_PTON_H 2 | #define HEADER_CARES_INET_NET_PTON_H 3 | 4 | /* Copyright (C) 2005-2013 by Daniel Stenberg et al 5 | * 6 | * Permission to use, copy, modify, and distribute this 7 | * software and its documentation for any purpose and without 8 | * fee is hereby granted, provided that the above copyright 9 | * notice appear in all copies and that both that copyright 10 | * notice and this permission notice appear in supporting 11 | * documentation, and that the name of M.I.T. not be used in 12 | * advertising or publicity pertaining to distribution of the 13 | * software without specific, written prior permission. 14 | * M.I.T. makes no representations about the suitability of 15 | * this software for any purpose. It is provided "as is" 16 | * without express or implied warranty. 17 | */ 18 | 19 | #ifdef HAVE_INET_NET_PTON 20 | #define ares_inet_net_pton(w,x,y,z) inet_net_pton(w,x,y,z) 21 | #else 22 | int ares_inet_net_pton(int af, const char *src, void *dst, size_t size); 23 | #endif 24 | 25 | #endif /* HEADER_CARES_INET_NET_PTON_H */ 26 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/xcode/Config/DebugProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // DebugProject.xcconfig 3 | // 4 | // These are Debug Configuration project settings for the gtest framework and 5 | // examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // No optimization 14 | GCC_OPTIMIZATION_LEVEL = 0 15 | 16 | // Deployment postprocessing is what triggers Xcode to strip, turn it off 17 | DEPLOYMENT_POSTPROCESSING = NO 18 | 19 | // Dead code stripping off 20 | DEAD_CODE_STRIPPING = NO 21 | 22 | // Debug symbols should be on obviously 23 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES 24 | 25 | // Define the DEBUG macro in all debug builds 26 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DDEBUG=1 27 | 28 | // These are turned off to avoid STL incompatibilities with client code 29 | // // Turns on special C++ STL checks to "encourage" good STL use 30 | // GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) _GLIBCXX_DEBUG_PEDANTIC _GLIBCXX_DEBUG _GLIBCPP_CONCEPT_CHECKS 31 | -------------------------------------------------------------------------------- /ares_strcasecmp.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CARES_STRCASECMP_H 2 | #define HEADER_CARES_STRCASECMP_H 3 | 4 | 5 | /* Copyright 1998 by the Massachusetts Institute of Technology. 6 | * 7 | * Permission to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose and without 9 | * fee is hereby granted, provided that the above copyright 10 | * notice appear in all copies and that both that copyright 11 | * notice and this permission notice appear in supporting 12 | * documentation, and that the name of M.I.T. not be used in 13 | * advertising or publicity pertaining to distribution of the 14 | * software without specific, written prior permission. 15 | * M.I.T. makes no representations about the suitability of 16 | * this software for any purpose. It is provided "as is" 17 | * without express or implied warranty. 18 | */ 19 | 20 | #include "ares_setup.h" 21 | 22 | #ifndef HAVE_STRCASECMP 23 | extern int ares_strcasecmp(const char *a, const char *b); 24 | #endif 25 | 26 | #ifndef HAVE_STRNCASECMP 27 | extern int ares_strncasecmp(const char *a, const char *b, size_t n); 28 | #endif 29 | 30 | #endif /* HEADER_CARES_STRCASECMP_H */ 31 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/xcode/Config/ReleaseProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // ReleaseProject.xcconfig 3 | // 4 | // These are Release Configuration project settings for the gtest framework 5 | // and examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // subconfig/Release.xcconfig 14 | 15 | // Optimize for space and size (Apple recommendation) 16 | GCC_OPTIMIZATION_LEVEL = s 17 | 18 | // Deploment postprocessing is what triggers Xcode to strip 19 | DEPLOYMENT_POSTPROCESSING = YES 20 | 21 | // No symbols 22 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO 23 | 24 | // Dead code strip does not affect ObjC code but can help for C 25 | DEAD_CODE_STRIPPING = YES 26 | 27 | // NDEBUG is used by things like assert.h, so define it for general compat. 28 | // ASSERT going away in release tends to create unused vars. 29 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DNDEBUG=1 -Wno-unused-variable 30 | 31 | // When we strip we want to strip all symbols in release, but save externals. 32 | STRIP_STYLE = all 33 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/xcode/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.${PRODUCT_NAME} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | GTEST_VERSIONINFO_LONG 21 | CFBundleShortVersionString 22 | GTEST_VERSIONINFO_SHORT 23 | CFBundleGetInfoString 24 | ${PRODUCT_NAME} GTEST_VERSIONINFO_LONG, ${GTEST_VERSIONINFO_ABOUT} 25 | NSHumanReadableCopyright 26 | ${GTEST_VERSIONINFO_ABOUT} 27 | CSResourcesFileMapped 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ares_set_socket_callback.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .TH ARES_SET_SOCKET_CALLBACK 3 "20 Nov 2009" 3 | .SH NAME 4 | ares_set_socket_callback \- Set a socket creation callback 5 | .SH SYNOPSIS 6 | .nf 7 | .B #include 8 | .PP 9 | .B typedef int (*ares_sock_create_callback)(ares_socket_t \fIsocket_fd\fP, 10 | int \fItype\fP, 11 | void *\fIuserdata\fP) 12 | .PP 13 | .B void ares_set_socket_callback(ares_channel \fIchannel\fP, 14 | ares_sock_create_callback \fIcallback\fP, 15 | void *\fIuserdata\fP) 16 | .PP 17 | .B cc file.c -lcares 18 | .fi 19 | .SH DESCRIPTION 20 | .PP 21 | This function sets a \fIcallback\fP in the given ares channel handle. This 22 | callback function will be invoked after the socket has been created, and 23 | connected to the remote server. The callback must return ARES_SUCCESS if 24 | things are fine, or return -1 to signal an error. A returned error will 25 | abort the ares operation. 26 | .SH SEE ALSO 27 | .BR ares_init_options (3), ares_set_socket_configure_callback (3) 28 | .SH AVAILABILITY 29 | ares_set_socket_callback(3) was added in c-ares 1.6.0 30 | .SH AUTHOR 31 | Gregor Jasny 32 | 33 | -------------------------------------------------------------------------------- /ares_writev.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CARES_WRITEV_H 2 | #define HEADER_CARES_WRITEV_H 3 | 4 | 5 | /* Copyright 1998 by the Massachusetts Institute of Technology. 6 | * 7 | * Permission to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose and without 9 | * fee is hereby granted, provided that the above copyright 10 | * notice appear in all copies and that both that copyright 11 | * notice and this permission notice appear in supporting 12 | * documentation, and that the name of M.I.T. not be used in 13 | * advertising or publicity pertaining to distribution of the 14 | * software without specific, written prior permission. 15 | * M.I.T. makes no representations about the suitability of 16 | * this software for any purpose. It is provided "as is" 17 | * without express or implied warranty. 18 | */ 19 | 20 | #include "ares_setup.h" 21 | #include "ares.h" 22 | 23 | #ifndef HAVE_WRITEV 24 | 25 | /* Structure for scatter/gather I/O. */ 26 | struct iovec 27 | { 28 | void *iov_base; /* Pointer to data. */ 29 | size_t iov_len; /* Length of data. */ 30 | }; 31 | 32 | extern ssize_t ares_writev(ares_socket_t s, const struct iovec *iov, int iovcnt); 33 | 34 | #endif 35 | 36 | #endif /* HEADER_CARES_WRITEV_H */ 37 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/scripts/generator/gmock_gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2008 Google Inc. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | """Driver for starting up Google Mock class generator.""" 18 | 19 | __author__ = 'nnorwitz@google.com (Neal Norwitz)' 20 | 21 | import os 22 | import sys 23 | 24 | if __name__ == '__main__': 25 | # Add the directory of this script to the path so we can import gmock_class. 26 | sys.path.append(os.path.dirname(__file__)) 27 | 28 | from cpp import gmock_class 29 | # Fix the docstring in case they require the usage. 30 | gmock_class.__doc__ = gmock_class.__doc__.replace('gmock_class.py', __file__) 31 | gmock_class.main() 32 | -------------------------------------------------------------------------------- /get_ver.awk: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * Project: c-ares 3 | # * 4 | # *************************************************************************** 5 | # awk script which fetches c-ares version number and string from input 6 | # file and writes them to STDOUT. Here you can get an awk version for Win32: 7 | # http://www.gknw.net/development/prgtools/awk-20100523.zip 8 | # 9 | BEGIN { 10 | while ((getline < ARGV[1]) > 0) { 11 | sub("\r", "") # make MSYS gawk work with CRLF header input. 12 | if (match ($0, /^#define ARES_COPYRIGHT "[^"]+"$/)) 13 | copyright_string = substr($0, 25, length($0)-25) 14 | else if (match ($0, /^#define ARES_VERSION_STR "[^"]+"$/)) 15 | version_string = substr($3, 2, length($3)-2) 16 | else if (match ($0, /^#define ARES_VERSION_MAJOR [0-9]+$/)) 17 | version_major = $3 18 | else if (match ($0, /^#define ARES_VERSION_MINOR [0-9]+$/)) 19 | version_minor = $3 20 | else if (match ($0, /^#define ARES_VERSION_PATCH [0-9]+$/)) 21 | version_patch = $3 22 | } 23 | print "LIBCARES_VERSION = " version_major "," version_minor "," version_patch 24 | print "LIBCARES_VERSION_STR = " version_string 25 | print "LIBCARES_COPYRIGHT_STR = " copyright_string 26 | } 27 | 28 | -------------------------------------------------------------------------------- /ares_free_string.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright 2000 by the Massachusetts Institute of Technology. 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_FREE_STRING 3 "4 February 2004" 17 | .SH NAME 18 | ares_free_string \- Free strings allocated by ares functions 19 | .SH SYNOPSIS 20 | .nf 21 | .B #include 22 | .PP 23 | .B void ares_free_string(void *\fIstr\fP) 24 | .fi 25 | .SH DESCRIPTION 26 | The \fIares_free_string(3)\fP function frees a string allocated by an ares 27 | function. 28 | .SH SEE ALSO 29 | .BR ares_mkquery (3) 30 | .BR ares_expand_string (3) 31 | .SH AUTHOR 32 | Greg Hudson, MIT Information Systems 33 | .br 34 | Copyright 2000 by the Massachusetts Institute of Technology. 35 | -------------------------------------------------------------------------------- /ares_platform.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CARES_PLATFORM_H 2 | #define HEADER_CARES_PLATFORM_H 3 | 4 | 5 | /* Copyright 1998 by the Massachusetts Institute of Technology. 6 | * Copyright (C) 2004 - 2011 by Daniel Stenberg et al 7 | * 8 | * Permission to use, copy, modify, and distribute this 9 | * software and its documentation for any purpose and without 10 | * fee is hereby granted, provided that the above copyright 11 | * notice appear in all copies and that both that copyright 12 | * notice and this permission notice appear in supporting 13 | * documentation, and that the name of M.I.T. not be used in 14 | * advertising or publicity pertaining to distribution of the 15 | * software without specific, written prior permission. 16 | * M.I.T. makes no representations about the suitability of 17 | * this software for any purpose. It is provided "as is" 18 | * without express or implied warranty. 19 | */ 20 | 21 | #include "ares_setup.h" 22 | 23 | #if defined(WIN32) && !defined(MSDOS) 24 | 25 | typedef enum { 26 | WIN_UNKNOWN, 27 | WIN_3X, 28 | WIN_9X, 29 | WIN_NT, 30 | WIN_CE 31 | } win_platform; 32 | 33 | win_platform ares__getplatform(void); 34 | 35 | #endif 36 | 37 | #if defined(_WIN32_WCE) 38 | 39 | struct servent *getservbyport(int port, const char *proto); 40 | 41 | #endif 42 | 43 | #endif /* HEADER_CARES_PLATFORM_H */ 44 | -------------------------------------------------------------------------------- /ares_set_socket_configure_callback.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .TH ARES_SET_SOCKET_CONFIGURE_CALLBACK 3 "6 Feb 2016" 3 | .SH NAME 4 | ares_set_socket_configure_callback \- Set a socket configuration callback 5 | .SH SYNOPSIS 6 | .nf 7 | .B #include 8 | .PP 9 | .B typedef int (*ares_sock_config_callback)(ares_socket_t \fIsocket_fd\fP, 10 | int \fItype\fP, 11 | void *\fIuserdata\fP) 12 | .PP 13 | .B void ares_set_socket_configure_callback(ares_channel \fIchannel\fP, 14 | ares_sock_config_callback \fIcallback\fP, 15 | void *\fIuserdata\fP) 16 | .PP 17 | .B cc file.c -lcares 18 | .fi 19 | .SH DESCRIPTION 20 | .PP 21 | This function sets a \fIcallback\fP in the given ares channel handle. This 22 | callback function will be invoked after the socket has been created, but 23 | before it has been connected to the remote server, which is an ideal time 24 | to configure various socket options. The callback must return ARES_SUCCESS 25 | if things are fine, or return -1 to signal an error. A returned error will 26 | abort the ares operation. 27 | .SH SEE ALSO 28 | .BR ares_init_options (3), ares_set_socket_callback (3) 29 | .SH AVAILABILITY 30 | ares_set_socket_configure_callback(3) was added in c-ares 1.11.0 31 | .SH AUTHOR 32 | Andrew Ayer 33 | 34 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/scripts/generator/cpp/utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2007 Neal Norwitz 4 | # Portions Copyright 2007 Google Inc. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | """Generic utilities for C++ parsing.""" 19 | 20 | __author__ = 'nnorwitz@google.com (Neal Norwitz)' 21 | 22 | 23 | import sys 24 | 25 | 26 | # Set to True to see the start/end token indices. 27 | DEBUG = True 28 | 29 | 30 | def ReadFile(filename, print_error=True): 31 | """Returns the contents of a file.""" 32 | try: 33 | fp = open(filename) 34 | try: 35 | return fp.read() 36 | finally: 37 | fp.close() 38 | except IOError: 39 | if print_error: 40 | print('Error reading %s: %s' % (filename, sys.exc_info()[1])) 41 | return None 42 | -------------------------------------------------------------------------------- /ares_library_initialized.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright (C) 2016 by Daniel Stenberg 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_LIBRARY_INITIALIZED 3 "29 Sep 2016" 17 | .SH NAME 18 | ares_library_initialized \- get the initialization state 19 | .SH SYNOPSIS 20 | .nf 21 | #include 22 | 23 | int ares_library_initialized(void) 24 | .fi 25 | .SH DESCRIPTION 26 | Returns information if c-ares needs to get initialized. 27 | .SH RETURN VALUE 28 | \fIARES_ENOTINITIALIZED\fP if not initialized and \fIARES_SUCCESS\fP if no 29 | initialization is needed. 30 | .SH AVAILABILITY 31 | This function was first introduced in c-ares version 1.11.0 32 | .SH SEE ALSO 33 | .BR ares_library_init(3), 34 | .BR ares_library_cleanup(3) 35 | -------------------------------------------------------------------------------- /ares_set_local_ip4.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright 2010 by Ben Greear 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_SET_LOCAL_IP4 3 "30 June 2010" 17 | .SH NAME 18 | ares_set_local_ip4 \- Set local IPv4 address outgoing requests. 19 | .SH SYNOPSIS 20 | .nf 21 | .B #include 22 | .PP 23 | .B void ares_set_local_ip4(ares_channel \fIchannel\fP, unsigned int \fIlocal_ip\fP) 24 | .fi 25 | .SH DESCRIPTION 26 | The \fBares_set_local_ip4\fP function sets the IP address for outbound 27 | requests. This allows users to specify outbound interfaces when used 28 | on multi-homed systems. 29 | .SH SEE ALSO 30 | .BR ares_set_local_ip6 (3) 31 | .SH NOTES 32 | This function was added in c-ares 1.7.4 33 | .SH AUTHOR 34 | Ben Greear 35 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/xcode/Config/General.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // General.xcconfig 3 | // 4 | // These are General configuration settings for the gtest framework and 5 | // examples. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Build for PPC and Intel, 32- and 64-bit 11 | ARCHS = i386 x86_64 ppc ppc64 12 | 13 | // Zerolink prevents link warnings so turn it off 14 | ZERO_LINK = NO 15 | 16 | // Prebinding considered unhelpful in 10.3 and later 17 | PREBINDING = NO 18 | 19 | // Strictest warning policy 20 | WARNING_CFLAGS = -Wall -Werror -Wendif-labels -Wnewline-eof -Wno-sign-compare -Wshadow 21 | 22 | // Work around Xcode bugs by using external strip. See: 23 | // http://lists.apple.com/archives/Xcode-users/2006/Feb/msg00050.html 24 | SEPARATE_STRIP = YES 25 | 26 | // Force C99 dialect 27 | GCC_C_LANGUAGE_STANDARD = c99 28 | 29 | // not sure why apple defaults this on, but it's pretty risky 30 | ALWAYS_SEARCH_USER_PATHS = NO 31 | 32 | // Turn on position dependent code for most cases (overridden where appropriate) 33 | GCC_DYNAMIC_NO_PIC = YES 34 | 35 | // Default SDK and minimum OS version is 10.4 36 | SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk 37 | MACOSX_DEPLOYMENT_TARGET = 10.4 38 | GCC_VERSION = 4.0 39 | 40 | // VERSIONING BUILD SETTINGS (used in Info.plist) 41 | GTEST_VERSIONINFO_ABOUT = © 2008 Google Inc. 42 | -------------------------------------------------------------------------------- /ares_llist.h: -------------------------------------------------------------------------------- 1 | #ifndef __ARES_LLIST_H 2 | #define __ARES_LLIST_H 3 | 4 | 5 | /* Copyright 1998 by the Massachusetts Institute of Technology. 6 | * 7 | * Permission to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose and without 9 | * fee is hereby granted, provided that the above copyright 10 | * notice appear in all copies and that both that copyright 11 | * notice and this permission notice appear in supporting 12 | * documentation, and that the name of M.I.T. not be used in 13 | * advertising or publicity pertaining to distribution of the 14 | * software without specific, written prior permission. 15 | * M.I.T. makes no representations about the suitability of 16 | * this software for any purpose. It is provided "as is" 17 | * without express or implied warranty. 18 | */ 19 | 20 | 21 | /* Node definition for circular, doubly-linked list */ 22 | struct list_node { 23 | struct list_node *prev; 24 | struct list_node *next; 25 | void* data; 26 | }; 27 | 28 | void ares__init_list_head(struct list_node* head); 29 | 30 | void ares__init_list_node(struct list_node* node, void* d); 31 | 32 | int ares__is_list_empty(struct list_node* head); 33 | 34 | void ares__insert_in_list(struct list_node* new_node, 35 | struct list_node* old_node); 36 | 37 | void ares__remove_from_list(struct list_node* node); 38 | 39 | #endif /* __ARES_LLIST_H */ 40 | -------------------------------------------------------------------------------- /ares_destroy_options.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright 1998 by the Massachusetts Institute of Technology. 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_DESTROY_OPTIONS 3 "1 June 2007" 17 | .SH NAME 18 | ares_destroy_options \- Destroy options initialized with ares_save_options 19 | .SH SYNOPSIS 20 | .nf 21 | .B #include 22 | .PP 23 | .B void ares_destroy_options(struct ares_options *\fIoptions\fP) 24 | .fi 25 | .SH DESCRIPTION 26 | The \fBares_destroy_options(3)\fP function destroys the options struct 27 | identified by \Ioptions\fP, freeing all memory allocated by 28 | \fBares_save_options(3)\fP. 29 | .SH SEE ALSO 30 | .BR ares_save_options (3), 31 | .BR ares_init_options (3) 32 | .SH AUTHOR 33 | Brad House 34 | .br 35 | Copyright 1998 by the Massachusetts Institute of Technology. 36 | -------------------------------------------------------------------------------- /ares_free_hostent.c: -------------------------------------------------------------------------------- 1 | 2 | /* Copyright 1998 by the Massachusetts Institute of Technology. 3 | * 4 | * Permission to use, copy, modify, and distribute this 5 | * software and its documentation for any purpose and without 6 | * fee is hereby granted, provided that the above copyright 7 | * notice appear in all copies and that both that copyright 8 | * notice and this permission notice appear in supporting 9 | * documentation, and that the name of M.I.T. not be used in 10 | * advertising or publicity pertaining to distribution of the 11 | * software without specific, written prior permission. 12 | * M.I.T. makes no representations about the suitability of 13 | * this software for any purpose. It is provided "as is" 14 | * without express or implied warranty. 15 | */ 16 | 17 | #include "ares_setup.h" 18 | 19 | #ifdef HAVE_NETDB_H 20 | #include 21 | #endif 22 | 23 | #include "ares.h" 24 | #include "ares_private.h" /* for memdebug */ 25 | 26 | void ares_free_hostent(struct hostent *host) 27 | { 28 | char **p; 29 | 30 | if (!host) 31 | return; 32 | 33 | ares_free((char *)(host->h_name)); 34 | for (p = host->h_aliases; *p; p++) 35 | ares_free(*p); 36 | ares_free(host->h_aliases); 37 | ares_free(host->h_addr_list[0]); /* no matter if there is one or many entries, 38 | there is only one malloc for all of them */ 39 | ares_free(host->h_addr_list); 40 | ares_free(host); 41 | } 42 | -------------------------------------------------------------------------------- /ares_strerror.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright 1998 by the Massachusetts Institute of Technology. 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_STRERROR 3 "25 July 1998" 17 | .SH NAME 18 | ares_strerror \- Get the description of an ares library error code 19 | .SH SYNOPSIS 20 | .nf 21 | .B #include 22 | .PP 23 | .B const char *ares_strerror(int \fIcode\fP) 24 | .fi 25 | .SH DESCRIPTION 26 | The 27 | .B ares_strerror 28 | function gets the description of the ares library error code 29 | .IR code , 30 | returning the result as a NUL-terminated C string. 31 | .SH NOTES 32 | This function is not compatible with ares, it takes a different set of 33 | arguments. 34 | .SH AUTHOR 35 | Greg Hudson, MIT Information Systems 36 | .br 37 | Copyright 1998 by the Massachusetts Institute of Technology. 38 | -------------------------------------------------------------------------------- /ares_set_local_ip6.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright 2010 by Ben Greear 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_SET_LOCAL_IP6 3 "30 June 2010" 17 | .SH NAME 18 | ares_set_local_ip6 \- Set local IPv6 address outgoing requests. 19 | .SH SYNOPSIS 20 | .nf 21 | .B #include 22 | .PP 23 | .B void ares_set_local_ip6(ares_channel \fIchannel\fP, const unsigned char* \fIlocal_ip6\fP) 24 | .fi 25 | .SH DESCRIPTION 26 | The \fBares_set_local_ip6\fP function sets the IPv6 address for outbound 27 | IPv6 requests. This allows users to specify outbound interfaces when used 28 | on multi-homed systems. The local_ip6 argument must be 16 bytes in length. 29 | .SH SEE ALSO 30 | .BR ares_set_local_ip4 (3) 31 | .SH NOTES 32 | This function was added in c-ares 1.7.4 33 | .SH AUTHOR 34 | Ben Greear 35 | -------------------------------------------------------------------------------- /ares_strdup.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* Copyright 1998 by the Massachusetts Institute of Technology. 4 | * 5 | * Permission to use, copy, modify, and distribute this 6 | * software and its documentation for any purpose and without 7 | * fee is hereby granted, provided that the above copyright 8 | * notice appear in all copies and that both that copyright 9 | * notice and this permission notice appear in supporting 10 | * documentation, and that the name of M.I.T. not be used in 11 | * advertising or publicity pertaining to distribution of the 12 | * software without specific, written prior permission. 13 | * M.I.T. makes no representations about the suitability of 14 | * this software for any purpose. It is provided "as is" 15 | * without express or implied warranty. 16 | */ 17 | 18 | #include "ares_setup.h" 19 | #include "ares_strdup.h" 20 | #include "ares.h" 21 | #include "ares_private.h" 22 | 23 | char *ares_strdup(const char *s1) 24 | { 25 | #ifdef HAVE_STRDUP 26 | if (ares_malloc == malloc) 27 | return strdup(s1); 28 | else 29 | #endif 30 | { 31 | size_t sz; 32 | char * s2; 33 | 34 | if(s1) { 35 | sz = strlen(s1); 36 | if(sz < (size_t)-1) { 37 | sz++; 38 | if(sz < ((size_t)-1) / sizeof(char)) { 39 | s2 = ares_malloc(sz * sizeof(char)); 40 | if(s2) { 41 | memcpy(s2, s1, sz * sizeof(char)); 42 | return s2; 43 | } 44 | } 45 | } 46 | } 47 | return (char *)NULL; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /test/ares-test-fuzz.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "ares.h" 4 | 5 | // Entrypoint for Clang's libfuzzer 6 | int LLVMFuzzerTestOneInput(const unsigned char *data, 7 | unsigned long size) { 8 | // Feed the data into each of the ares_parse_*_reply functions. 9 | struct hostent *host = NULL; 10 | struct ares_addrttl info[5]; 11 | int count = 5; 12 | ares_parse_a_reply(data, size, &host, info, &count); 13 | if (host) ares_free_hostent(host); 14 | 15 | host = NULL; 16 | struct ares_addr6ttl info6[5]; 17 | count = 5; 18 | ares_parse_aaaa_reply(data, size, &host, info6, &count); 19 | if (host) ares_free_hostent(host); 20 | 21 | host = NULL; 22 | unsigned char addrv4[4] = {0x10, 0x20, 0x30, 0x40}; 23 | ares_parse_ptr_reply(data, size, addrv4, sizeof(addrv4), AF_INET, &host); 24 | if (host) ares_free_hostent(host); 25 | 26 | host = NULL; 27 | ares_parse_ns_reply(data, size, &host); 28 | if (host) ares_free_hostent(host); 29 | 30 | struct ares_srv_reply* srv = NULL; 31 | ares_parse_srv_reply(data, size, &srv); 32 | if (srv) ares_free_data(srv); 33 | 34 | struct ares_mx_reply* mx = NULL; 35 | ares_parse_mx_reply(data, size, &mx); 36 | if (mx) ares_free_data(mx); 37 | 38 | struct ares_txt_reply* txt = NULL; 39 | ares_parse_txt_reply(data, size, &txt); 40 | if (txt) ares_free_data(txt); 41 | 42 | struct ares_soa_reply* soa = NULL; 43 | ares_parse_soa_reply(data, size, &soa); 44 | if (soa) ares_free_data(soa); 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/scripts/generator/README: -------------------------------------------------------------------------------- 1 | 2 | The Google Mock class generator is an application that is part of cppclean. 3 | For more information about cppclean, see the README.cppclean file or 4 | visit http://code.google.com/p/cppclean/ 5 | 6 | cppclean requires Python 2.3.5 or later. If you don't have Python installed 7 | on your system, you will also need to install it. You can download Python 8 | from: http://www.python.org/download/releases/ 9 | 10 | To use the Google Mock class generator, you need to call it 11 | on the command line passing the header file and class for which you want 12 | to generate a Google Mock class. 13 | 14 | Make sure to install the scripts somewhere in your path. Then you can 15 | run the program. 16 | 17 | gmock_gen.py header-file.h [ClassName]... 18 | 19 | If no ClassNames are specified, all classes in the file are emitted. 20 | 21 | To change the indentation from the default of 2, set INDENT in 22 | the environment. For example to use an indent of 4 spaces: 23 | 24 | INDENT=4 gmock_gen.py header-file.h ClassName 25 | 26 | This version was made from SVN revision 281 in the cppclean repository. 27 | 28 | Known Limitations 29 | ----------------- 30 | Not all code will be generated properly. For example, when mocking templated 31 | classes, the template information is lost. You will need to add the template 32 | information manually. 33 | 34 | Not all permutations of using multiple pointers/references will be rendered 35 | properly. These will also have to be fixed manually. 36 | -------------------------------------------------------------------------------- /ares_version.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright 2004 by Daniel Stenberg 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_VERSION 3 "29 January 2004" 17 | .SH NAME 18 | ares_version \- Get the version number of the library 19 | .SH SYNOPSIS 20 | .nf 21 | #include 22 | 23 | const char *ares_version(int *\fIversion\fP) 24 | .fi 25 | .SH DESCRIPTION 26 | The \fBares_version(3)\fP function gets the library version as a string and 27 | optionally as an integer stored in the \fIversion\fP argument. If you pass a 28 | NULL, no integer is attempted to be returned. 29 | 30 | The integer is built up as 24bit number, with 8 separate bits used for major 31 | number, minor number and patch number. This makes a version string such as 32 | 1.2.3 will be returned as the hexadecimal number 0x010203 (decimal 66051). 33 | .SH "SEE ALSO" 34 | .BR ares_init (3), 35 | .BR ares_library_init (3) 36 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file contains a list of people who've made non-trivial 2 | # contribution to the Google C++ Testing Framework project. People 3 | # who commit code to the project are encouraged to add their names 4 | # here. Please keep the list sorted by first names. 5 | 6 | Ajay Joshi 7 | Balázs Dán 8 | Bharat Mediratta 9 | Chandler Carruth 10 | Chris Prince 11 | Chris Taylor 12 | Dan Egnor 13 | Eric Roman 14 | Hady Zalek 15 | Jeffrey Yasskin 16 | Jói Sigurðsson 17 | Keir Mierle 18 | Keith Ray 19 | Kenton Varda 20 | Manuel Klimek 21 | Markus Heule 22 | Mika Raento 23 | Miklós Fazekas 24 | Pasi Valminen 25 | Patrick Hanna 26 | Patrick Riley 27 | Peter Kaminski 28 | Preston Jackson 29 | Rainer Klaffenboeck 30 | Russ Cox 31 | Russ Rufer 32 | Sean Mcafee 33 | Sigurður Ásgeirsson 34 | Tracy Bialik 35 | Vadim Berman 36 | Vlad Losev 37 | Zhanyong Wan 38 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file contains a list of people who've made non-trivial 2 | # contribution to the Google C++ Mocking Framework project. People 3 | # who commit code to the project are encouraged to add their names 4 | # here. Please keep the list sorted by first names. 5 | 6 | Benoit Sigoure 7 | Bogdan Piloca 8 | Chandler Carruth 9 | Dave MacLachlan 10 | David Anderson 11 | Dean Sturtevant 12 | Gene Volovich 13 | Hal Burch 14 | Jeffrey Yasskin 15 | Jim Keller 16 | Joe Walnes 17 | Jon Wray 18 | Keir Mierle 19 | Keith Ray 20 | Kostya Serebryany 21 | Lev Makhlis 22 | Manuel Klimek 23 | Mario Tanev 24 | Mark Paskin 25 | Markus Heule 26 | Matthew Simmons 27 | Mike Bland 28 | Neal Norwitz 29 | Nermin Ozkiranartli 30 | Owen Carlsen 31 | Paneendra Ba 32 | Paul Menage 33 | Piotr Kaminski 34 | Russ Rufer 35 | Sverre Sundsdal 36 | Takeshi Yoshino 37 | Vadim Berman 38 | Vlad Losev 39 | Wolfgang Klier 40 | Zhanyong Wan 41 | -------------------------------------------------------------------------------- /test/Makefile.m32: -------------------------------------------------------------------------------- 1 | ############################################################# 2 | # 3 | ## Makefile for building arestest.exe with MingW32 (GCC-3.2) 4 | ## Use: make -f Makefile.m32 5 | # 6 | ######################################################## 7 | CXX = g++ 8 | LD = g++ 9 | 10 | # Where to find the c-ares source code; needed because the tests use library-internal headers 11 | ARES_SRC_DIR = .. 12 | # Where to find the built c-ares static library 13 | ARES_BLD_DIR = .. 14 | ARESLIB = $(ARES_BLD_DIR)/libcares.a 15 | GMOCK_DIR = gmock-1.7.0 16 | GTEST_DIR = $(GMOCK_DIR)/gtest 17 | CPPFLAGS = -I$(ARES_SRC_DIR) -I$(GTEST_DIR)/include -I$(GMOCK_DIR)/include -DCARES_STATICLIB 18 | CXXFLAGS = -Wall $(PTHREAD_CFLAGS) -std=gnu++11 19 | LDFLAGS = 20 | LDLIBS = -lwsock32 21 | 22 | # Makefile.inc provides the TESTSOURCES and TESTHEADERS defines 23 | include Makefile.inc 24 | 25 | OBJS := $(patsubst %.cc,%.o,$(strip $(TESTSOURCES))) 26 | 27 | all: arestest.exe 28 | 29 | arestest.exe: $(OBJS) gmock-all.o gtest-all.o 30 | $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR) -lcares $(LDLIBS) 31 | 32 | $(OBJS): $(TESTHEADERS) 33 | 34 | .cc.o: 35 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< 36 | gmock-all.o: $(GMOCK_DIR)/src/gmock-all.cc 37 | $(CXX) -I$(GTEST_DIR) -I$(GMOCK_DIR) $(CPPFLAGS) $(CXXFLAGS) -c $< 38 | gtest-all.o: $(GTEST_DIR)/src/gtest-all.cc 39 | $(CXX) -I$(GTEST_DIR) -I$(GMOCK_DIR) $(CPPFLAGS) $(CXXFLAGS) -c $< 40 | 41 | test: arestest.exe 42 | ./arestest.exe 43 | vtest: arestest.exe 44 | ./arestest.exe -v 45 | 46 | clean: 47 | $(RM) $(OBJS) gmock-all.o gtest-all.o arestest.exe 48 | 49 | -------------------------------------------------------------------------------- /ares_dup.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright (C) 2004-2009 by Daniel Stenberg 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_DUP 3 "26 May 2009" 17 | .SH NAME 18 | ares_dup \- Duplicate a resolver channel 19 | .SH SYNOPSIS 20 | .nf 21 | .B #include 22 | .PP 23 | .B int ares_dup(ares_channel *\fIdest\fP, ares_channel \fIsource\fP) 24 | .fi 25 | .SH DESCRIPTION 26 | The \fBares_dup(3)\fP function duplicates an existing communications channel 27 | for name service lookups. If it returns successfully, \fBares_dup(3)\fP will 28 | set the variable pointed to by \fIdest\fP to a handle used to identify the 29 | name service channel. The caller should invoke \fIares_destroy(3)\fP on the 30 | handle when the channel is no longer needed. 31 | .SH SEE ALSO 32 | .BR ares_destroy(3), 33 | .BR ares_init(3), 34 | .BR ares_library_init(3) 35 | .SH AVAILABILITY 36 | \fIares_dup(3)\fP was added in c-ares 1.6.0 37 | .SH AUTHOR 38 | Daniel Stenberg 39 | 40 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | c-ares is based on ares, and these are the people that have worked on it since 2 | the fork was made: 3 | 4 | Albert Chin 5 | Alex Loukissas 6 | Alexander Klauer 7 | Alexander Lazic 8 | Alexey Simak 9 | Andreas Rieke 10 | Andrew Andkjar 11 | Andrew Ayer 12 | Andrew C. Morrow 13 | Ashish Sharma 14 | Ben Greear 15 | Ben Noordhuis 16 | BogDan Vatra 17 | Brad House 18 | Brad Spencer 19 | Bram Matthys 20 | Chris Araman 21 | Dan Fandrich 22 | Daniel Johnson 23 | Daniel Stenberg 24 | David Drysdale 25 | David Stuart 26 | Denis Bilenko 27 | Dima Tisnek 28 | Dirk Manske 29 | Dominick Meglio 30 | Doug Goldstein 31 | Doug Kwan 32 | Duncan Wilcox 33 | Eino Tuominen 34 | Erik Kline 35 | Fedor Indutny 36 | Frederic Germain 37 | Geert Uytterhoeven 38 | George Neill 39 | Gisle Vanem 40 | Gregor Jasny 41 | Guenter Knauf 42 | Guilherme Balena Versiani 43 | Gunter Knauf 44 | Henrik Stoerner 45 | Jakub Hrozek 46 | James Bursa 47 | Jérémy Lal 48 | Keith Shaw 49 | Lei Shi 50 | Marko Kreen 51 | Michael Wallner 52 | Mike Crowe 53 | Nick Alcock 54 | Nick Mathewson 55 | Nicolas "Pixel" Noble 56 | Ning Dong 57 | Oleg Pudeyev 58 | Patrick Valsecchi 59 | Patrik Thunstrom 60 | Paul Saab 61 | Peter Pentchev 62 | Phil Blundell 63 | Poul Thomas Lomholt 64 | Ravi Pratap 65 | Robin Cornelius 66 | Saúl Ibarra Corretgé 67 | Sebastian at basti79.de 68 | Shmulik Regev 69 | Stefan Bühler 70 | Steinar H. Gunderson 71 | Svante Karlsson 72 | Tofu Linden 73 | Tom Hughes 74 | Tor Arntsen 75 | Viktor Szakats 76 | Vlad Dinulescu 77 | William Ahern 78 | Yang Tse 79 | hpopescu at ixiacom.com 80 | liren at vivisimo.com 81 | nordsturm 82 | saghul 83 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /m4/ax_check_user_namespace.m4: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | 3 | # SYNOPSIS 4 | # 5 | # AX_CHECK_USER_NAMESPACE 6 | # 7 | # DESCRIPTION 8 | # 9 | # This macro checks whether the local system supports Linux user namespaces. 10 | # If so, it calls AC_DEFINE(HAVE_USER_NAMESPACE). 11 | 12 | AC_DEFUN([AX_CHECK_USER_NAMESPACE],[dnl 13 | AC_CACHE_CHECK([whether user namespaces are supported], 14 | ax_cv_user_namespace,[ 15 | AC_LANG_PUSH([C]) 16 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ 17 | #define _GNU_SOURCE 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | int userfn(void *d) { 27 | usleep(100000); /* synchronize by sleep */ 28 | return (getuid() != 0); 29 | } 30 | char userst[1024*1024]; 31 | int main() { 32 | char buffer[1024]; 33 | int rc, status, fd; 34 | pid_t child = clone(userfn, userst + 1024*1024, CLONE_NEWUSER|SIGCHLD, 0); 35 | if (child < 0) return 1; 36 | 37 | sprintf(buffer, "/proc/%d/uid_map", child); 38 | fd = open(buffer, O_CREAT|O_WRONLY|O_TRUNC, 0755); 39 | sprintf(buffer, "0 %d 1\n", getuid()); 40 | write(fd, buffer, strlen(buffer)); 41 | close(fd); 42 | 43 | rc = waitpid(child, &status, 0); 44 | if (rc <= 0) return 1; 45 | if (!WIFEXITED(status)) return 1; 46 | return WEXITSTATUS(status); 47 | } 48 | ]])],[ax_cv_user_namespace=yes],[ax_cv_user_namespace=no],[ax_cv_user_namespace=no]) 49 | AC_LANG_POP([C]) 50 | ]) 51 | if test "$ax_cv_user_namespace" = yes; then 52 | AC_DEFINE([HAVE_USER_NAMESPACE],[1],[Whether user namespaces are available]) 53 | fi 54 | ]) # AX_CHECK_USER_NAMESPACE 55 | -------------------------------------------------------------------------------- /ares_destroy.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright 1998 by the Massachusetts Institute of Technology. 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_DESTROY 3 "7 December 2004" 17 | .SH NAME 18 | ares_destroy \- Destroy a resolver channel 19 | .SH SYNOPSIS 20 | .nf 21 | #include 22 | 23 | void ares_destroy(ares_channel \fIchannel\fP) 24 | .fi 25 | .SH DESCRIPTION 26 | The \fBares_destroy(3)\fP function destroys the name service channel 27 | identified by \fIchannel\fP, freeing all memory and closing all sockets used 28 | by the channel. 29 | 30 | \fBares_destroy(3)\fP invokes the callbacks for each pending query on the 31 | channel, passing a status of \fIARES_EDESTRUCTION\fP. These calls give the 32 | callbacks a chance to clean up any state which might have been stored in their 33 | arguments. A callback must not add new requests to a channel being destroyed. 34 | .SH SEE ALSO 35 | .BR ares_init (3), 36 | .BR ares_cancel (3) 37 | .SH AUTHOR 38 | Greg Hudson, MIT Information Systems 39 | .br 40 | Copyright 1998 by the Massachusetts Institute of Technology. 41 | -------------------------------------------------------------------------------- /test/ares-fuzz.c: -------------------------------------------------------------------------------- 1 | /* 2 | * General driver to allow command-line fuzzer (i.e. afl) to 3 | * exercise the libFuzzer entrypoint. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #define kMaxAflInputSize (1 << 20) 14 | static unsigned char afl_buffer[kMaxAflInputSize]; 15 | 16 | #ifdef __AFL_LOOP 17 | /* If we are built with afl-clang-fast, use persistent mode */ 18 | #define KEEP_FUZZING(count) __AFL_LOOP(1000) 19 | #else 20 | /* If we are built with afl-clang, execute each input once */ 21 | #define KEEP_FUZZING(count) ((count) < 1) 22 | #endif 23 | 24 | /* In ares-test-fuzz.c: */ 25 | int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size); 26 | 27 | static void ProcessFile(int fd) { 28 | ssize_t count = read(fd, afl_buffer, kMaxAflInputSize); 29 | /* 30 | * Make a copy of the data so that it's not part of a larger 31 | * buffer (where buffer overflows would go unnoticed). 32 | */ 33 | unsigned char *copied_data = (unsigned char *)malloc(count); 34 | LLVMFuzzerTestOneInput(copied_data, count); 35 | free(copied_data); 36 | } 37 | 38 | int main(int argc, char *argv[]) { 39 | if (argc == 1) { 40 | int count = 0; 41 | while (KEEP_FUZZING(count)) { 42 | ProcessFile(fileno(stdin)); 43 | count++; 44 | } 45 | } else { 46 | int ii; 47 | for (ii = 1; ii < argc; ++ii) { 48 | int fd = open(argv[ii], O_RDONLY); 49 | if (fd < 0) { 50 | fprintf(stderr, "Failed to open '%s'\n", argv[ii]); 51 | continue; 52 | } 53 | ProcessFile(fd); 54 | close(fd); 55 | } 56 | } 57 | return 0; 58 | } 59 | -------------------------------------------------------------------------------- /ares_library_init.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CARES_LIBRARY_INIT_H 2 | #define HEADER_CARES_LIBRARY_INIT_H 3 | 4 | 5 | /* Copyright 1998 by the Massachusetts Institute of Technology. 6 | * Copyright (C) 2004-2011 by Daniel Stenberg 7 | * 8 | * Permission to use, copy, modify, and distribute this 9 | * software and its documentation for any purpose and without 10 | * fee is hereby granted, provided that the above copyright 11 | * notice appear in all copies and that both that copyright 12 | * notice and this permission notice appear in supporting 13 | * documentation, and that the name of M.I.T. not be used in 14 | * advertising or publicity pertaining to distribution of the 15 | * software without specific, written prior permission. 16 | * M.I.T. makes no representations about the suitability of 17 | * this software for any purpose. It is provided "as is" 18 | * without express or implied warranty. 19 | */ 20 | 21 | #include "ares_setup.h" 22 | 23 | #ifdef USE_WINSOCK 24 | 25 | #include 26 | #include 27 | 28 | typedef DWORD (WINAPI *fpGetNetworkParams_t) (FIXED_INFO*, DWORD*); 29 | typedef BOOLEAN (APIENTRY *fpSystemFunction036_t) (void*, ULONG); 30 | typedef ULONG (WINAPI *fpGetAdaptersAddresses_t) ( ULONG, ULONG, void*, IP_ADAPTER_ADDRESSES*, ULONG* ); 31 | 32 | /* Forward-declaration of variables defined in ares_library_init.c */ 33 | /* that are global and unique instances for whole c-ares library. */ 34 | 35 | extern fpGetNetworkParams_t ares_fpGetNetworkParams; 36 | extern fpSystemFunction036_t ares_fpSystemFunction036; 37 | extern fpGetAdaptersAddresses_t ares_fpGetAdaptersAddresses; 38 | 39 | #endif /* USE_WINSOCK */ 40 | 41 | #endif /* HEADER_CARES_LIBRARY_INIT_H */ 42 | 43 | -------------------------------------------------------------------------------- /vc/vc6aws.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "cares"=".\cares\vc6cares.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "acountry"=".\acountry\vc6acountry.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name cares 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Project: "adig"=".\adig\vc6adig.dsp" - Package Owner=<4> 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<4> 40 | {{{ 41 | Begin Project Dependency 42 | Project_Dep_Name cares 43 | End Project Dependency 44 | }}} 45 | 46 | ############################################################################### 47 | 48 | Project: "ahost"=".\ahost\vc6ahost.dsp" - Package Owner=<4> 49 | 50 | Package=<5> 51 | {{{ 52 | }}} 53 | 54 | Package=<4> 55 | {{{ 56 | Begin Project Dependency 57 | Project_Dep_Name cares 58 | End Project Dependency 59 | }}} 60 | 61 | ############################################################################### 62 | 63 | Global: 64 | 65 | Package=<5> 66 | {{{ 67 | }}} 68 | 69 | Package=<3> 70 | {{{ 71 | }}} 72 | 73 | ############################################################################### 74 | 75 | -------------------------------------------------------------------------------- /ares_set_local_dev.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright 2010 by Ben Greear 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_SET_LOCAL_DEV 3 "30 June 2010" 17 | .SH NAME 18 | ares_set_local_dev \- Bind to a specific network device when creating sockets. 19 | .SH SYNOPSIS 20 | .nf 21 | .B #include 22 | .PP 23 | .B void ares_set_local_dev(ares_channel \fIchannel\fP, const char* \fIlocal_dev_name\fP) 24 | .fi 25 | .SH DESCRIPTION 26 | The \fBares_set_local_dev\fP function causes all future sockets 27 | to be bound to this device with SO_BINDTODEVICE. This forces communications 28 | to go over a certain interface, which can be useful on multi-homed machines. 29 | This option is only supported on Linux, and root privileges are required 30 | for the option to work. If SO_BINDTODEVICE is not supported or the 31 | setsocktop call fails (probably because of permissions), the error is 32 | silently ignored. 33 | .SH SEE ALSO 34 | .BR ares_set_local_ipv4 (3) 35 | .BR ares_set_local_ipv6 (3) 36 | .SH NOTES 37 | This function was added in c-ares 1.7.4 38 | .SH AUTHOR 39 | Ben Greear 40 | -------------------------------------------------------------------------------- /ares_cancel.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright 1998 by the Massachusetts Institute of Technology. 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_CANCEL 3 "31 March 2004" 17 | .SH NAME 18 | ares_cancel \- Cancel a resolve 19 | .SH SYNOPSIS 20 | .nf 21 | #include 22 | 23 | void ares_cancel(ares_channel \fIchannel\fP) 24 | .fi 25 | .SH DESCRIPTION 26 | The \fBares_cancel(3)\fP function cancels all lookups/requests made on the the 27 | name service channel identified by \fIchannel\fP. \fBares_cancel(3)\fP 28 | invokes the callbacks for each pending query on the channel, passing a status 29 | of 30 | .BR ARES_ECANCELLED . 31 | These calls give the callbacks a chance to clean up any state which might have 32 | been stored in their arguments. If such a callback invocation adds a new 33 | request to the channel, that request will \fInot\fP be cancelled by the 34 | current invocation of \fBares_cancel(3)\fP. 35 | .SH SEE ALSO 36 | .BR ares_init (3) 37 | .BR ares_destroy (3) 38 | .SH NOTES 39 | This function was added in c-ares 1.2.0 40 | 41 | c-ares 1.6.0 and earlier pass a status of 42 | .BR ARES_ETIMEOUT 43 | instead of 44 | .BR ARES_ECANCELLED . 45 | .SH AUTHOR 46 | Dirk Manske 47 | -------------------------------------------------------------------------------- /ares_free_hostent.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright 1998 by the Massachusetts Institute of Technology. 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_FREE_HOSTENT 3 "23 July 1998" 17 | .SH NAME 18 | ares_free_hostent \- Free host structure allocated by ares functions 19 | .SH SYNOPSIS 20 | .nf 21 | .B #include 22 | .PP 23 | .B void ares_free_hostent(struct hostent *\fIhost\fP) 24 | .fi 25 | .SH DESCRIPTION 26 | The 27 | .I ares_free_hostent 28 | function frees a 29 | .B struct hostent 30 | allocated by one of the functions \fIares_parse_a_reply(3)\fP, 31 | \fIares_parse_aaaa_reply(3)\fP, or \fIares_parse_ptr_reply(3)\fP. 32 | .SH NOTES 33 | It is not necessary (and is not correct) to free the host structure passed to 34 | the callback functions for \fIares_gethostbyname(3)\fP or 35 | \fIares_gethostbyaddr(3)\fP. c-ares will automatically free such host 36 | structures when the callback returns. 37 | .SH SEE ALSO 38 | .BR ares_parse_a_reply (3), 39 | .BR ares_parse_aaaa_reply (3), 40 | .BR ares_parse_ptr_reply (3), 41 | .BR ares_parse_ns_reply (3) 42 | .SH AUTHOR 43 | Greg Hudson, MIT Information Systems 44 | .br 45 | Copyright 1998 by the Massachusetts Institute of Technology. 46 | -------------------------------------------------------------------------------- /bitncmp.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") 4 | * Copyright (c) 1996,1999 by Internet Software Consortium. 5 | * 6 | * Permission to use, copy, modify, and distribute this software for any 7 | * purpose with or without fee is hereby granted, provided that the above 8 | * copyright notice and this permission notice appear in all copies. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES 11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR 13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 16 | * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | 19 | #ifndef HAVE_BITNCMP 20 | 21 | #include "ares_setup.h" 22 | #include "bitncmp.h" 23 | 24 | /* 25 | * int 26 | * bitncmp(l, r, n) 27 | * compare bit masks l and r, for n bits. 28 | * return: 29 | * <0, >0, or 0 in the libc tradition. 30 | * note: 31 | * network byte order assumed. this means 192.5.5.240/28 has 32 | * 0x11110000 in its fourth octet. 33 | * author: 34 | * Paul Vixie (ISC), June 1996 35 | */ 36 | int ares__bitncmp(const void *l, const void *r, int n) 37 | { 38 | unsigned int lb, rb; 39 | int x, b; 40 | 41 | b = n / 8; 42 | x = memcmp(l, r, b); 43 | if (x || (n % 8) == 0) 44 | return (x); 45 | 46 | lb = ((const unsigned char *)l)[b]; 47 | rb = ((const unsigned char *)r)[b]; 48 | for (b = n % 8; b > 0; b--) { 49 | if ((lb & 0x80) != (rb & 0x80)) { 50 | if (lb & 0x80) 51 | return (1); 52 | return (-1); 53 | } 54 | lb <<= 1; 55 | rb <<= 1; 56 | } 57 | return (0); 58 | } 59 | #endif 60 | -------------------------------------------------------------------------------- /ares_inet_pton.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright (C) 2013 by Daniel Stenberg 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_INET_PTON 3 "17 Feb 2013" 17 | .SH NAME 18 | ares_inet_pton \- convert an IPv4 or IPv6 address from text to binary form 19 | .SH SYNOPSIS 20 | .nf 21 | .B #include 22 | .PP 23 | .B const char *ares_inet_pton(int af, const char *src, void *dst); 24 | .fi 25 | .SH DESCRIPTION 26 | This is a portable version with the identical functionality of the commonly 27 | available \fIinet_pton\fP. 28 | 29 | The ares_inet_pton() function converts the address in its standard text 30 | presentation form into its numeric binary form. The \fBaf\fP argument shall 31 | specify the family of the address. The AF_INET and AF_INET6 address families 32 | shall be supported. The \fBsrc\fP argument points to the string being passed 33 | in. The \fBdst\fP argument points to a buffer into which the function stores 34 | the numeric address; this shall be large enough to hold the numeric address 35 | (32 bits for AF_INET, 128 bits for AF_INET6). 36 | .SH SEE ALSO 37 | .BR ares_init(3), 38 | .BR ares_inet_ntop(3) 39 | .SH AVAILABILITY 40 | made properly publicly available in c-ares for real in version 1.10.0 41 | .SH AUTHOR 42 | Daniel Stenberg 43 | 44 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/test/production.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // This is part of the unit test for include/gtest/gtest_prod.h. 33 | 34 | #include "production.h" 35 | 36 | PrivateCode::PrivateCode() : x_(0) {} 37 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/msvc/2005/gmock.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock", "gmock.vcproj", "{34681F0D-CE45-415D-B5F2-5C662DFE3BD5}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_test", "gmock_test.vcproj", "{F10D22F8-AC7B-4213-8720-608E7D878CD2}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_main", "gmock_main.vcproj", "{E4EF614B-30DF-4954-8C53-580A0BF6B589}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Win32 = Debug|Win32 13 | Release|Win32 = Release|Win32 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.Build.0 = Debug|Win32 18 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.ActiveCfg = Release|Win32 19 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.Build.0 = Release|Win32 20 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.Build.0 = Debug|Win32 22 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.ActiveCfg = Release|Win32 23 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.Build.0 = Release|Win32 24 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.ActiveCfg = Debug|Win32 25 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.Build.0 = Debug|Win32 26 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.ActiveCfg = Release|Win32 27 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.Build.0 = Release|Win32 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /ares_strcasecmp.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* Copyright 1998 by the Massachusetts Institute of Technology. 4 | * 5 | * Permission to use, copy, modify, and distribute this 6 | * software and its documentation for any purpose and without 7 | * fee is hereby granted, provided that the above copyright 8 | * notice appear in all copies and that both that copyright 9 | * notice and this permission notice appear in supporting 10 | * documentation, and that the name of M.I.T. not be used in 11 | * advertising or publicity pertaining to distribution of the 12 | * software without specific, written prior permission. 13 | * M.I.T. makes no representations about the suitability of 14 | * this software for any purpose. It is provided "as is" 15 | * without express or implied warranty. 16 | */ 17 | 18 | #include "ares_setup.h" 19 | #include "ares_strcasecmp.h" 20 | 21 | #ifndef HAVE_STRCASECMP 22 | int ares_strcasecmp(const char *a, const char *b) 23 | { 24 | #if defined(HAVE_STRCMPI) 25 | return strcmpi(a, b); 26 | #elif defined(HAVE_STRICMP) 27 | return stricmp(a, b); 28 | #else 29 | size_t i; 30 | 31 | for (i = 0; i < (size_t)-1; i++) { 32 | int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i]; 33 | int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i]; 34 | if (c1 != c2) 35 | return c1-c2; 36 | if (!c1) 37 | break; 38 | } 39 | return 0; 40 | #endif 41 | } 42 | #endif 43 | 44 | #ifndef HAVE_STRNCASECMP 45 | int ares_strncasecmp(const char *a, const char *b, size_t n) 46 | { 47 | #if defined(HAVE_STRNCMPI) 48 | return strncmpi(a, b, n); 49 | #elif defined(HAVE_STRNICMP) 50 | return strnicmp(a, b, n); 51 | #else 52 | size_t i; 53 | 54 | for (i = 0; i < n; i++) { 55 | int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i]; 56 | int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i]; 57 | if (c1 != c2) 58 | return c1-c2; 59 | if (!c1) 60 | break; 61 | } 62 | return 0; 63 | #endif 64 | } 65 | #endif 66 | 67 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/msvc/2010/gmock.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual C++ Express 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock", "gmock.vcxproj", "{34681F0D-CE45-415D-B5F2-5C662DFE3BD5}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_test", "gmock_test.vcxproj", "{F10D22F8-AC7B-4213-8720-608E7D878CD2}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_main", "gmock_main.vcxproj", "{E4EF614B-30DF-4954-8C53-580A0BF6B589}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Win32 = Debug|Win32 13 | Release|Win32 = Release|Win32 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.Build.0 = Debug|Win32 18 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.ActiveCfg = Release|Win32 19 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.Build.0 = Release|Win32 20 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.Build.0 = Debug|Win32 22 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.ActiveCfg = Release|Win32 23 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.Build.0 = Release|Win32 24 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.ActiveCfg = Debug|Win32 25 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.Build.0 = Debug|Win32 26 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.ActiveCfg = Release|Win32 27 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.Build.0 = Release|Win32 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/src/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | GTEST_API_ int main(int argc, char **argv) { 35 | printf("Running main() from gtest_main.cc\n"); 36 | testing::InitGoogleTest(&argc, argv); 37 | return RUN_ALL_TESTS(); 38 | } 39 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/fused-src/gtest/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | GTEST_API_ int main(int argc, char **argv) { 35 | printf("Running main() from gtest_main.cc\n"); 36 | testing::InitGoogleTest(&argc, argv); 37 | return RUN_ALL_TESTS(); 38 | } 39 | -------------------------------------------------------------------------------- /acountry.1: -------------------------------------------------------------------------------- 1 | .TH ACOUNTRY "1" "April 2011" "c-ares utilities" 2 | .SH NAME 3 | acountry \- print the country where an IPv4 address or host is located 4 | .SH SYNOPSIS 5 | .B acountry 6 | [\fIOPTION\fR]... \fIHOST\fR... 7 | .SH DESCRIPTION 8 | .PP 9 | .\" Add any additional description here 10 | .PP 11 | Print the country where HOST (an IPv4 address or hostname) is located, 12 | using the countries.nerd.dk DNS domain to identify the country. 13 | .PP 14 | This utility comes with the \fBc\-ares\fR asynchronous resolver library. 15 | .SH OPTIONS 16 | .TP 17 | \fB\-d\fR 18 | Print some extra debugging output. 19 | .TP 20 | \fB\-h\fR, \fB\-\-help\fR 21 | Display this help and exit. 22 | .TP 23 | \fB\-v\fR 24 | Be more verbose. Print extra information. 25 | .SH "REPORTING BUGS" 26 | Report bugs to the c-ares mailing list: 27 | \fBhttp://cool.haxx.se/mailman/listinfo/c-ares\fR 28 | .SH "SEE ALSO" 29 | .PP 30 | adig(1), ahost(1). 31 | .PP 32 | The DNSBL countries.nerd.dk 33 | .br 34 | \fBhttp://countries.nerd.dk/\fR 35 | .SH COPYRIGHT 36 | This utility is based on code/ideas contained in sofware written by Greg Hudson (ares) 37 | carrying the following notice: 38 | .br 39 | Copyright 1998 by the Massachusetts Institute of Technology. 40 | .br 41 | Permission to use, copy, modify, and distribute this software and its 42 | documentation for any purpose and without fee is hereby granted, 43 | provided that the above copyright notice appear in all copies and that 44 | both that copyright notice and this permission notice appear in 45 | supporting documentation, and that the name of M.I.T. not be used in 46 | advertising or publicity pertaining to distribution of the software 47 | without specific, written prior permission. M.I.T. makes no 48 | representations about the suitability of this software for any 49 | purpose. It is provided "as is" without express or implied warranty. 50 | .br 51 | No further copyright claims are being made by the author(s) of this utility. 52 | .SH AUTHOR 53 | Gisle Vanem 54 | -------------------------------------------------------------------------------- /ares_nowarn.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_CARES_NOWARN_H 2 | #define HEADER_CARES_NOWARN_H 3 | 4 | 5 | /* Copyright (C) 2010-2012 by Daniel Stenberg 6 | * 7 | * Permission to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose and without 9 | * fee is hereby granted, provided that the above copyright 10 | * notice appear in all copies and that both that copyright 11 | * notice and this permission notice appear in supporting 12 | * documentation, and that the name of M.I.T. not be used in 13 | * advertising or publicity pertaining to distribution of the 14 | * software without specific, written prior permission. 15 | * M.I.T. makes no representations about the suitability of 16 | * this software for any purpose. It is provided "as is" 17 | * without express or implied warranty. 18 | */ 19 | 20 | long aresx_uztosl(size_t uznum); 21 | int aresx_uztosi(size_t uznum); 22 | short aresx_uztoss(size_t uznum); 23 | 24 | short aresx_sitoss(int sinum); 25 | 26 | int aresx_sltosi(long slnum); 27 | 28 | int aresx_sztosi(ssize_t sznum); 29 | 30 | unsigned int aresx_sztoui(ssize_t sznum); 31 | 32 | unsigned short aresx_sitous(int sinum); 33 | 34 | #if defined(__INTEL_COMPILER) && defined(__unix__) 35 | 36 | int aresx_FD_ISSET(int fd, fd_set *fdset); 37 | 38 | void aresx_FD_SET(int fd, fd_set *fdset); 39 | 40 | void aresx_FD_ZERO(fd_set *fdset); 41 | 42 | unsigned short aresx_htons(unsigned short usnum); 43 | 44 | unsigned short aresx_ntohs(unsigned short usnum); 45 | 46 | #ifndef BUILDING_ARES_NOWARN_C 47 | # undef FD_ISSET 48 | # define FD_ISSET(a,b) aresx_FD_ISSET((a),(b)) 49 | # undef FD_SET 50 | # define FD_SET(a,b) aresx_FD_SET((a),(b)) 51 | # undef FD_ZERO 52 | # define FD_ZERO(a) aresx_FD_ZERO((a)) 53 | # undef htons 54 | # define htons(a) aresx_htons((a)) 55 | # undef ntohs 56 | # define ntohs(a) aresx_ntohs((a)) 57 | #endif 58 | 59 | #endif /* __INTEL_COMPILER && __unix__ */ 60 | 61 | #endif /* HEADER_CARES_NOWARN_H */ 62 | -------------------------------------------------------------------------------- /Makefile.dj: -------------------------------------------------------------------------------- 1 | # 2 | # c-ares Makefile for djgpp/gcc/Watt-32. 3 | # By Gisle Vanem 2004. 4 | # 5 | 6 | 7 | TOPDIR = .. 8 | 9 | DEPEND_PREREQ = ares_config.h 10 | 11 | include ../packages/DOS/common.dj 12 | include Makefile.inc 13 | 14 | CFLAGS += -DWATT32 -Dselect=select_s 15 | 16 | LDFLAGS = -s 17 | 18 | ifeq ($(USE_CURLDEBUG),1) 19 | EX_LIBS = ../lib/libcurl.a 20 | OBJ_HACK = $(OBJECTS) 21 | else 22 | OBJ_HACK = libcares.a 23 | endif 24 | 25 | ifeq ($(USE_SSL),1) 26 | EX_LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a 27 | endif 28 | 29 | ifeq ($(USE_ZLIB),1) 30 | EX_LIBS += $(ZLIB_ROOT)/libz.a 31 | endif 32 | 33 | ifeq ($(USE_IDNA),1) 34 | EX_LIBS += $(LIBIDN_ROOT)/lib/dj_obj/libidn.a -liconv 35 | endif 36 | 37 | EX_LIBS += $(WATT32_ROOT)/lib/libwatt.a 38 | 39 | OBJECTS = $(addprefix $(OBJ_DIR)/, $(CSOURCES:.c=.o)) 40 | 41 | all: $(OBJ_DIR) ares_config.h libcares.a ahost.exe adig.exe acountry.exe 42 | @echo Welcome to c-ares. 43 | 44 | libcares.a: $(OBJECTS) 45 | ar rs $@ $? 46 | 47 | ares_config.h: config-dos.h 48 | $(COPY) $^ $@ 49 | 50 | ahost.exe: ahost.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK) 51 | $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS) 52 | 53 | adig.exe: adig.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK) 54 | $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS) 55 | 56 | acountry.exe: acountry.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK) 57 | $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS) 58 | 59 | # clean generated files 60 | # 61 | genclean: 62 | - $(DELETE) ares_config.h 63 | 64 | # clean object files and subdir 65 | # 66 | objclean: genclean 67 | - $(DELETE) $(OBJ_DIR)$(DS)*.o 68 | - $(RMDIR) $(OBJ_DIR) 69 | 70 | # clean without removing built library and programs 71 | # 72 | clean: objclean 73 | - $(DELETE) depend.dj 74 | 75 | # clean everything 76 | # 77 | realclean vclean: clean 78 | - $(DELETE) libcares.a 79 | - $(DELETE) acountry.exe 80 | - $(DELETE) adig.exe 81 | - $(DELETE) ahost.exe 82 | - $(DELETE) libcares.a 83 | 84 | -include depend.dj 85 | 86 | -------------------------------------------------------------------------------- /RELEASE-NOTES: -------------------------------------------------------------------------------- 1 | c-ares version 1.12.0 2 | 3 | Changes: 4 | 5 | o api: add ARES_OPT_NOROTATE optmask value 6 | 7 | Bug fixes: 8 | 9 | o CVE-2016-5180: ares_create_query single byte out of buffer write [4] 10 | o configure: acknowledge --disable-tests [1] 11 | o man pages: fix typos detected by Lintian 12 | o test: add missing #includes for dns-proto.cc 13 | o test: avoid in6addr_* constants 14 | o test: Build with MinGW on AppVeyor 15 | o Makefile.m32: add support for extra flags 16 | o Makefile.m32: add support for CROSSPREFIX 17 | o configure: check if tests can get built before enabled 18 | o ares_library_cleanup: reset ares_realloc too 19 | o ahost.c: add cast to fix C++ compile 20 | o test: Only pass unused args to GoogleTest 21 | o build: commonize MSVC version detection 22 | o msvc_ver.inc: support Visual Studio 2015 Update 1, 2, 3 23 | o test: for AF_UNSPEC, return CNAME only for AAAA, but valid A record 24 | o ares_getnameinfo: explicitly clear struct servent before use 25 | o test: Update fuzzing function prototype 26 | o init: fix nsort initialization 27 | o test: add fuzzing check script to tests 28 | o web: http => https 29 | o read_tcp_data: remove superfluous NULL check 30 | o LICENSE.md: add a stand-alone license file 31 | o SECURITY.md: suggested "security process" for the project 32 | o ares_init_options: only propagate init failures from options [2] 33 | o headers: remove checks for and defines of variable sizes 34 | o test: fix gMock to work with gcc >= 6.x [3] 35 | 36 | Thanks go to these friendly people for their efforts and contributions: 37 | 38 | Alexander Drachevskiy, Brad House, Chris Araman, Daniel Stenberg, 39 | David Drysdale, Gregor Jasny, Svante Karlsson, Viktor Szakats 40 | 41 | References to bug reports and discussions on issues: 42 | 43 | [1] = https://github.com/c-ares/c-ares/issues/44 44 | [2] = https://github.com/c-ares/c-ares/issues/60 45 | [3] = https://github.com/google/googletest/issues/705#issuecomment-235067917 46 | [4] = https://c-ares.haxx.se/adv_20160929.html 47 | -------------------------------------------------------------------------------- /git2changes.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # git log --pretty=fuller --no-color --date=short --decorate=full 4 | 5 | my @mname = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 6 | 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ); 7 | 8 | sub nicedate { 9 | my ($date)=$_; 10 | 11 | if($date =~ /(\d\d\d\d)-(\d\d)-(\d\d)/) { 12 | return sprintf("%d %s %4d", $3, $mname[$2-1], $1); 13 | } 14 | return $date; 15 | } 16 | 17 | print 18 | ' Changelog for the c-ares project. Generated with git2changes.pl 19 | '; 20 | 21 | my $line; 22 | my $tag; 23 | while() { 24 | my $l = $_; 25 | 26 | if($l =~/^commit ([[:xdigit:]]*) ?(.*)/) { 27 | $co = $1; 28 | my $ref = $2; 29 | if ($ref =~ /refs\/tags\/c[-]*ares-([0-9._]*)/) { 30 | $tag = $1; 31 | $tag =~ s/_/./g; 32 | } else { 33 | $tag = ''; 34 | } 35 | } 36 | elsif($l =~ /^Author: *(.*) + 22 | 23 | int ares_fds(ares_channel \fIchannel\fP, 24 | fd_set *\fIread_fds\fP, 25 | fd_set *\fIwrite_fds\fP) 26 | .fi 27 | .SH DESCRIPTION 28 | The \fBares_fds(3)\fP function retrieves the set of file descriptors which the 29 | calling application should select on for reading and writing for the 30 | processing of name service queries pending on the name service channel 31 | identified by \fIchannel\fP. 32 | 33 | File descriptors will be set in the file descriptor sets pointed to by 34 | \fIread_fds\fP and \fIwrite_fds\fP as appropriate. File descriptors already 35 | set in \fIread_fds\fP and \fIwrite_fds\fP will remain set; initialization of 36 | the file descriptor sets (using \fBFD_ZERO\fP) is the responsibility of the 37 | caller. 38 | .SH RETURN VALUES 39 | \fBares_fds(3)\fP returns a value that is one greater than the number of the 40 | highest socket set in either \fIread_fds\fP or \fIwrite_fds\fP. If no queries 41 | are active, \fBares_fds(3)\fP returns 0. 42 | .SH SEE ALSO 43 | .BR ares_timeout (3), 44 | .BR ares_process (3) 45 | .SH AUTHOR 46 | Greg Hudson, MIT Information Systems 47 | .br 48 | Copyright 1998 by the Massachusetts Institute of Technology. 49 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/test/gtest_main_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include "gtest/gtest.h" 33 | 34 | // Tests that we don't have to define main() when we link to 35 | // gtest_main instead of gtest. 36 | 37 | namespace { 38 | 39 | TEST(GTestMainTest, ShouldSucceed) { 40 | } 41 | 42 | } // namespace 43 | 44 | // We are using the main() function defined in src/gtest_main.cc, so 45 | // we don't define it here. 46 | -------------------------------------------------------------------------------- /ares_timeout.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright 1998 by the Massachusetts Institute of Technology. 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_TIMEOUT 3 "25 July 1998" 17 | .SH NAME 18 | ares_timeout \- return maximum time to wait 19 | .SH SYNOPSIS 20 | .nf 21 | #include 22 | 23 | struct timeval *ares_timeout(ares_channel \fIchannel\fP, 24 | struct timeval *\fImaxtv\fP, 25 | struct timeval *\fItv\fP) 26 | .fi 27 | .SH DESCRIPTION 28 | The \fBares_timeout(3)\fP function determines the maximum time for which the 29 | caller should wait before invoking \fIares_process(3)\fP to process timeouts. 30 | The parameter \fImaxtv\fP specifies a existing maximum timeout, or \fBNULL\fP 31 | if the caller does not wish to apply a maximum timeout. The parameter 32 | \fItv\fP must point to a writable buffer of type \fBstruct timeval\fP It is 33 | valid for \fImaxtv\fP and \fItv\fP to have the same value. 34 | 35 | If no queries have timeouts pending sooner than the given maximum timeout, 36 | \fBares_timeout(3)\fP returns the value of \fImaxtv\fP; otherwise 37 | \fBares_timeout(3)\fP stores the appropriate timeout value into the buffer 38 | pointed to by \fItv\fP and returns the value of \fItv\fP. 39 | .SH SEE ALSO 40 | .BR ares_fds (3), 41 | .BR ares_process (3), 42 | .BR ares_process_fd (3) 43 | .SH AUTHOR 44 | Greg Hudson, MIT Information Systems 45 | .br 46 | Copyright 1998 by the Massachusetts Institute of Technology. 47 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/samples/sample4_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include "gtest/gtest.h" 33 | #include "sample4.h" 34 | 35 | // Tests the Increment() method. 36 | TEST(Counter, Increment) { 37 | Counter c; 38 | 39 | // EXPECT_EQ() evaluates its arguments exactly once, so they 40 | // can have side effects. 41 | 42 | EXPECT_EQ(0, c.Increment()); 43 | EXPECT_EQ(1, c.Increment()); 44 | EXPECT_EQ(2, c.Increment()); 45 | } 46 | -------------------------------------------------------------------------------- /ares_llist.c: -------------------------------------------------------------------------------- 1 | 2 | /* Copyright 1998 by the Massachusetts Institute of Technology. 3 | * 4 | * Permission to use, copy, modify, and distribute this 5 | * software and its documentation for any purpose and without 6 | * fee is hereby granted, provided that the above copyright 7 | * notice appear in all copies and that both that copyright 8 | * notice and this permission notice appear in supporting 9 | * documentation, and that the name of M.I.T. not be used in 10 | * advertising or publicity pertaining to distribution of the 11 | * software without specific, written prior permission. 12 | * M.I.T. makes no representations about the suitability of 13 | * this software for any purpose. It is provided "as is" 14 | * without express or implied warranty. 15 | */ 16 | 17 | #include "ares_setup.h" 18 | 19 | #include "ares.h" 20 | #include "ares_private.h" 21 | 22 | /* Routines for managing doubly-linked circular linked lists with a 23 | * dummy head. 24 | */ 25 | 26 | /* Initialize a new head node */ 27 | void ares__init_list_head(struct list_node* head) { 28 | head->prev = head; 29 | head->next = head; 30 | head->data = NULL; 31 | } 32 | 33 | /* Initialize a list node */ 34 | void ares__init_list_node(struct list_node* node, void* d) { 35 | node->prev = NULL; 36 | node->next = NULL; 37 | node->data = d; 38 | } 39 | 40 | /* Returns true iff the given list is empty */ 41 | int ares__is_list_empty(struct list_node* head) { 42 | return ((head->next == head) && (head->prev == head)); 43 | } 44 | 45 | /* Inserts new_node before old_node */ 46 | void ares__insert_in_list(struct list_node* new_node, 47 | struct list_node* old_node) { 48 | new_node->next = old_node; 49 | new_node->prev = old_node->prev; 50 | old_node->prev->next = new_node; 51 | old_node->prev = new_node; 52 | } 53 | 54 | /* Removes the node from the list it's in, if any */ 55 | void ares__remove_from_list(struct list_node* node) { 56 | if (node->next != NULL) { 57 | node->prev->next = node->next; 58 | node->next->prev = node->prev; 59 | node->prev = NULL; 60 | node->next = NULL; 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/samples/sample1.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #ifndef GTEST_SAMPLES_SAMPLE1_H_ 35 | #define GTEST_SAMPLES_SAMPLE1_H_ 36 | 37 | // Returns n! (the factorial of n). For negative n, n! is defined to be 1. 38 | int Factorial(int n); 39 | 40 | // Returns true iff n is a prime number. 41 | bool IsPrime(int n); 42 | 43 | #endif // GTEST_SAMPLES_SAMPLE1_H_ 44 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/test/gtest_uninitialized_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include "gtest/gtest.h" 33 | 34 | TEST(DummyTest, Dummy) { 35 | // This test doesn't verify anything. We just need it to create a 36 | // realistic stage for testing the behavior of Google Test when 37 | // RUN_ALL_TESTS() is called without testing::InitGoogleTest() being 38 | // called first. 39 | } 40 | 41 | int main() { 42 | return RUN_ALL_TESTS(); 43 | } 44 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/test/gmock_link2_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev) 31 | 32 | // Google Mock - a framework for writing C++ mock classes. 33 | // 34 | // This file is for verifying that various Google Mock constructs do not 35 | // produce linker errors when instantiated in different translation units. 36 | // Please see gmock_link_test.h for details. 37 | 38 | #define LinkTest LinkTest2 39 | 40 | #include "test/gmock_link_test.h" 41 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/test/gmock_link_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev) 31 | 32 | // Google Mock - a framework for writing C++ mock classes. 33 | // 34 | // This file is for verifying that various Google Mock constructs do not 35 | // produce linker errors when instantiated in different translation units. 36 | // Please see gmock_link_test.h for details. 37 | 38 | #define LinkTest LinkTest1 39 | 40 | #include "test/gmock_link_test.h" 41 | -------------------------------------------------------------------------------- /ares_strerror.c: -------------------------------------------------------------------------------- 1 | 2 | /* Copyright 1998 by the Massachusetts Institute of Technology. 3 | * 4 | * Permission to use, copy, modify, and distribute this 5 | * software and its documentation for any purpose and without 6 | * fee is hereby granted, provided that the above copyright 7 | * notice appear in all copies and that both that copyright 8 | * notice and this permission notice appear in supporting 9 | * documentation, and that the name of M.I.T. not be used in 10 | * advertising or publicity pertaining to distribution of the 11 | * software without specific, written prior permission. 12 | * M.I.T. makes no representations about the suitability of 13 | * this software for any purpose. It is provided "as is" 14 | * without express or implied warranty. 15 | */ 16 | 17 | #include "ares_setup.h" 18 | #include 19 | #include "ares.h" 20 | 21 | const char *ares_strerror(int code) 22 | { 23 | /* Return a string literal from a table. */ 24 | const char *errtext[] = { 25 | "Successful completion", 26 | "DNS server returned answer with no data", 27 | "DNS server claims query was misformatted", 28 | "DNS server returned general failure", 29 | "Domain name not found", 30 | "DNS server does not implement requested operation", 31 | "DNS server refused query", 32 | "Misformatted DNS query", 33 | "Misformatted domain name", 34 | "Unsupported address family", 35 | "Misformatted DNS reply", 36 | "Could not contact DNS servers", 37 | "Timeout while contacting DNS servers", 38 | "End of file", 39 | "Error reading file", 40 | "Out of memory", 41 | "Channel is being destroyed", 42 | "Misformatted string", 43 | "Illegal flags specified", 44 | "Given hostname is not numeric", 45 | "Illegal hints flags specified", 46 | "c-ares library initialization not yet performed", 47 | "Error loading iphlpapi.dll", 48 | "Could not find GetNetworkParams function", 49 | "DNS query cancelled" 50 | }; 51 | 52 | if(code >= 0 && code < (int)(sizeof(errtext) / sizeof(*errtext))) 53 | return errtext[code]; 54 | else 55 | return "unknown"; 56 | } 57 | -------------------------------------------------------------------------------- /ares_writev.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* Copyright 1998 by the Massachusetts Institute of Technology. 4 | * 5 | * Permission to use, copy, modify, and distribute this 6 | * software and its documentation for any purpose and without 7 | * fee is hereby granted, provided that the above copyright 8 | * notice appear in all copies and that both that copyright 9 | * notice and this permission notice appear in supporting 10 | * documentation, and that the name of M.I.T. not be used in 11 | * advertising or publicity pertaining to distribution of the 12 | * software without specific, written prior permission. 13 | * M.I.T. makes no representations about the suitability of 14 | * this software for any purpose. It is provided "as is" 15 | * without express or implied warranty. 16 | */ 17 | 18 | #include "ares_setup.h" 19 | 20 | #ifdef HAVE_LIMITS_H 21 | # include 22 | #endif 23 | 24 | #include "ares.h" 25 | #include "ares_private.h" 26 | 27 | #ifndef HAVE_WRITEV 28 | ssize_t ares_writev(ares_socket_t s, const struct iovec *iov, int iovcnt) 29 | { 30 | char *buffer, *bp; 31 | int i; 32 | size_t bytes = 0; 33 | ssize_t result; 34 | 35 | /* Validate iovcnt */ 36 | if (iovcnt <= 0) 37 | { 38 | SET_ERRNO(EINVAL); 39 | return (-1); 40 | } 41 | 42 | /* Validate and find the sum of the iov_len values in the iov array */ 43 | for (i = 0; i < iovcnt; i++) 44 | { 45 | if (iov[i].iov_len > INT_MAX - bytes) 46 | { 47 | SET_ERRNO(EINVAL); 48 | return (-1); 49 | } 50 | bytes += iov[i].iov_len; 51 | } 52 | 53 | if (bytes == 0) 54 | return (0); 55 | 56 | /* Allocate a temporary buffer to hold the data */ 57 | buffer = ares_malloc(bytes); 58 | if (!buffer) 59 | { 60 | SET_ERRNO(ENOMEM); 61 | return (-1); 62 | } 63 | 64 | /* Copy the data into buffer */ 65 | for (bp = buffer, i = 0; i < iovcnt; ++i) 66 | { 67 | memcpy (bp, iov[i].iov_base, iov[i].iov_len); 68 | bp += iov[i].iov_len; 69 | } 70 | 71 | /* Send buffer contents */ 72 | result = swrite(s, buffer, bytes); 73 | 74 | ares_free(buffer); 75 | 76 | return (result); 77 | } 78 | #endif 79 | 80 | -------------------------------------------------------------------------------- /ares_inet_ntop.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright (C) 2013 by Daniel Stenberg 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_INET_NTOP 3 "17 Feb 2013" 17 | .SH NAME 18 | ares_inet_ntop \- convert a network format address to presentation format 19 | .SH SYNOPSIS 20 | .nf 21 | .B #include 22 | .PP 23 | .B const char * 24 | .B ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size); 25 | .fi 26 | .SH DESCRIPTION 27 | This is a portable version with the identical functionality of the commonly 28 | available \fIinet_ntop\fP. 29 | 30 | The ares_inet_ntop() function converts a numeric address into a text string 31 | suitable for presentation. The \fBaf\fP argument shall specify the family of 32 | the address. This can be AF_INET or AF_INET6. The \fBsrc\fP argument points 33 | to a buffer holding an IPv4 address if the af argument is AF_INET, or an IPv6 34 | address if the af argument is AF_INET6; the address must be in network byte 35 | order. The \fBdst\fP argument points to a buffer where the function stores the 36 | resulting text string; it shall not be NULL. The \fBsize\fP argument specifies 37 | the size of this buffer, which shall be large enough to hold the text string 38 | (INET_ADDRSTRLEN (16) characters for IPv4, INET6_ADDRSTRLEN (46) characters 39 | for IPv6). 40 | .SH SEE ALSO 41 | .BR ares_init(3), 42 | .BR ares_inet_pton(3) 43 | .SH AVAILABILITY 44 | made properly publicly available in c-ares for real in version 1.10.0 45 | .SH AUTHOR 46 | Daniel Stenberg 47 | 48 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/samples/sample4.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #include 35 | 36 | #include "sample4.h" 37 | 38 | // Returns the current counter value, and increments it. 39 | int Counter::Increment() { 40 | return counter_++; 41 | } 42 | 43 | // Prints the current counter value to STDOUT. 44 | void Counter::Print() const { 45 | printf("%d", counter_); 46 | } 47 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/build-aux/config.h.in: -------------------------------------------------------------------------------- 1 | /* build-aux/config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_MEMORY_H 11 | 12 | /* Define if you have POSIX threads libraries and header files. */ 13 | #undef HAVE_PTHREAD 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_STDINT_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STDLIB_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STRINGS_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STRING_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_SYS_STAT_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_SYS_TYPES_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_UNISTD_H 35 | 36 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 37 | */ 38 | #undef LT_OBJDIR 39 | 40 | /* Name of package */ 41 | #undef PACKAGE 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #undef PACKAGE_BUGREPORT 45 | 46 | /* Define to the full name of this package. */ 47 | #undef PACKAGE_NAME 48 | 49 | /* Define to the full name and version of this package. */ 50 | #undef PACKAGE_STRING 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #undef PACKAGE_TARNAME 54 | 55 | /* Define to the home page for this package. */ 56 | #undef PACKAGE_URL 57 | 58 | /* Define to the version of this package. */ 59 | #undef PACKAGE_VERSION 60 | 61 | /* Define to necessary symbol if this constant uses a non-standard name on 62 | your system. */ 63 | #undef PTHREAD_CREATE_JOINABLE 64 | 65 | /* Define to 1 if you have the ANSI C header files. */ 66 | #undef STDC_HEADERS 67 | 68 | /* Version number of package */ 69 | #undef VERSION 70 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/build-aux/config.h.in: -------------------------------------------------------------------------------- 1 | /* build-aux/config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_MEMORY_H 11 | 12 | /* Define if you have POSIX threads libraries and header files. */ 13 | #undef HAVE_PTHREAD 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_STDINT_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STDLIB_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STRINGS_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STRING_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_SYS_STAT_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_SYS_TYPES_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_UNISTD_H 35 | 36 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 37 | */ 38 | #undef LT_OBJDIR 39 | 40 | /* Name of package */ 41 | #undef PACKAGE 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #undef PACKAGE_BUGREPORT 45 | 46 | /* Define to the full name of this package. */ 47 | #undef PACKAGE_NAME 48 | 49 | /* Define to the full name and version of this package. */ 50 | #undef PACKAGE_STRING 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #undef PACKAGE_TARNAME 54 | 55 | /* Define to the home page for this package. */ 56 | #undef PACKAGE_URL 57 | 58 | /* Define to the version of this package. */ 59 | #undef PACKAGE_VERSION 60 | 61 | /* Define to necessary symbol if this constant uses a non-standard name on 62 | your system. */ 63 | #undef PTHREAD_CREATE_JOINABLE 64 | 65 | /* Define to 1 if you have the ANSI C header files. */ 66 | #undef STDC_HEADERS 67 | 68 | /* Version number of package */ 69 | #undef VERSION 70 | -------------------------------------------------------------------------------- /ares_expand_string.c: -------------------------------------------------------------------------------- 1 | 2 | /* Copyright 1998 by the Massachusetts Institute of Technology. 3 | * 4 | * Permission to use, copy, modify, and distribute this 5 | * software and its documentation for any purpose and without 6 | * fee is hereby granted, provided that the above copyright 7 | * notice appear in all copies and that both that copyright 8 | * notice and this permission notice appear in supporting 9 | * documentation, and that the name of M.I.T. not be used in 10 | * advertising or publicity pertaining to distribution of the 11 | * software without specific, written prior permission. 12 | * M.I.T. makes no representations about the suitability of 13 | * this software for any purpose. It is provided "as is" 14 | * without express or implied warranty. 15 | */ 16 | 17 | #include "ares_setup.h" 18 | 19 | #ifdef HAVE_NETINET_IN_H 20 | # include 21 | #endif 22 | #ifdef HAVE_ARPA_NAMESER_H 23 | # include 24 | #else 25 | # include "nameser.h" 26 | #endif 27 | 28 | #include "ares.h" 29 | #include "ares_private.h" /* for the memdebug */ 30 | 31 | /* Simply decodes a length-encoded character string. The first byte of the 32 | * input is the length of the string to be returned and the bytes thereafter 33 | * are the characters of the string. The returned result will be NULL 34 | * terminated. 35 | */ 36 | int ares_expand_string(const unsigned char *encoded, 37 | const unsigned char *abuf, 38 | int alen, 39 | unsigned char **s, 40 | long *enclen) 41 | { 42 | unsigned char *q; 43 | union { 44 | ssize_t sig; 45 | size_t uns; 46 | } elen; 47 | 48 | if (encoded == abuf+alen) 49 | return ARES_EBADSTR; 50 | 51 | elen.uns = *encoded; 52 | if (encoded+elen.sig+1 > abuf+alen) 53 | return ARES_EBADSTR; 54 | 55 | encoded++; 56 | 57 | *s = ares_malloc(elen.uns+1); 58 | if (*s == NULL) 59 | return ARES_ENOMEM; 60 | q = *s; 61 | strncpy((char *)q, (char *)encoded, elen.uns); 62 | q[elen.uns] = '\0'; 63 | 64 | *s = q; 65 | 66 | *enclen = (long)(elen.sig+1); 67 | 68 | return ARES_SUCCESS; 69 | } 70 | 71 | -------------------------------------------------------------------------------- /ares_fds.c: -------------------------------------------------------------------------------- 1 | 2 | /* Copyright 1998 by the Massachusetts Institute of Technology. 3 | * 4 | * Permission to use, copy, modify, and distribute this 5 | * software and its documentation for any purpose and without 6 | * fee is hereby granted, provided that the above copyright 7 | * notice appear in all copies and that both that copyright 8 | * notice and this permission notice appear in supporting 9 | * documentation, and that the name of M.I.T. not be used in 10 | * advertising or publicity pertaining to distribution of the 11 | * software without specific, written prior permission. 12 | * M.I.T. makes no representations about the suitability of 13 | * this software for any purpose. It is provided "as is" 14 | * without express or implied warranty. 15 | */ 16 | 17 | #include "ares_setup.h" 18 | 19 | #include "ares.h" 20 | #include "ares_nowarn.h" 21 | #include "ares_private.h" 22 | 23 | int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds) 24 | { 25 | struct server_state *server; 26 | ares_socket_t nfds; 27 | int i; 28 | 29 | /* Are there any active queries? */ 30 | int active_queries = !ares__is_list_empty(&(channel->all_queries)); 31 | 32 | nfds = 0; 33 | for (i = 0; i < channel->nservers; i++) 34 | { 35 | server = &channel->servers[i]; 36 | /* We only need to register interest in UDP sockets if we have 37 | * outstanding queries. 38 | */ 39 | if (active_queries && server->udp_socket != ARES_SOCKET_BAD) 40 | { 41 | FD_SET(server->udp_socket, read_fds); 42 | if (server->udp_socket >= nfds) 43 | nfds = server->udp_socket + 1; 44 | } 45 | /* We always register for TCP events, because we want to know 46 | * when the other side closes the connection, so we don't waste 47 | * time trying to use a broken connection. 48 | */ 49 | if (server->tcp_socket != ARES_SOCKET_BAD) 50 | { 51 | FD_SET(server->tcp_socket, read_fds); 52 | if (server->qhead) 53 | FD_SET(server->tcp_socket, write_fds); 54 | if (server->tcp_socket >= nfds) 55 | nfds = server->tcp_socket + 1; 56 | } 57 | } 58 | return (int)nfds; 59 | } 60 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/test/gmock-port_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: vladl@google.com (Vlad Losev) 31 | 32 | // Google Mock - a framework for writing C++ mock classes. 33 | // 34 | // This file tests the internal cross-platform support utilities. 35 | 36 | #include "gmock/internal/gmock-port.h" 37 | #include "gtest/gtest.h" 38 | 39 | // NOTE: if this file is left without tests for some reason, put a dummy 40 | // test here to make references to symbols in the gtest library and avoid 41 | // 'undefined symbol' linker errors in gmock_main: 42 | 43 | TEST(DummyTest, Dummy) {} 44 | -------------------------------------------------------------------------------- /Makefile.m32: -------------------------------------------------------------------------------- 1 | ############################################################# 2 | # 3 | ## Makefile for building libcares.a with MingW32 (GCC-3.2) 4 | ## Use: make -f Makefile.m32 [demos] 5 | ## 6 | ## Quick hack by Guenter; comments to: /dev/nul 7 | # 8 | ######################################################## 9 | ## Nothing more to do below this line! 10 | 11 | LIB = libcares.a 12 | 13 | AR = $(CROSSPREFIX)ar 14 | CC = $(CROSSPREFIX)gcc 15 | LD = $(CROSSPREFIX)gcc 16 | RANLIB = $(CROSSPREFIX)ranlib 17 | #RM = rm -f 18 | CP = cp -afv 19 | 20 | CFLAGS = $(CARES_CFLAG_EXTRAS) -O2 -Wall -I. 21 | CFLAGS += -DCARES_STATICLIB 22 | LDFLAGS = $(CARES_LDFLAG_EXTRAS) -s 23 | LIBS = -lwsock32 24 | 25 | # Makefile.inc provides the CSOURCES and HHEADERS defines 26 | include Makefile.inc 27 | 28 | OBJLIB := $(patsubst %.c,%.o,$(strip $(CSOURCES))) 29 | 30 | 31 | $(LIB): $(OBJLIB) 32 | $(AR) cru $@ $^ 33 | $(RANLIB) $@ 34 | 35 | all: $(LIB) demos 36 | 37 | demos: adig.exe ahost.exe acountry.exe 38 | 39 | tags: 40 | etags *.[ch] 41 | 42 | %.exe: %.o ares_getopt.o $(LIB) 43 | $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) 44 | 45 | $(OBJLIB): ares.h ares_dns.h ares_private.h ares_build.h ares_rules.h 46 | 47 | .c.o: 48 | $(CC) $(CFLAGS) -c $< 49 | 50 | ares_build.h: 51 | $(CP) ares_build.h.dist ares_build.h 52 | 53 | check: 54 | 55 | install: 56 | ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir} 57 | ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir} 58 | ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man3 59 | ${INSTALL} -m 644 $(LIB) ${DESTDIR}${libdir} 60 | ${RANLIB} ${DESTDIR}${libdir}/$(LIB) 61 | chmod u-w ${DESTDIR}${libdir}/$(LIB) 62 | ${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir} 63 | ${INSTALL} -m 444 ${srcdir}/ares_build.h ${DESTDIR}${includedir} 64 | ${INSTALL} -m 444 ${srcdir}/ares_rules.h ${DESTDIR}${includedir} 65 | (for man in $(MANPAGES); do \ 66 | ${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \ 67 | done) 68 | 69 | clean: 70 | $(RM) ares_getopt.o $(OBJLIB) $(LIB) adig.exe ahost.exe acountry.exe 71 | 72 | distclean: clean 73 | $(RM) config.cache config.log config.status Makefile 74 | ifeq "$(wildcard ares_build.h.dist)" "ares_build.h.dist" 75 | $(RM) ares_build.h 76 | endif 77 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/codegear/gtest_link.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Josh Kelley (joshkel@gmail.com) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // Links gtest.lib and gtest_main.lib into the current project in C++Builder. 35 | // This means that these libraries can't be renamed, but it's the only way to 36 | // ensure that Debug versus Release test builds are linked against the 37 | // appropriate Debug or Release build of the libraries. 38 | 39 | #pragma link "gtest.lib" 40 | #pragma link "gtest_main.lib" 41 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/test/gtest_xml_outfile1_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: keith.ray@gmail.com (Keith Ray) 31 | // 32 | // gtest_xml_outfile1_test_ writes some xml via TestProperty used by 33 | // gtest_xml_outfiles_test.py 34 | 35 | #include "gtest/gtest.h" 36 | 37 | class PropertyOne : public testing::Test { 38 | protected: 39 | virtual void SetUp() { 40 | RecordProperty("SetUpProp", 1); 41 | } 42 | virtual void TearDown() { 43 | RecordProperty("TearDownProp", 1); 44 | } 45 | }; 46 | 47 | TEST_F(PropertyOne, TestSomeProperties) { 48 | RecordProperty("TestSomeProperty", 1); 49 | } 50 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/test/gtest_xml_outfile2_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: keith.ray@gmail.com (Keith Ray) 31 | // 32 | // gtest_xml_outfile2_test_ writes some xml via TestProperty used by 33 | // gtest_xml_outfiles_test.py 34 | 35 | #include "gtest/gtest.h" 36 | 37 | class PropertyTwo : public testing::Test { 38 | protected: 39 | virtual void SetUp() { 40 | RecordProperty("SetUpProp", 2); 41 | } 42 | virtual void TearDown() { 43 | RecordProperty("TearDownProp", 2); 44 | } 45 | }; 46 | 47 | TEST_F(PropertyTwo, TestSomeProperties) { 48 | RecordProperty("TestSomeProperty", 2); 49 | } 50 | -------------------------------------------------------------------------------- /ahost.1: -------------------------------------------------------------------------------- 1 | .TH AHOST "1" "April 2011" "c-ares utilities" 2 | .SH NAME 3 | ahost \- print the A or AAAA record associated with a hostname or IP address 4 | .SH SYNOPSIS 5 | .B ahost 6 | [\fIOPTION\fR]... \fIHOST\fR... 7 | .SH DESCRIPTION 8 | .PP 9 | .\" Add any additional description here 10 | .PP 11 | Look up the DNS A or AAAA record associated with HOST (a hostname or an 12 | IP address). 13 | .PP 14 | This utility comes with the \fBc\-ares\fR asynchronous resolver library. 15 | .SH OPTIONS 16 | .TP 17 | \fB\-d\fR 18 | Print some extra debugging output. 19 | .TP 20 | \fB\-h\fR, \fB\-\-help\fR 21 | Display this help and exit. 22 | .TP 23 | \fB\-t\fR type 24 | If type is "a", print the A record (default). 25 | If type is "aaaa", print the AAAA record. 26 | If type is "u", look for either AAAA or A record (in that order). 27 | .TP 28 | \fB\-s\fR \fIdomain\fP 29 | Specify the \fIdomain\fP to search instead of using the default values from 30 | .br 31 | /etc/resolv.conf. This option only has an effect on platforms that use 32 | .br 33 | /etc/resolv.conf 34 | for DNS configuration; it has no effect on other platforms (such as Win32 35 | or Android). 36 | .SH "REPORTING BUGS" 37 | Report bugs to the c-ares mailing list: 38 | \fBhttp://cool.haxx.se/mailman/listinfo/c-ares\fR 39 | .SH "SEE ALSO" 40 | .PP 41 | acountry(1), adig(1). 42 | .SH COPYRIGHT 43 | This utility is based on code/ideas contained in sofware written by Greg Hudson (ares) 44 | carrying the following notice: 45 | .br 46 | Copyright 1998 by the Massachusetts Institute of Technology. 47 | .br 48 | Permission to use, copy, modify, and distribute this software and its 49 | documentation for any purpose and without fee is hereby granted, 50 | provided that the above copyright notice appear in all copies and that 51 | both that copyright notice and this permission notice appear in 52 | supporting documentation, and that the name of M.I.T. not be used in 53 | advertising or publicity pertaining to distribution of the software 54 | without specific, written prior permission. M.I.T. makes no 55 | representations about the suitability of this software for any 56 | purpose. It is provided "as is" without express or implied warranty. 57 | .br 58 | No further copyright claims are being made by the author(s) of this utility. 59 | -------------------------------------------------------------------------------- /ares__close_sockets.c: -------------------------------------------------------------------------------- 1 | 2 | /* Copyright 1998 by the Massachusetts Institute of Technology. 3 | * 4 | * Permission to use, copy, modify, and distribute this 5 | * software and its documentation for any purpose and without 6 | * fee is hereby granted, provided that the above copyright 7 | * notice appear in all copies and that both that copyright 8 | * notice and this permission notice appear in supporting 9 | * documentation, and that the name of M.I.T. not be used in 10 | * advertising or publicity pertaining to distribution of the 11 | * software without specific, written prior permission. 12 | * M.I.T. makes no representations about the suitability of 13 | * this software for any purpose. It is provided "as is" 14 | * without express or implied warranty. 15 | */ 16 | 17 | #include "ares_setup.h" 18 | 19 | #include "ares.h" 20 | #include "ares_private.h" 21 | 22 | void ares__close_sockets(ares_channel channel, struct server_state *server) 23 | { 24 | struct send_request *sendreq; 25 | 26 | /* Free all pending output buffers. */ 27 | while (server->qhead) 28 | { 29 | /* Advance server->qhead; pull out query as we go. */ 30 | sendreq = server->qhead; 31 | server->qhead = sendreq->next; 32 | if (sendreq->data_storage != NULL) 33 | ares_free(sendreq->data_storage); 34 | ares_free(sendreq); 35 | } 36 | server->qtail = NULL; 37 | 38 | /* Reset any existing input buffer. */ 39 | if (server->tcp_buffer) 40 | ares_free(server->tcp_buffer); 41 | server->tcp_buffer = NULL; 42 | server->tcp_lenbuf_pos = 0; 43 | 44 | /* Reset brokenness */ 45 | server->is_broken = 0; 46 | 47 | /* Close the TCP and UDP sockets. */ 48 | if (server->tcp_socket != ARES_SOCKET_BAD) 49 | { 50 | SOCK_STATE_CALLBACK(channel, server->tcp_socket, 0, 0); 51 | ares__socket_close(channel, server->tcp_socket); 52 | server->tcp_socket = ARES_SOCKET_BAD; 53 | server->tcp_connection_generation = ++channel->tcp_connection_generation; 54 | } 55 | if (server->udp_socket != ARES_SOCKET_BAD) 56 | { 57 | SOCK_STATE_CALLBACK(channel, server->udp_socket, 0, 0); 58 | ares__socket_close(channel, server->udp_socket); 59 | server->udp_socket = ARES_SOCKET_BAD; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /ares_set_sortlist.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Permission to use, copy, modify, and distribute this 3 | .\" software and its documentation for any purpose and without 4 | .\" fee is hereby granted, provided that the above copyright 5 | .\" notice appear in all copies and that both that copyright 6 | .\" notice and this permission notice appear in supporting 7 | .\" documentation, and that the name of M.I.T. not be used in 8 | .\" advertising or publicity pertaining to distribution of the 9 | .\" software without specific, written prior permission. 10 | .\" M.I.T. makes no representations about the suitability of 11 | .\" this software for any purpose. It is provided "as is" 12 | .\" without express or implied warranty. 13 | .\" 14 | .TH ARES_SET_SORTLIST 3 "23 November 2015" 15 | .SH NAME 16 | ares_set_sortlist \- Initialize an ares_channel sortlist configuration 17 | .SH SYNOPSIS 18 | .nf 19 | .B #include 20 | .PP 21 | .B int ares_set_sortlist(ares_channel \fIchannel\fP, const char *\fIsortstr\fP) 22 | .fi 23 | .SH DESCRIPTION 24 | The \fBares_set_sortlist(3)\fP function initializes an address sortlist configuration 25 | for the channel data identified by 26 | .IR channel , 27 | so that addresses returned by \fBares_gethostbyname(3)\fP are sorted according to the 28 | sortlist. The provided 29 | .IR sortstr 30 | string that holds a space separated list of IP-address-netmask pairs. The 31 | netmask is optional but follows the address after a slash if present. For example, 32 | "130.155.160.0/255.255.240.0 130.155.0.0". 33 | 34 | This function replaces any potentially previously configured address sortlist 35 | with the ones given in the configuration string. 36 | 37 | .SH RETURN VALUES 38 | .B ares_set_sortlist(3) 39 | may return any of the following values: 40 | .TP 15 41 | .B ARES_SUCCESS 42 | The sortlist configuration was successfully initialized. 43 | .TP 15 44 | .B ARES_ENOMEM 45 | The process's available memory was exhausted. 46 | .TP 15 47 | .B ARES_ENODATA 48 | The channel data identified by 49 | .IR channel 50 | was invalid. 51 | .TP 15 52 | .B ARES_ENOTINITIALIZED 53 | c-ares library initialization not yet performed. 54 | .SH SEE ALSO 55 | .BR ares_init_options (3), 56 | .BR ares_dup(3) 57 | .SH AVAILABILITY 58 | ares_set_sortlist(3) was added in c-ares 1.11.0 59 | -------------------------------------------------------------------------------- /ares_getopt.h: -------------------------------------------------------------------------------- 1 | #ifndef ARES_GETOPT_H 2 | #define ARES_GETOPT_H 3 | 4 | /* 5 | * Copyright (c) 1987-2001 The Regents of the University of California. 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * A. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * B. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * C. Neither the names of the copyright holders nor the names of its 17 | * contributors may be used to endorse or promote products derived from this 18 | * software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS 21 | * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE 24 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 | * POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | 34 | int ares_getopt(int nargc, char * const nargv[], const char *ostr); 35 | 36 | #undef optarg 37 | #undef optind 38 | #undef opterr 39 | #undef optopt 40 | #undef optreset 41 | 42 | #define optarg ares_optarg 43 | #define optind ares_optind 44 | #define opterr ares_opterr 45 | #define optopt ares_optopt 46 | #define optreset ares_optreset 47 | 48 | extern char *optarg; 49 | extern int optind; 50 | extern int opterr; 51 | extern int optopt; 52 | 53 | #endif /* ARES_GETOPT_H */ 54 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/test/gtest-typed-test2_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Google Inc. 2 | // All Rights Reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include 33 | 34 | #include "test/gtest-typed-test_test.h" 35 | #include "gtest/gtest.h" 36 | 37 | #if GTEST_HAS_TYPED_TEST_P 38 | 39 | // Tests that the same type-parameterized test case can be 40 | // instantiated in different translation units linked together. 41 | // (ContainerTest is also instantiated in gtest-typed-test_test.cc.) 42 | INSTANTIATE_TYPED_TEST_CASE_P(Vector, ContainerTest, 43 | testing::Types >); 44 | 45 | #endif // GTEST_HAS_TYPED_TEST_P 46 | -------------------------------------------------------------------------------- /ares_expand_string.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright 1998 by the Massachusetts Institute of Technology. 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_EXPAND_NAME 3 "20 Nov 2009" 17 | .SH NAME 18 | ares_expand_string \- Expand a length encoded string 19 | .SH SYNOPSIS 20 | .nf 21 | .B #include 22 | .PP 23 | .B int ares_expand_string(const unsigned char *\fIencoded\fP, 24 | .B const unsigned char *\fIabuf\fP, int \fIalen\fP, unsigned char **\fIs\fP, 25 | .B long *\fIenclen\fP) 26 | .fi 27 | .SH DESCRIPTION 28 | The 29 | .B ares_expand_string 30 | function converts a length encoded string to a NUL-terminated C 31 | string. The argument 32 | .I encoded 33 | gives the beginning of the encoded string, and the arguments 34 | .I abuf 35 | and 36 | .I alen 37 | give the containing message buffer (necessary for the processing of 38 | indirection pointers within the encoded domain name). The result is 39 | placed in a NUL-terminated allocated buffer, a pointer to which is 40 | stored in the variable pointed to by 41 | .IR s . 42 | The length of the encoded string is stored in the variable pointed to by 43 | .I enclen 44 | so that the caller can advance past the encoded string to read 45 | further data in the message. 46 | .SH RETURN VALUES 47 | .B ares_expand_string 48 | can return any of the following values: 49 | .TP 15 50 | .B ARES_SUCCESS 51 | Expansion of the encoded string succeeded. 52 | .TP 15 53 | .B ARES_EBADSTR 54 | The encoded string was malformed and could not be expanded. 55 | .TP 15 56 | .B ARES_ENOMEM 57 | Memory was exhausted. 58 | .SH SEE ALSO 59 | .BR ares_free_string (3) 60 | .SH AUTHOR 61 | Dominick Meglio 62 | -------------------------------------------------------------------------------- /ares_ipv6.h: -------------------------------------------------------------------------------- 1 | 2 | /* Copyright (C) 2005 by Dominick Meglio 3 | * 4 | * Permission to use, copy, modify, and distribute this 5 | * software and its documentation for any purpose and without 6 | * fee is hereby granted, provided that the above copyright 7 | * notice appear in all copies and that both that copyright 8 | * notice and this permission notice appear in supporting 9 | * documentation, and that the name of M.I.T. not be used in 10 | * advertising or publicity pertaining to distribution of the 11 | * software without specific, written prior permission. 12 | * M.I.T. makes no representations about the suitability of 13 | * this software for any purpose. It is provided "as is" 14 | * without express or implied warranty. 15 | */ 16 | 17 | #ifndef ARES_IPV6_H 18 | #define ARES_IPV6_H 19 | 20 | #ifndef HAVE_PF_INET6 21 | #define PF_INET6 AF_INET6 22 | #endif 23 | 24 | #ifndef HAVE_STRUCT_SOCKADDR_IN6 25 | struct sockaddr_in6 26 | { 27 | unsigned short sin6_family; 28 | unsigned short sin6_port; 29 | unsigned long sin6_flowinfo; 30 | struct ares_in6_addr sin6_addr; 31 | unsigned int sin6_scope_id; 32 | }; 33 | #endif 34 | 35 | #ifndef HAVE_STRUCT_ADDRINFO 36 | struct addrinfo 37 | { 38 | int ai_flags; 39 | int ai_family; 40 | int ai_socktype; 41 | int ai_protocol; 42 | ares_socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */ 43 | char *ai_canonname; 44 | struct sockaddr *ai_addr; 45 | struct addrinfo *ai_next; 46 | }; 47 | #endif 48 | 49 | #ifndef NS_IN6ADDRSZ 50 | #ifndef HAVE_STRUCT_IN6_ADDR 51 | /* We cannot have it set to zero, so we pick a fixed value here */ 52 | #define NS_IN6ADDRSZ 16 53 | #else 54 | #define NS_IN6ADDRSZ sizeof(struct in6_addr) 55 | #endif 56 | #endif 57 | 58 | #ifndef NS_INADDRSZ 59 | #define NS_INADDRSZ sizeof(struct in_addr) 60 | #endif 61 | 62 | #ifndef NS_INT16SZ 63 | #define NS_INT16SZ 2 64 | #endif 65 | 66 | #ifndef IF_NAMESIZE 67 | #ifdef IFNAMSIZ 68 | #define IF_NAMESIZE IFNAMSIZ 69 | #else 70 | #define IF_NAMESIZE 256 71 | #endif 72 | #endif 73 | 74 | /* Defined in inet_net_pton.c for no particular reason. */ 75 | extern const struct ares_in6_addr ares_in6addr_any; /* :: */ 76 | 77 | 78 | #endif /* ARES_IPV6_H */ 79 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/scripts/generator/cpp/keywords.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2007 Neal Norwitz 4 | # Portions Copyright 2007 Google Inc. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | """C++ keywords and helper utilities for determining keywords.""" 19 | 20 | __author__ = 'nnorwitz@google.com (Neal Norwitz)' 21 | 22 | 23 | try: 24 | # Python 3.x 25 | import builtins 26 | except ImportError: 27 | # Python 2.x 28 | import __builtin__ as builtins 29 | 30 | 31 | if not hasattr(builtins, 'set'): 32 | # Nominal support for Python 2.3. 33 | from sets import Set as set 34 | 35 | 36 | TYPES = set('bool char int long short double float void wchar_t unsigned signed'.split()) 37 | TYPE_MODIFIERS = set('auto register const inline extern static virtual volatile mutable'.split()) 38 | ACCESS = set('public protected private friend'.split()) 39 | 40 | CASTS = set('static_cast const_cast dynamic_cast reinterpret_cast'.split()) 41 | 42 | OTHERS = set('true false asm class namespace using explicit this operator sizeof'.split()) 43 | OTHER_TYPES = set('new delete typedef struct union enum typeid typename template'.split()) 44 | 45 | CONTROL = set('case switch default if else return goto'.split()) 46 | EXCEPTION = set('try catch throw'.split()) 47 | LOOP = set('while do for break continue'.split()) 48 | 49 | ALL = TYPES | TYPE_MODIFIERS | ACCESS | CASTS | OTHERS | OTHER_TYPES | CONTROL | EXCEPTION | LOOP 50 | 51 | 52 | def IsKeyword(token): 53 | return token in ALL 54 | 55 | def IsBuiltinType(token): 56 | if token in ('virtual', 'inline'): 57 | # These only apply to methods, they can't be types by themselves. 58 | return False 59 | return token in TYPES or token in TYPE_MODIFIERS 60 | -------------------------------------------------------------------------------- /ares_parse_ns_reply.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright 1998 by the Massachusetts Institute of Technology. 3 | .\" 4 | .\" Permission to use, copy, modify, and distribute this 5 | .\" software and its documentation for any purpose and without 6 | .\" fee is hereby granted, provided that the above copyright 7 | .\" notice appear in all copies and that both that copyright 8 | .\" notice and this permission notice appear in supporting 9 | .\" documentation, and that the name of M.I.T. not be used in 10 | .\" advertising or publicity pertaining to distribution of the 11 | .\" software without specific, written prior permission. 12 | .\" M.I.T. makes no representations about the suitability of 13 | .\" this software for any purpose. It is provided "as is" 14 | .\" without express or implied warranty. 15 | .\" 16 | .TH ARES_PARSE_NS_REPLY 3 "10 February 2007" 17 | .SH NAME 18 | ares_parse_ns_reply \- Parse a reply to a DNS query of type NS into a hostent 19 | .SH SYNOPSIS 20 | .nf 21 | .B #include 22 | .PP 23 | .B int ares_parse_ns_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP, 24 | .B struct hostent **\fIhost\fP); 25 | .fi 26 | .SH DESCRIPTION 27 | The 28 | .B ares_parse_ns_reply 29 | function parses the response to a query of type NS into a 30 | .BR "struct hostent" . 31 | The parameters 32 | .I abuf 33 | and 34 | .I alen 35 | give the contents of the response. The result is stored in allocated 36 | memory and a pointer to it stored into the variable pointed to by 37 | .IR host . 38 | The nameservers are stored into the 39 | .BR aliases 40 | field of the 41 | .IR host 42 | structure. 43 | It is the caller's responsibility to free the resulting host structure 44 | using 45 | .BR ares_free_hostent (3) 46 | when it is no longer needed. 47 | .SH RETURN VALUES 48 | .B ares_parse_ns_reply 49 | can return any of the following values: 50 | .TP 15 51 | .B ARES_SUCCESS 52 | The response was successfully parsed. 53 | .TP 15 54 | .B ARES_EBADRESP 55 | The response was malformatted. 56 | .TP 15 57 | .B ARES_ENODATA 58 | The response did not contain an answer to the query. 59 | .TP 15 60 | .B ARES_ENOMEM 61 | Memory was exhausted. 62 | .SH SEE ALSO 63 | .BR ares_query (3), 64 | .BR ares_free_hostent (3) 65 | .SH AUTHOR 66 | Written by Vlad Dinulescu , on behalf of AVIRA Gmbh http://www.avira.com 67 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/codegear/gtest.groupproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {c1d923e0-6cba-4332-9b6f-3420acbf5091} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Default.Personality 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/samples/sample4.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #ifndef GTEST_SAMPLES_SAMPLE4_H_ 35 | #define GTEST_SAMPLES_SAMPLE4_H_ 36 | 37 | // A simple monotonic counter. 38 | class Counter { 39 | private: 40 | int counter_; 41 | 42 | public: 43 | // Creates a counter that starts at 0. 44 | Counter() : counter_(0) {} 45 | 46 | // Returns the current counter value, and increments it. 47 | int Increment(); 48 | 49 | // Prints the current counter value to STDOUT. 50 | void Print() const; 51 | }; 52 | 53 | #endif // GTEST_SAMPLES_SAMPLE4_H_ 54 | -------------------------------------------------------------------------------- /m4/cares-override.m4: -------------------------------------------------------------------------------- 1 | #*************************************************************************** 2 | #*************************************************************************** 3 | 4 | # File version for 'aclocal' use. Keep it a single number. 5 | # serial 8 6 | 7 | dnl CARES_OVERRIDE_AUTOCONF 8 | dnl ------------------------------------------------- 9 | dnl Placing a call to this macro in configure.ac after 10 | dnl the one to AC_INIT will make macros in this file 11 | dnl visible to the rest of the compilation overriding 12 | dnl those from Autoconf. 13 | 14 | AC_DEFUN([CARES_OVERRIDE_AUTOCONF], [ 15 | AC_BEFORE([$0],[AC_PROG_LIBTOOL]) 16 | # using cares-override.m4 17 | ]) 18 | 19 | dnl Override Autoconf's AC_LANG_PROGRAM (C) 20 | dnl ------------------------------------------------- 21 | dnl This is done to prevent compiler warning 22 | dnl 'function declaration isn't a prototype' 23 | dnl in function main. This requires at least 24 | dnl a c89 compiler and does not suport K&R. 25 | 26 | m4_define([AC_LANG_PROGRAM(C)], 27 | [$1 28 | int main (void) 29 | { 30 | $2 31 | ; 32 | return 0; 33 | }]) 34 | 35 | dnl Override Autoconf's AC_LANG_CALL (C) 36 | dnl ------------------------------------------------- 37 | dnl This is a backport of Autoconf's 2.60 with the 38 | dnl embedded comments that hit the resulting script 39 | dnl removed. This is done to reduce configure size 40 | dnl and use fixed macro across Autoconf versions. 41 | 42 | m4_define([AC_LANG_CALL(C)], 43 | [AC_LANG_PROGRAM([$1 44 | m4_if([$2], [main], , 45 | [ 46 | #ifdef __cplusplus 47 | extern "C" 48 | #endif 49 | char $2 ();])], [return $2 ();])]) 50 | 51 | dnl Override Autoconf's AC_LANG_FUNC_LINK_TRY (C) 52 | dnl ------------------------------------------------- 53 | dnl This is a backport of Autoconf's 2.60 with the 54 | dnl embedded comments that hit the resulting script 55 | dnl removed. This is done to reduce configure size 56 | dnl and use fixed macro across Autoconf versions. 57 | 58 | m4_define([AC_LANG_FUNC_LINK_TRY(C)], 59 | [AC_LANG_PROGRAM( 60 | [ 61 | #define $1 innocuous_$1 62 | #ifdef __STDC__ 63 | # include 64 | #else 65 | # include 66 | #endif 67 | #undef $1 68 | #ifdef __cplusplus 69 | extern "C" 70 | #endif 71 | char $1 (); 72 | #if defined __stub_$1 || defined __stub___$1 73 | choke me 74 | #endif 75 | ], [return $1 ();])]) 76 | 77 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/test/gtest_help_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | // This program is meant to be run by gtest_help_test.py. Do not run 33 | // it directly. 34 | 35 | #include "gtest/gtest.h" 36 | 37 | // When a help flag is specified, this program should skip the tests 38 | // and exit with 0; otherwise the following test will be executed, 39 | // causing this program to exit with a non-zero code. 40 | TEST(HelpFlagTest, ShouldNotBeRun) { 41 | ASSERT_TRUE(false) << "Tests shouldn't be run when --help is specified."; 42 | } 43 | 44 | #if GTEST_HAS_DEATH_TEST 45 | TEST(DeathTest, UsedByPythonScriptToDetectSupportForDeathTestsInThisBinary) {} 46 | #endif 47 | -------------------------------------------------------------------------------- /m4/ax_check_uts_namespace.m4: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | 3 | # SYNOPSIS 4 | # 5 | # AX_CHECK_UTS_NAMESPACE 6 | # 7 | # DESCRIPTION 8 | # 9 | # This macro checks whether the local system supports Linux UTS namespaces. 10 | # Also requires user namespaces to be available, so that non-root users 11 | # can enter the namespace. 12 | # If so, it calls AC_DEFINE(HAVE_UTS_NAMESPACE). 13 | 14 | AC_DEFUN([AX_CHECK_UTS_NAMESPACE],[dnl 15 | AC_CACHE_CHECK([whether UTS namespaces are supported], 16 | ax_cv_uts_namespace,[ 17 | AC_LANG_PUSH([C]) 18 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ 19 | #define _GNU_SOURCE 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | int utsfn(void *d) { 30 | char buffer[1024]; 31 | const char *name = "autoconftest"; 32 | int rc = sethostname(name, strlen(name)); 33 | if (rc != 0) return 1; 34 | gethostname(buffer, 1024); 35 | return (strcmp(buffer, name) != 0); 36 | } 37 | 38 | char st2[1024*1024]; 39 | int fn(void *d) { 40 | pid_t child; 41 | int rc, status; 42 | usleep(100000); /* synchronize by sleep */ 43 | if (getuid() != 0) return 1; 44 | child = clone(utsfn, st2 + 1024*1024, CLONE_NEWUTS|SIGCHLD, 0); 45 | if (child < 0) return 1; 46 | rc = waitpid(child, &status, 0); 47 | if (rc <= 0) return 1; 48 | if (!WIFEXITED(status)) return 1; 49 | return WEXITSTATUS(status); 50 | } 51 | char st[1024*1024]; 52 | int main() { 53 | char buffer[1024]; 54 | int rc, status, fd; 55 | pid_t child = clone(fn, st + 1024*1024, CLONE_NEWUSER|SIGCHLD, 0); 56 | if (child < 0) return 1; 57 | 58 | sprintf(buffer, "/proc/%d/uid_map", child); 59 | fd = open(buffer, O_CREAT|O_WRONLY|O_TRUNC, 0755); 60 | sprintf(buffer, "0 %d 1\n", getuid()); 61 | write(fd, buffer, strlen(buffer)); 62 | close(fd); 63 | 64 | rc = waitpid(child, &status, 0); 65 | if (rc <= 0) return 1; 66 | if (!WIFEXITED(status)) return 1; 67 | return WEXITSTATUS(status); 68 | } 69 | ]]) 70 | ],[ax_cv_uts_namespace=yes],[ax_cv_uts_namespace=no],[ax_cv_uts_namespace=no]) 71 | AC_LANG_POP([C]) 72 | ]) 73 | if test "$ax_cv_uts_namespace" = yes; then 74 | AC_DEFINE([HAVE_UTS_NAMESPACE],[1],[Whether UTS namespaces are available]) 75 | fi 76 | ]) # AX_CHECK_UTS_NAMESPACE 77 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/src/gmock-all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // Google C++ Mocking Framework (Google Mock) 33 | // 34 | // This file #includes all Google Mock implementation .cc files. The 35 | // purpose is to allow a user to build Google Mock by compiling this 36 | // file alone. 37 | 38 | // This line ensures that gmock.h can be compiled on its own, even 39 | // when it's fused. 40 | #include "gmock/gmock.h" 41 | 42 | // The following lines pull in the real gmock *.cc files. 43 | #include "src/gmock-cardinalities.cc" 44 | #include "src/gmock-internal-utils.cc" 45 | #include "src/gmock-matchers.cc" 46 | #include "src/gmock-spec-builders.cc" 47 | #include "src/gmock.cc" 48 | -------------------------------------------------------------------------------- /test/gmock-1.7.0/gtest/src/gtest-all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: mheule@google.com (Markus Heule) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // Sometimes it's desirable to build Google Test by compiling a single file. 35 | // This file serves this purpose. 36 | 37 | // This line ensures that gtest.h can be compiled on its own, even 38 | // when it's fused. 39 | #include "gtest/gtest.h" 40 | 41 | // The following lines pull in the real gtest *.cc files. 42 | #include "src/gtest.cc" 43 | #include "src/gtest-death-test.cc" 44 | #include "src/gtest-filepath.cc" 45 | #include "src/gtest-port.cc" 46 | #include "src/gtest-printers.cc" 47 | #include "src/gtest-test-part.cc" 48 | #include "src/gtest-typed-test.cc" 49 | --------------------------------------------------------------------------------