├── debian ├── copyright ├── compat ├── source │ └── format ├── rules ├── changelog └── control ├── deps ├── ae │ ├── .dirstamp │ ├── .deps │ │ ├── .dirstamp │ │ └── libae.Plo │ ├── zmalloc.h │ ├── Makefile │ └── config.h ├── inih │ ├── .dirstamp │ ├── .deps │ │ ├── .dirstamp │ │ ├── inih.Plo │ │ ├── libinih.Plo │ │ └── ini.Plo │ ├── README.txt │ ├── Makefile │ ├── LICENSE.txt │ └── inih.h ├── murmurhash │ ├── .dirstamp │ ├── .deps │ │ ├── .dirstamp │ │ ├── libmurmur.Plo │ │ ├── murmur.Plo │ │ └── MurmurHash3.Plo │ ├── Makefile │ └── MurmurHash3.h └── check-0.10.0 │ ├── doc │ ├── example │ │ ├── src │ │ │ ├── money.1.c │ │ │ ├── money.1.h │ │ │ ├── Makefile.am │ │ │ ├── money.2.h │ │ │ ├── money.h │ │ │ ├── main.c │ │ │ ├── money.3.c │ │ │ ├── money.4.c │ │ │ ├── CMakeLists.txt │ │ │ ├── money.5.c │ │ │ ├── money.c │ │ │ └── money.6.c │ │ ├── tests │ │ │ ├── check_money.1.c │ │ │ ├── Makefile.am │ │ │ ├── check_money.2.c │ │ │ ├── CMakeLists.txt │ │ │ ├── check_money.3.c │ │ │ ├── check_money.6.c │ │ │ ├── check_money.7.c │ │ │ └── check_money.c │ │ ├── Makefile.am │ │ ├── cmake │ │ │ ├── config.h.in │ │ │ ├── COPYING-CMAKE-SCRIPTS.txt │ │ │ └── FindCheck.cmake │ │ ├── configure.ac │ │ ├── README │ │ └── CMakeLists.txt │ ├── stamp-vti │ └── version.texi │ ├── checkmk │ ├── test │ │ ├── empty_input │ │ │ ├── in │ │ │ ├── x_output │ │ │ └── x_err │ │ ├── name_enc │ │ │ ├── cmd │ │ │ └── x_output │ │ ├── single_test_line │ │ │ ├── in │ │ │ └── x_output │ │ ├── pass_thru │ │ │ ├── x_err │ │ │ ├── in │ │ │ └── x_output │ │ ├── repeated_tests │ │ │ ├── x_err │ │ │ ├── in │ │ │ └── x_output │ │ ├── no_args │ │ │ ├── cmd │ │ │ ├── in │ │ │ └── x_output │ │ ├── repeated_argument_tests │ │ │ ├── x_err │ │ │ ├── in │ │ │ └── x_output │ │ ├── repeated_suites │ │ │ ├── x_err │ │ │ ├── in │ │ │ └── x_output │ │ ├── repeated_tcases │ │ │ ├── x_err │ │ │ ├── in │ │ │ └── x_output │ │ ├── main_post_multiple │ │ │ ├── x_err │ │ │ ├── in │ │ │ └── x_output │ │ ├── main_pre_after_post │ │ │ ├── x_err │ │ │ ├── in │ │ │ └── x_output │ │ ├── main_pre_multiple │ │ │ ├── x_err │ │ │ ├── in │ │ │ └── x_output │ │ ├── tcase_implied_repeat │ │ │ ├── x_err │ │ │ ├── in │ │ │ └── x_output │ │ ├── clean_mode │ │ │ ├── cmd │ │ │ ├── in │ │ │ └── x_output │ │ ├── test_chars │ │ │ ├── x_err │ │ │ ├── in │ │ │ └── x_output │ │ ├── test_after_main_post │ │ │ ├── x_err │ │ │ ├── in │ │ │ └── x_output │ │ ├── test_after_main_pre │ │ │ ├── x_err │ │ │ ├── in │ │ │ └── x_output │ │ ├── num_start_test_name │ │ │ ├── x_err │ │ │ ├── in │ │ │ └── x_output │ │ ├── invalid_ucn │ │ │ ├── x_err │ │ │ ├── x_output │ │ │ └── in │ │ ├── between_the_lines │ │ │ ├── in │ │ │ └── x_output │ │ ├── basic_complete │ │ │ ├── in │ │ │ └── x_output │ │ ├── ucn │ │ │ ├── in │ │ │ └── x_output │ │ ├── case_insensitive_pp │ │ │ ├── in │ │ │ └── x_output │ │ ├── non_word_chars │ │ │ ├── in │ │ │ └── x_output │ │ ├── trailing_ws │ │ │ ├── in │ │ │ └── x_output │ │ ├── declarations │ │ │ ├── in │ │ │ └── x_output │ │ ├── main_post │ │ │ ├── in │ │ │ └── x_output │ │ ├── not_really_repeated │ │ │ ├── in │ │ │ └── x_output │ │ ├── multiple_everything │ │ │ ├── in │ │ │ └── x_output │ │ └── argument_ws │ │ │ └── in │ ├── Makefile.am │ ├── examples │ │ ├── basic_complete.ts │ │ └── multiple_everything.ts │ └── README │ ├── lib │ ├── strdup.c │ ├── alarm.c │ ├── strsignal.c │ ├── Makefile.am │ ├── libcompat.c │ ├── localtime_r.c │ ├── timer_create.c │ ├── malloc.c │ ├── realloc.c │ ├── gettimeofday.c │ ├── timer_delete.c │ ├── getline.c │ ├── timer_settime.c │ ├── clock_gettime.c │ └── CMakeLists.txt │ ├── cmake │ ├── check_stdint.h.in │ ├── .svn │ │ ├── text-base │ │ │ ├── check_stdint.h.in.svn-base │ │ │ ├── CheckHeaderDirent.cmake.svn-base │ │ │ ├── CheckTypeExists.cmake.svn-base │ │ │ └── CheckStructMember.cmake.svn-base │ │ ├── all-wcprops │ │ └── entries │ ├── CheckHeaderDirent.cmake │ ├── CheckTypeExists.cmake │ └── CheckStructMember.cmake │ ├── check.pc.in │ ├── THANKS │ ├── tests │ ├── test_vars.in │ ├── test_check_nofork_teardown.sh │ ├── test_check_nofork.sh │ ├── check_check_export_main.c │ ├── test_tap_output.sh │ ├── test_log_output.sh │ ├── test_mem_leaks.sh │ ├── check_check_limit.c │ ├── check_check_main.c │ ├── test_xml_output.sh │ ├── check_check_exit.c │ ├── check_stress.c │ ├── check_nofork.c │ ├── check_check_log_internal.c │ ├── check_nofork_teardown.c │ ├── check_check.h │ ├── check_thread_stress.c │ ├── check_mem_leaks.c │ └── CMakeLists.txt │ ├── m4 │ └── ltversion.m4 │ ├── src │ ├── check_print.h │ ├── check_error.h │ ├── check_msg.h │ ├── check_str.h │ ├── check_list.h │ ├── CMakeLists.txt │ ├── Makefile.am │ ├── check_pack.h │ ├── check_log.h │ └── check_error.c │ ├── xml │ └── check_unittest.xslt │ └── README ├── integ └── __init__.py ├── sinks ├── __init__.py ├── binary_sink.py ├── cloudwatch.sh └── opentsdb.js ├── Vagrantfile ├── man ├── Makefile.am └── statsite.8 ├── rpm ├── statsite.tmpfiles.conf ├── statsite.service ├── statsite.conf.example └── statsite.initscript ├── autogen.sh ├── src ├── hll_constants.h ├── streaming.h ├── conn_handler.h ├── set.h ├── hll.h ├── counter.h ├── radix.h ├── hashmap.h ├── streaming.c ├── timer.h └── cm_quantile.h ├── bootstrap.sh ├── .travis.yml ├── bench.py ├── m4 └── ltversion.m4 ├── Vagrantfile.centos ├── Vagrantfile.debian ├── .gitignore ├── LICENSE ├── bench_bin.py ├── tests ├── test_set.c └── test_counter.c └── configure.ac /debian/copyright: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/ae/.dirstamp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /integ/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sinks/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /deps/ae/.deps/.dirstamp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/inih/.dirstamp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/inih/.deps/.dirstamp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/murmurhash/.dirstamp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrantfile.debian -------------------------------------------------------------------------------- /deps/murmurhash/.deps/.dirstamp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /deps/ae/.deps/libae.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/inih/.deps/inih.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/src/money.1.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/inih/.deps/libinih.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /man/Makefile.am: -------------------------------------------------------------------------------- 1 | man_MANS = statsite.8 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/empty_input/in: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/murmurhash/.deps/libmurmur.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/murmurhash/.deps/murmur.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | %: 3 | dh $@ 4 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/empty_input/x_output: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/murmurhash/.deps/MurmurHash3.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/name_enc/cmd: -------------------------------------------------------------------------------- 1 | infname='\aa"' 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/single_test_line/in: -------------------------------------------------------------------------------- 1 | # test test_name 2 | -------------------------------------------------------------------------------- /rpm/statsite.tmpfiles.conf: -------------------------------------------------------------------------------- 1 | d /var/run/statsite 0700 statsite statsite - -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | autoreconf -fiv 4 | rm -Rf autom4te.cache 5 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/pass_thru/x_err: -------------------------------------------------------------------------------- 1 | checkmk: Expected at least one #test line. 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/empty_input/x_err: -------------------------------------------------------------------------------- 1 | checkmk: Expected at least one #test line. 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/tests/check_money.1.c: -------------------------------------------------------------------------------- 1 | int main(void) 2 | { 3 | return 0; 4 | } 5 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/repeated_tests/x_err: -------------------------------------------------------------------------------- 1 | checkmk: in line 14: Test "repeat" already exists. 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/no_args/cmd: -------------------------------------------------------------------------------- 1 | checkmk_cmd='"$CHECKMK" < "$infname" > "$outfname" 2>"$errfname"' 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/repeated_argument_tests/x_err: -------------------------------------------------------------------------------- 1 | checkmk: in line 9: Test "test2" already exists. 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/repeated_suites/x_err: -------------------------------------------------------------------------------- 1 | checkmk: in line 10: Suite "Halibut" already exists. 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/repeated_tcases/x_err: -------------------------------------------------------------------------------- 1 | checkmk: in line 12: Test Case "Chopin" already exists. 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/src/money.1.h: -------------------------------------------------------------------------------- 1 | #ifndef MONEY_H 2 | #define MONEY_H 3 | 4 | #endif /* MONEY_H */ 5 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/main_post_multiple/x_err: -------------------------------------------------------------------------------- 1 | checkmk: in line 21: main-post specified multiple times. 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/main_pre_after_post/x_err: -------------------------------------------------------------------------------- 1 | checkmk: in line 21: main-pre specified after main-post. 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/main_pre_multiple/x_err: -------------------------------------------------------------------------------- 1 | checkmk: in line 21: main-pre specified multiple times. 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/tcase_implied_repeat/x_err: -------------------------------------------------------------------------------- 1 | checkmk: in line 16: Test Case "Luck" already exists. 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/clean_mode/cmd: -------------------------------------------------------------------------------- 1 | checkmk_cmd='"$CHECKMK" clean_mode=1 "$infname" > "$outfname" 2>"$errfname"' 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/test_chars/x_err: -------------------------------------------------------------------------------- 1 | checkmk: in line 7: Malformed test name "test@me" (must be a C identifier). 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/test_after_main_post/x_err: -------------------------------------------------------------------------------- 1 | checkmk: in line 21: Cannot specify tests after main-pre or main-post. 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/test_after_main_pre/x_err: -------------------------------------------------------------------------------- 1 | checkmk: in line 21: Cannot specify tests after main-pre or main-post. 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | SUBDIRS = src . tests -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/num_start_test_name/x_err: -------------------------------------------------------------------------------- 1 | checkmk: in line 5: Malformed test name "1nsane" (must be a C identifier). 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/invalid_ucn/x_err: -------------------------------------------------------------------------------- 1 | checkmk: in line 9: Malformed test name "the_\u4ECA\u65E5\u306_test" (must be a C identifier). 2 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/stamp-vti: -------------------------------------------------------------------------------- 1 | @set UPDATED 2 August 2015 2 | @set UPDATED-MONTH August 2015 3 | @set EDITION 0.10.0 4 | @set VERSION 0.10.0 5 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/version.texi: -------------------------------------------------------------------------------- 1 | @set UPDATED 2 August 2015 2 | @set UPDATED-MONTH August 2015 3 | @set EDITION 0.10.0 4 | @set VERSION 0.10.0 5 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/strdup.c: -------------------------------------------------------------------------------- 1 | #include "libcompat.h" 2 | 3 | char *strdup(const char *str CK_ATTRIBUTE_UNUSED) 4 | { 5 | assert(0); 6 | return NULL; 7 | } 8 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/alarm.c: -------------------------------------------------------------------------------- 1 | #include "libcompat.h" 2 | 3 | unsigned int alarm(unsigned int seconds CK_ATTRIBUTE_UNUSED) 4 | { 5 | assert(0); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | statsite (0.7.1-1) UNRELEASED; urgency=low 2 | 3 | * Initial release. (Closes: #182) 4 | 5 | -- John Keates Sat, 07 May 2016 17:06:59 +0200 6 | -------------------------------------------------------------------------------- /deps/check-0.10.0/cmake/check_stdint.h.in: -------------------------------------------------------------------------------- 1 | #ifndef _CHECK_CHECK_STDINT_H 2 | #define _CHECK_CHECK_STDINT_H 1 3 | #ifdef HAVE_STDINT_H 4 | #include 5 | #endif 6 | #endif 7 | -------------------------------------------------------------------------------- /src/hll_constants.h: -------------------------------------------------------------------------------- 1 | #ifndef HLL_CONSTANT_H 2 | #define HLL_CONSTANT_H 3 | 4 | extern double switchThreshold[15]; 5 | extern double *rawEstimateData[]; 6 | extern double *biasData[]; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /deps/check-0.10.0/cmake/.svn/text-base/check_stdint.h.in.svn-base: -------------------------------------------------------------------------------- 1 | #ifndef _CHECK_CHECK_STDINT_H 2 | #define _CHECK_CHECK_STDINT_H 1 3 | #ifdef HAVE_STDINT_H 4 | #include 5 | #endif 6 | #endif 7 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/between_the_lines/in: -------------------------------------------------------------------------------- 1 | int foo; 2 | 3 | #suite A 4 | 5 | int bar; 6 | 7 | #tcase B 8 | 9 | int baz; 10 | 11 | #test C 12 | fail_unless(foo | bar | baz == 0); 13 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/test_chars/in: -------------------------------------------------------------------------------- 1 | /* tests shouldn't allow non-identifier characters. */ 2 | 3 | # suite The Suite 4 | 5 | # tcase The Test Case 6 | 7 | # test test@me 8 | fail_if(GOT_HERE); 9 | -------------------------------------------------------------------------------- /deps/ae/zmalloc.h: -------------------------------------------------------------------------------- 1 | #ifndef zmalloc 2 | #define zmalloc malloc 3 | #endif 4 | 5 | #ifndef zrealloc 6 | #define zrealloc realloc 7 | #endif 8 | 9 | #ifndef zfree 10 | #define zfree free 11 | #endif 12 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/num_start_test_name/in: -------------------------------------------------------------------------------- 1 | /* Ensure that test names starting with digits are refused. */ 2 | 3 | # suite The Suite 4 | # tcase The Test Case 5 | # test 1nsane 6 | fail_if(SANE); 7 | -------------------------------------------------------------------------------- /deps/inih/README.txt: -------------------------------------------------------------------------------- 1 | 2 | inih is a simple .INI file parser written in C, released under the New BSD 3 | license (see LICENSE.txt). Go to the project home page for more info: 4 | 5 | http://code.google.com/p/inih/ 6 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/repeated_suites/in: -------------------------------------------------------------------------------- 1 | /* Don't let suite names repeat. */ 2 | 3 | # suite Halibut 4 | 5 | # tcase Salmon 6 | 7 | # test ella 8 | fail_if(food_poisoned); 9 | 10 | # suite Halibut 11 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/strsignal.c: -------------------------------------------------------------------------------- 1 | #include "libcompat.h" 2 | 3 | const char *strsignal(int sig) 4 | { 5 | static char signame[40]; 6 | 7 | sprintf(signame, "SIG #%d", sig); 8 | return signame; 9 | } 10 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/pass_thru/in: -------------------------------------------------------------------------------- 1 | /* 2 | * While a line such as 3 | * 4 | #define MY_VALUE 1 5 | * 6 | * will be passed; a line such as 7 | * 8 | #suite "Sweet" 9 | * 10 | * will not be. 11 | */ 12 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/repeated_tcases/in: -------------------------------------------------------------------------------- 1 | /* Don't let test case names repeat. */ 2 | 3 | # suite Mozart 4 | 5 | # tcase Chopin 6 | 7 | # test sticks 8 | fail_if(DEAD_COMPOSERS); 9 | 10 | # suite Rachmaninoff 11 | 12 | # tcase Chopin 13 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/src/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | lib_LTLIBRARIES = libmoney.la 4 | libmoney_la_SOURCES = money.c money.h 5 | 6 | bin_PROGRAMS = main 7 | main_SOURCES = main.c 8 | main_LDADD = libmoney.la 9 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | noinst_LTLIBRARIES = libcompat.la 4 | libcompat_la_LDFLAGS = -no-undefined 5 | libcompat_la_SOURCES = libcompat.c libcompat.h 6 | libcompat_la_LIBADD = $(LTLIBOBJS) $(LTALLOCA) 7 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/test_chars/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* tests shouldn't allow non-identifier characters. */ 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/invalid_ucn/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* A complete test example */ 10 | 11 | #include 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/num_start_test_name/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* Ensure that test names starting with digits are refused. */ 10 | 11 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/repeated_tests/in: -------------------------------------------------------------------------------- 1 | /* Can't use the same test name multiple times. */ 2 | 3 | # suite Foo 4 | 5 | # tcase Bar 6 | 7 | # test repeat 8 | fail_if(MISERABLY); 9 | 10 | # suite Baz 11 | 12 | # tcase Quux 13 | 14 | # test repeat 15 | fail_if(DONT_TRY_TRY_AGAIN); 16 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/src/money.2.h: -------------------------------------------------------------------------------- 1 | #ifndef MONEY_H 2 | #define MONEY_H 3 | 4 | typedef struct Money Money; 5 | 6 | Money *money_create(int amount, char *currency); 7 | int money_amount(Money * m); 8 | char *money_currency(Money * m); 9 | void money_free(Money * m); 10 | 11 | #endif /* MONEY_H */ 12 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/src/money.h: -------------------------------------------------------------------------------- 1 | #ifndef MONEY_H 2 | #define MONEY_H 3 | 4 | typedef struct Money Money; 5 | 6 | Money *money_create(int amount, char *currency); 7 | int money_amount(Money * m); 8 | char *money_currency(Money * m); 9 | void money_free(Money * m); 10 | 11 | #endif /* MONEY_H */ 12 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/repeated_argument_tests/in: -------------------------------------------------------------------------------- 1 | /* Fail when tests with identical name are detected */ 2 | 3 | #test-loop(1,4) test1 4 | ck_assert(1 == 1); 5 | #test-signal(-1) test2 6 | ck_assert(1 == 1); 7 | #suite secondary 8 | #tcase second 9 | #test-loop-exit(1, 1, 5) test2 10 | ck_assert(1 == 1); 11 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/src/main.c: -------------------------------------------------------------------------------- 1 | #include "money.h" 2 | 3 | /* only main should be in this file, to make all other functions in 4 | the prograble testable by Check. in order to test main(), use a 5 | whole program testing framework like Autotest. 6 | */ 7 | 8 | int main(void) 9 | { 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | TESTS = check_money 4 | check_PROGRAMS = check_money 5 | check_money_SOURCES = check_money.c $(top_builddir)/src/money.h 6 | check_money_CFLAGS = @CHECK_CFLAGS@ 7 | check_money_LDADD = $(top_builddir)/src/libmoney.la @CHECK_LIBS@ 8 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/Makefile.am: -------------------------------------------------------------------------------- 1 | if INSTALL_CHECKMK 2 | bin_SCRIPTS = checkmk 3 | TESTS = test/check_checkmk 4 | endif 5 | EXTRA_DIST = test examples doc/checkmk.1 6 | CONFIG_STATUS_DEPENDENCIES = checkmk.in 7 | 8 | man_MANS = doc/checkmk.1 9 | 10 | clean-local: 11 | rm -rf test.out 12 | 13 | dist-hook: 14 | rm -rf `find $(distdir)/ -name '.svn'` 15 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/repeated_suites/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* Don't let suite names repeat. */ 10 | 11 | 12 | 13 | START_TEST(ella) 14 | { 15 | #line 8 16 | fail_if(food_poisoned); 17 | 18 | -------------------------------------------------------------------------------- /rpm/statsite.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=statsite stats aggregator 3 | 4 | [Service] 5 | Type=forking 6 | User=statsite 7 | Group=statsite 8 | RuntimeDirectory=/var/run/statsite 9 | PIDFile=/var/run/statsite/statsite.pid 10 | ExecStart=/usr/sbin/statsite -f /etc/statsite/statsite.conf 11 | Restart=on-failure 12 | 13 | [Install] 14 | WantedBy=multi-user.target 15 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: statsite 2 | Maintainer: John Keates 3 | Section: misc 4 | Priority: optional 5 | Standards-Version: 3.9.2 6 | Build-Depends: debhelper (>= 9) 7 | 8 | Package: statsite 9 | Architecture: any 10 | Depends: ${shlibs:Depends}, ${misc:Depends} 11 | Description: C implementation of statsd 12 | Statsite collects stats and sends them to an upstream server. 13 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/pass_thru/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* 10 | * While a line such as 11 | * 12 | #define MY_VALUE 1 13 | * 14 | * will be passed; a line such as 15 | * 16 | #line 9 17 | * 18 | * will not be. 19 | */ 20 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/repeated_tcases/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* Don't let test case names repeat. */ 10 | 11 | 12 | 13 | START_TEST(sticks) 14 | { 15 | #line 8 16 | fail_if(DEAD_COMPOSERS); 17 | 18 | } 19 | END_TEST 20 | 21 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/src/money.3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "money.h" 3 | 4 | Money *money_create(int amount, char *currency) 5 | { 6 | return NULL; 7 | } 8 | 9 | int money_amount(Money * m) 10 | { 11 | return 0; 12 | } 13 | 14 | char *money_currency(Money * m) 15 | { 16 | return NULL; 17 | } 18 | 19 | void money_free(Money * m) 20 | { 21 | return; 22 | } 23 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/libcompat.c: -------------------------------------------------------------------------------- 1 | #include "libcompat.h" 2 | 3 | /* silence warnings about an empty library */ 4 | void ck_do_nothing(void) 5 | { 6 | assert(0); 7 | 8 | /* 9 | * to silence warning about this function actually 10 | * returning, but being marked as noreturn. assert() 11 | * must be marked as a function that returns. 12 | */ 13 | exit(1); 14 | } 15 | -------------------------------------------------------------------------------- /deps/inih/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES=\ 2 | ./inih.c \ 3 | 4 | CFLAGS = -O3 5 | LDFLAGS = 6 | CC = /usr/bin/gcc 7 | 8 | OBJECTS=$(SOURCES:%.c=%.o) 9 | 10 | all: libinih.a 11 | 12 | libinih.a: $(OBJECTS) 13 | $(AR) rcs $@ $(OBJECTS) 14 | 15 | .PHONY: clean 16 | clean: 17 | $(RM) *.o *.a 18 | 19 | check: all 20 | test: all 21 | dist: 22 | distdir: 23 | distclean: clean 24 | install: 25 | uninstall: 26 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/repeated_tests/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* Can't use the same test name multiple times. */ 10 | 11 | 12 | 13 | START_TEST(repeat) 14 | { 15 | #line 8 16 | fail_if(MISERABLY); 17 | 18 | } 19 | END_TEST 20 | 21 | 22 | -------------------------------------------------------------------------------- /man/statsite.8: -------------------------------------------------------------------------------- 1 | .Dd 6 May 2016 2 | .Dt STATSITE 8 3 | .Os LINUX 4 | .Sh NAME 5 | .Nm statsite 6 | .Nd a C implemementation of Etsy statsd 7 | .\" 8 | .Sh SYNOPSIS 9 | .Nm 10 | collects data and sends it to a central server for processing. 11 | .Pp 12 | .Nm 13 | statsite runs in the background as a daemon, and allows for use of various sinks to send collected data to the central storage server. 14 | .\" 15 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/tests/check_money.2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../src/money.h" 3 | 4 | START_TEST(test_money_create) 5 | { 6 | Money *m; 7 | 8 | m = money_create(5, "USD"); 9 | ck_assert_int_eq(money_amount(m), 5); 10 | ck_assert_str_eq(money_currency(m), "USD"); 11 | money_free(m); 12 | } 13 | END_TEST 14 | 15 | int main(void) 16 | { 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /deps/ae/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES=\ 2 | ./ae.c \ 3 | 4 | CFLAGS = -g -std=c99 -Wpointer-arith 5 | LDFLAGS = 6 | CC = /usr/bin/gcc 7 | 8 | OBJECTS=$(SOURCES:%.c=%.o) 9 | 10 | all: libae.a 11 | 12 | libae.a: $(OBJECTS) 13 | $(AR) rcs $@ $(OBJECTS) 14 | 15 | .PHONY: clean 16 | clean: 17 | $(RM) *.o *.a 18 | 19 | check: all 20 | test: all 21 | dist: 22 | distdir: 23 | distclean: clean 24 | install: 25 | uninstall: 26 | -------------------------------------------------------------------------------- /deps/check-0.10.0/check.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: Check 7 | Description: A unit test framework for C 8 | URL: http://check.sourceforge.net 9 | Version: @VERSION@ 10 | Requires.private: @LIBSUBUNIT_PC@ 11 | Libs: -L${libdir} -lcheck 12 | Libs.private: @GCOV_LIBS@ @PTHREAD_LIBS@ @LIBS@ 13 | Cflags: -I${includedir} @PTHREAD_CFLAGS@ 14 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/clean_mode/in: -------------------------------------------------------------------------------- 1 | /* A complete test example */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | -------------------------------------------------------------------------------- /deps/check-0.10.0/THANKS: -------------------------------------------------------------------------------- 1 | Design suggestions: 2 | Fred Drake (checked fixture functions) 3 | Jim O'Leary (forkless mode) 4 | 5 | Downstream maintainers: 6 | Robert Lemmen (Debian) 7 | Tom 'spot' Callaway (Fedora Extras) 8 | 9 | If you helped out with Check in some way and would like to be listed 10 | here, send a patch to . 11 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/basic_complete/in: -------------------------------------------------------------------------------- 1 | /* A complete test example */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/examples/basic_complete.ts: -------------------------------------------------------------------------------- 1 | /* A complete test example */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | -------------------------------------------------------------------------------- /deps/murmurhash/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES=\ 2 | ./MurmurHash3.c \ 3 | 4 | CFLAGS = -std=c99 -O3 5 | LDFLAGS = 6 | CC = /usr/bin/gcc 7 | 8 | OBJECTS=$(SOURCES:%.c=%.o) 9 | 10 | all: libmurmur.a 11 | 12 | libmurmur.a: $(OBJECTS) 13 | $(AR) rcs $@ $(OBJECTS) 14 | 15 | .PHONY: clean 16 | clean: 17 | $(RM) *.o *.a 18 | 19 | check: all 20 | test: all 21 | dist: 22 | distdir: 23 | distclean: clean 24 | install: 25 | uninstall: 26 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/ucn/in: -------------------------------------------------------------------------------- 1 | /* A complete test example */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_\u4ECA\u65E5\u306F_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/case_insensitive_pp/in: -------------------------------------------------------------------------------- 1 | /* Test case-insensitive directives. */ 2 | 3 | #include 4 | 5 | # SuiTe The Suite 6 | 7 | # tCaSe The Test Case 8 | 9 | # teSt the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/invalid_ucn/in: -------------------------------------------------------------------------------- 1 | /* A complete test example */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_\u4ECA\u65E5\u306_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/localtime_r.c: -------------------------------------------------------------------------------- 1 | #include "libcompat.h" 2 | 3 | #if !defined(localtime_r) 4 | 5 | struct tm *localtime_r(const time_t * clock, struct tm *result) 6 | { 7 | struct tm *now = localtime(clock); 8 | 9 | if(now == NULL) 10 | { 11 | return NULL; 12 | } 13 | else 14 | { 15 | *result = *now; 16 | } 17 | 18 | return result; 19 | } 20 | 21 | #endif /* !defined(localtime_r) */ 22 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/non_word_chars/in: -------------------------------------------------------------------------------- 1 | /* Non-word characters */ 2 | 3 | #include 4 | 5 | # suite The Suite (of Test Cases/\TCases) 6 | 7 | # tcase The "Test Case" 8 | 9 | # test the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | -------------------------------------------------------------------------------- /rpm/statsite.conf.example: -------------------------------------------------------------------------------- 1 | [statsite] 2 | port=8125 3 | udp_port=8125 4 | log_level=INFO 5 | flush_interval=10 6 | timer_eps=0.01 7 | set_eps=0.02 8 | stream_cmd=python /usr/libexec/statsite/sinks/graphite.py localhost 2003 9 | daemonize=1 10 | pid_file=/var/run/statsite/statsite.pid 11 | 12 | [histogram_api] 13 | prefix=api 14 | min=0 15 | max=100 16 | width=5 17 | 18 | [histogram_default] 19 | prefix= 20 | min=0 21 | max=200 22 | width=20 23 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/trailing_ws/in: -------------------------------------------------------------------------------- 1 | /* A complete test example (with trailing whitespace) */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/src/money.4.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "money.h" 3 | 4 | struct Money 5 | { 6 | int amount; 7 | }; 8 | 9 | Money *money_create(int amount, char *currency) 10 | { 11 | return NULL; 12 | } 13 | 14 | int money_amount(Money * m) 15 | { 16 | return m->amount; 17 | } 18 | 19 | char *money_currency(Money * m) 20 | { 21 | return NULL; 22 | } 23 | 24 | void money_free(Money * m) 25 | { 26 | return; 27 | } 28 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/timer_create.c: -------------------------------------------------------------------------------- 1 | #include "libcompat.h" 2 | 3 | int timer_create(clockid_t clockid CK_ATTRIBUTE_UNUSED, 4 | struct sigevent *sevp CK_ATTRIBUTE_UNUSED, 5 | timer_t * timerid CK_ATTRIBUTE_UNUSED) 6 | { 7 | /* 8 | * The create function does nothing. timer_settime will use 9 | * alarm to set the timer, and timer_delete will stop the 10 | * alarm 11 | */ 12 | 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/declarations/in: -------------------------------------------------------------------------------- 1 | /* A complete test example */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | 18 | # main-pre 19 | int declare_me = 0; 20 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/repeated_argument_tests/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* Fail when tests with identical name are detected */ 10 | 11 | START_TEST(test1) 12 | { 13 | #line 4 14 | ck_assert(1 == 1); 15 | } 16 | END_TEST 17 | 18 | START_TEST(test2) 19 | { 20 | #line 6 21 | ck_assert(1 == 1); 22 | } 23 | END_TEST 24 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/main_post/in: -------------------------------------------------------------------------------- 1 | /* A complete test example */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | 18 | # main-post 19 | return 0; /* Always report success. */ 20 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/no_args/in: -------------------------------------------------------------------------------- 1 | /* A complete test example */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | 18 | #main-pre 19 | int fooyah; 20 | 21 | #main-post 22 | return nf; 23 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/test_vars.in: -------------------------------------------------------------------------------- 1 | # defined to 1 if subunit is enabled 2 | ENABLE_SUBUNIT=@ENABLE_SUBUNIT@ 3 | export ENABLE_SUBUNIT 4 | EXEEXT=@EXEEXT@ 5 | export EXEEXT 6 | HAVE_FORK=@HAVE_FORK@ 7 | export HAVE_FORK 8 | 9 | # path of the tests directory 10 | if [ x"@srcdir@" != x"." ]; then 11 | if [ -z "@IS_MSVC@" -o "@IS_MSVC@" != "1" ]; then 12 | SRCDIR="@srcdir@/" 13 | else 14 | SRCDIR="@srcdir@\\" 15 | fi 16 | else 17 | SRCDIR="" 18 | fi 19 | 20 | export SRCDIR 21 | -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -x 4 | 5 | # Create directories in case they are missing 6 | mkdir -p m4 ac_config 7 | 8 | 9 | aclocal -I ac_config 10 | 11 | # Execute libtoolize if we have it 12 | command -v libtoolize >/dev/null 2>&1 && libtoolize --force --copy 13 | 14 | # Execute glibtoolize as that's what OSX has, usually 15 | command -v glibtoolize >/dev/null 2>&1 && glibtoolize --force --copy 16 | 17 | #autoheader # We dont need this (yet?) 18 | 19 | automake --add-missing --copy 20 | autoconf 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "2.7" 4 | before_install: 5 | - sudo apt-get -qq update 6 | - sudo apt-get -y install pkg-config autoconf automake libtool texinfo sed 7 | - pushd deps/check-0.10.0 8 | - mkdir -p m4 9 | - autoreconf -fiv 10 | - ./configure 11 | - make 12 | - sudo make install 13 | - sudo ldconfig 14 | - popd 15 | - mkdir -p m4 16 | - autoreconf -fiv 17 | install: pip install pytest==2.9.2 18 | script: ./autogen.sh && ./configure && make && make check && py.test integ/ 19 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/test_after_main_pre/in: -------------------------------------------------------------------------------- 1 | /* A complete test example */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | 18 | # main-pre 19 | int declare_me = 0; 20 | 21 | # test uh_oh 22 | fail("Phooey"); 23 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/main_pre_multiple/in: -------------------------------------------------------------------------------- 1 | /* A complete test example */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | 18 | # main-pre 19 | int declare_me = 0; 20 | 21 | # main-pre 22 | int oh_wait_declare_me_too; 23 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/tcase_implied_repeat/in: -------------------------------------------------------------------------------- 1 | /* Make sure we catch implied tcase repeats (via same name as suite) */ 2 | 3 | # suite Lady 4 | 5 | # tcase Luck 6 | 7 | # test song 8 | fail_unless("be a lady tonight"); 9 | 10 | # suite Luck 11 | 12 | /* It's fine for a suite and tcase name to collide... 13 | but the suite name implies a tcase name of the same value until we 14 | override it. */ 15 | 16 | # test uh_oh 17 | /* Uh-oh! Now we're using the implied tcase Luck, which already 18 | * exists! */ 19 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/not_really_repeated/in: -------------------------------------------------------------------------------- 1 | /* Test that repeated suites/tcases are only disallowed when they've 2 | * actually been used in defining a test. */ 3 | 4 | # suite Foo 5 | 6 | # tcase Bar 7 | 8 | /* But no test... */ 9 | 10 | # suite Baz 11 | 12 | # tcase Quux 13 | 14 | # test quuux 15 | const char msg[] = "Howdy doody!\n"; 16 | int nc = printf(msg); 17 | 18 | fail_unless(nc == sizeof msg - 1); 19 | 20 | # suite Foo 21 | 22 | # tcase Bar 23 | 24 | # test huh 25 | fail_unless(ALLOWED_AFTER_ALL); 26 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/test_after_main_post/in: -------------------------------------------------------------------------------- 1 | /* A complete test example */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | 18 | # main-post 19 | return 0; /* Always report success. */ 20 | 21 | # test uh_oh 22 | fail("Phooey"); 23 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/malloc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * AC_FUNC_MALLOC in configure defines malloc to rpl_malloc if 3 | * malloc (0) is NULL to provide GNU compatibility 4 | */ 5 | 6 | #include "libcompat.h" 7 | 8 | /* malloc has been defined to rpl_malloc, so first undo that */ 9 | #undef malloc 10 | 11 | /* this gives us the real malloc to use below */ 12 | void *malloc(size_t n); 13 | 14 | /* force malloc(0) to return a valid pointer */ 15 | void *rpl_malloc(size_t n) 16 | { 17 | if(n == 0) 18 | n = 1; 19 | return malloc(n); 20 | } 21 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/main_pre_after_post/in: -------------------------------------------------------------------------------- 1 | /* A complete test example */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | 18 | # main-post 19 | return 0; /* Always report success. */ 20 | 21 | # main-pre 22 | int declare_me = 0; 23 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(LIB_SOURCES 2 | money.c 3 | ) 4 | 5 | set(MAIN_SOURCES 6 | main.c 7 | ) 8 | 9 | set(HEADERS 10 | ${CONFIG_HEADER} 11 | money.h 12 | ) 13 | 14 | add_library(money STATIC ${LIB_SOURCES} ${HEADERS}) 15 | 16 | add_executable(main ${HEADERS} ${MAIN_SOURCES}) 17 | target_link_libraries(main money) 18 | 19 | install(TARGETS money 20 | RUNTIME DESTINATION bin 21 | LIBRARY DESTINATION lib 22 | ARCHIVE DESTINATION lib) 23 | 24 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/money.h DESTINATION include) 25 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/test_check_nofork_teardown.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | . ./test_vars 4 | 5 | expected="Running suite(s): bug-99 6 | 0%: Checks: 1, Failures: 1, Errors: 0 7 | ${SRCDIR}check_nofork_teardown.c:36:F:tc:will_fail:0: Assertion '0' failed" 8 | 9 | actual=`./check_nofork_teardown${EXEEXT} | tr -d "\r"` 10 | if [ x"${expected}" = x"${actual}" ]; then 11 | exit 0 12 | else 13 | echo "Problem with check_nofork_teardown${EXEEXT}" 14 | echo "Expected: " 15 | echo "${expected}" 16 | echo "Got: " 17 | echo "${actual}" 18 | exit 1 19 | fi 20 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/main_post_multiple/in: -------------------------------------------------------------------------------- 1 | /* A complete test example */ 2 | 3 | #include 4 | 5 | # suite The Suite 6 | 7 | # tcase The Test Case 8 | 9 | # test the_test 10 | int nc; 11 | const char msg[] = "\n\n Hello, world!\n"; 12 | 13 | nc = printf("%s", msg); 14 | fail_unless(nc == (sizeof msg 15 | - 1) /* for terminating NUL. */ 16 | ); 17 | 18 | # main-post 19 | return 0; /* Always report success. */ 20 | 21 | # main-post 22 | return 0; /* We really want success, so we'll specify it twice! */ 23 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/tcase_implied_repeat/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* Make sure we catch implied tcase repeats (via same name as suite) */ 10 | 11 | 12 | 13 | START_TEST(song) 14 | { 15 | #line 8 16 | fail_unless("be a lady tonight"); 17 | 18 | } 19 | END_TEST 20 | 21 | #line 12 22 | /* It's fine for a suite and tcase name to collide... 23 | but the suite name implies a tcase name of the same value until we 24 | override it. */ 25 | 26 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/README: -------------------------------------------------------------------------------- 1 | ======= 2 | checkmk 3 | ======= 4 | 5 | Written by Micah J Cowan. 6 | 7 | Translates concise versions of test suites into C programs 8 | suitable suitable for use with the Check unit test framework. 9 | 10 | See the source code in checkmk.in (checkmk when installed) for terms of 11 | distribution (scaled-down version of the modified BSD license). 12 | 13 | To see how it works, try running checkmk on the example files, 14 | basic_complete.ts and multiple_everything.ts: 15 | checkmk basic_complete.ts > basic_complete.c 16 | cc -o basic basic_complete.c -lcheck 17 | ./basic 18 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src) 2 | 3 | # If pkg-config is not installed on the system, then the 4 | # CHECK_INSTALL_DIR variable must be set to the install 5 | # location of Check. For example, on Windows, this may 6 | # be: C:/Program Files/check 7 | # set(CHECK_INSTALL_DIR "C:/Program Files/check") 8 | 9 | find_package(Check REQUIRED) 10 | include_directories(${CHECK_INCLUDE_DIRS}) 11 | 12 | set(TEST_SOURCES 13 | check_money.c 14 | ) 15 | 16 | add_executable(check_money ${TEST_SOURCES}) 17 | target_link_libraries(check_money money ${CHECK_LIBRARIES}) 18 | -------------------------------------------------------------------------------- /deps/ae/config.h: -------------------------------------------------------------------------------- 1 | #ifndef __CONFIG_H 2 | #define __CONFIG_H 3 | 4 | #ifdef __APPLE__ 5 | #include 6 | #endif 7 | 8 | #ifdef __linux__ 9 | #include 10 | #include 11 | #endif 12 | 13 | /* Test for polling API */ 14 | #ifdef __linux__ 15 | #define HAVE_EPOLL 1 16 | #endif 17 | 18 | #if (defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6)) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined (__NetBSD__) 19 | #define HAVE_KQUEUE 1 20 | #endif 21 | 22 | #ifdef __sun 23 | #include 24 | #ifdef _DTRACE_VERSION 25 | #define HAVE_EVPORT 1 26 | #endif 27 | #endif 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/test_check_nofork.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | . ./test_vars 4 | 5 | if [ $HAVE_FORK -eq 1 ]; then 6 | expected="Running suite(s): NoFork 7 | 0%: Checks: 1, Failures: 1, Errors: 0" 8 | else 9 | expected="Running suite(s): NoFork 10 | 0%: Checks: 1, Failures: 1, Errors: 0 11 | Running suite(s): NoForkSupport 12 | 100%: Checks: 1, Failures: 0, Errors: 0" 13 | fi 14 | 15 | actual=`./check_nofork${EXEEXT} | tr -d "\r"` 16 | if [ x"${expected}" = x"${actual}" ]; then 17 | exit 0 18 | else 19 | echo "Problem with check_nofork${EXEEXT}" 20 | echo "Expected: " 21 | echo "${expected}" 22 | echo "Got: " 23 | echo "${actual}" 24 | exit 1 25 | fi 26 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/realloc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * AC_FUNC_REALLOC in configure defines realloc to rpl_realloc if 3 | * realloc (p, 0) or realloc (0, n) is NULL to provide GNU 4 | * compatibility 5 | */ 6 | 7 | #include "libcompat.h" 8 | 9 | /* realloc has been defined to rpl_realloc, so first undo that */ 10 | #undef realloc 11 | 12 | /* this gives us the real realloc to use below */ 13 | void *realloc(void *p, size_t n); 14 | 15 | /* force realloc(p, 0) and realloc (NULL, n) to return a valid pointer */ 16 | void *rpl_realloc(void *p, size_t n) 17 | { 18 | if(n == 0) 19 | n = 1; 20 | if(p == 0) 21 | return malloc(n); 22 | return realloc(p, n); 23 | } 24 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/src/money.5.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "money.h" 3 | 4 | struct Money 5 | { 6 | int amount; 7 | char *currency; 8 | }; 9 | 10 | Money *money_create(int amount, char *currency) 11 | { 12 | Money *m = malloc(sizeof(Money)); 13 | 14 | if (m == NULL) 15 | { 16 | return NULL; 17 | } 18 | 19 | m->amount = amount; 20 | m->currency = currency; 21 | return m; 22 | } 23 | 24 | int money_amount(Money * m) 25 | { 26 | return m->amount; 27 | } 28 | 29 | char *money_currency(Money * m) 30 | { 31 | return m->currency; 32 | } 33 | 34 | void money_free(Money * m) 35 | { 36 | free(m); 37 | return; 38 | } 39 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/single_test_line/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | START_TEST(test_name) 10 | { 11 | #line 2 12 | } 13 | END_TEST 14 | 15 | int main(void) 16 | { 17 | Suite *s1 = suite_create("Core"); 18 | TCase *tc1_1 = tcase_create("Core"); 19 | SRunner *sr = srunner_create(s1); 20 | int nf; 21 | 22 | suite_add_tcase(s1, tc1_1); 23 | tcase_add_test(tc1_1, test_name); 24 | 25 | srunner_run_all(sr, CK_ENV); 26 | nf = srunner_ntests_failed(sr); 27 | srunner_free(sr); 28 | 29 | return nf == 0 ? 0 : 1; 30 | } 31 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/check_check_export_main.c: -------------------------------------------------------------------------------- 1 | #include "../lib/libcompat.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include "check_check.h" 7 | 8 | int main (void) 9 | { 10 | int n; 11 | SRunner *sr; 12 | 13 | fork_setup(); 14 | setup(); 15 | sr = srunner_create (make_master_suite()); 16 | srunner_add_suite(sr, make_log_suite()); 17 | srunner_add_suite(sr, make_fork_suite()); 18 | 19 | printf ("Ran %d tests in subordinate suite\n", sub_ntests); 20 | srunner_run_all (sr, CK_VERBOSE); 21 | cleanup(); 22 | fork_teardown(); 23 | n = srunner_ntests_failed(sr); 24 | srunner_free(sr); 25 | return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 26 | } 27 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /*-*- mode:C; -*- */ 2 | /* config.h. Generated from build/cmake/config.h.in by cmake configure */ 3 | 4 | /* 5 | * Ensure we have C99-style int64_t, etc, all defined. 6 | */ 7 | 8 | /* First, we need to know if the system has already defined them. */ 9 | #cmakedefine HAVE_INTMAX_T 10 | #cmakedefine HAVE_UINTMAX_T 11 | 12 | /* Define to `int' if doesn't define. */ 13 | #cmakedefine pid_t ${pid_t} 14 | 15 | /* Define intmax_t and uintmax_t if they are not already defined. */ 16 | #if !defined(HAVE_INTMAX_T) 17 | typedef int64_t intmax_t; 18 | #define INTMAX_MIN INT64_MIN 19 | #define INTMAX_MAX INT64_MAX 20 | #endif 21 | 22 | #if !defined(HAVE_UINTMAX_T) 23 | typedef uint64_t uintmax_t; 24 | #endif 25 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/src/money.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "money.h" 3 | 4 | struct Money 5 | { 6 | int amount; 7 | char *currency; 8 | }; 9 | 10 | Money *money_create(int amount, char *currency) 11 | { 12 | Money *m; 13 | 14 | if (amount < 0) 15 | { 16 | return NULL; 17 | } 18 | 19 | m = malloc(sizeof(Money)); 20 | 21 | if (m == NULL) 22 | { 23 | return NULL; 24 | } 25 | 26 | m->amount = amount; 27 | m->currency = currency; 28 | return m; 29 | } 30 | 31 | int money_amount(Money * m) 32 | { 33 | return m->amount; 34 | } 35 | 36 | char *money_currency(Money * m) 37 | { 38 | return m->currency; 39 | } 40 | 41 | void money_free(Money * m) 42 | { 43 | free(m); 44 | return; 45 | } 46 | -------------------------------------------------------------------------------- /bench.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import time 3 | import random 4 | 5 | NUM = 1024 * 1024 6 | KEYS = ["test", "foobar", "zipzap"] 7 | VALS = [32, 100, 82, 101, 5, 6, 42, 73] 8 | 9 | METS = [] 10 | for x in xrange(NUM): 11 | key = random.choice(KEYS) 12 | val = random.choice(VALS) 13 | METS.append("%s:%f|c\n" % (key, val)) 14 | 15 | s = socket.socket() 16 | s.connect(("localhost", 8125)) 17 | start = time.time() 18 | 19 | total = 0 20 | while True: 21 | current = 0 22 | while current < len(METS): 23 | msg = "".join(METS[current:current + 1024]) 24 | current += 1024 25 | total += 1024 26 | s.sendall(msg) 27 | 28 | diff = time.time() - start 29 | ops_s = total / diff 30 | print "%0.2f sec\t - %.0f ops/sec" % (diff, ops_s) 31 | 32 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/src/money.6.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "money.h" 3 | 4 | struct Money 5 | { 6 | int amount; 7 | char *currency; 8 | }; 9 | 10 | Money *money_create(int amount, char *currency) 11 | { 12 | Money *m; 13 | 14 | if (amount < 0) 15 | { 16 | return NULL; 17 | } 18 | 19 | m = malloc(sizeof(Money)); 20 | 21 | if (m == NULL) 22 | { 23 | return NULL; 24 | } 25 | 26 | m->amount = amount; 27 | m->currency = currency; 28 | return m; 29 | } 30 | 31 | int money_amount(Money * m) 32 | { 33 | return m->amount; 34 | } 35 | 36 | char *money_currency(Money * m) 37 | { 38 | return m->currency; 39 | } 40 | 41 | void money_free(Money * m) 42 | { 43 | free(m); 44 | return; 45 | } 46 | -------------------------------------------------------------------------------- /deps/murmurhash/MurmurHash3.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // MurmurHash3 was written by Austin Appleby, and is placed in the public 3 | // domain. The author hereby disclaims copyright to this source code. 4 | 5 | #ifndef _MURMURHASH3_H_ 6 | #define _MURMURHASH3_H_ 7 | 8 | //----------------------------------------------------------------------------- 9 | // Platform-specific functions and macros 10 | #include 11 | 12 | //----------------------------------------------------------------------------- 13 | 14 | void MurmurHash3_x64_128(const void *key, int len, uint32_t seed, void *out); 15 | 16 | //----------------------------------------------------------------------------- 17 | 18 | #endif // _MURMURHASH3_H_ 19 | -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 3337 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.2]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3337]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.2' 20 | macro_revision='1.3337' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/test_tap_output.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | OUTPUT_FILE=test.tap 4 | 5 | . ./test_vars 6 | . $(dirname $0)/test_output_strings 7 | 8 | test_tap_output ( ) { 9 | rm -f ${OUTPUT_FILE} 10 | ./ex_output${EXEEXT} "CK_SILENT" "TAP" "${1}" > /dev/null 11 | actual_tap=`cat ${OUTPUT_FILE} | tr -d "\r"` 12 | expected_tap="${2}" 13 | if [ x"${expected_tap}" != x"${actual_tap}" ]; then 14 | echo "Problem with ex_tap_output${EXEEXT}"; 15 | echo "Expected:"; 16 | echo "${expected_tap}"; 17 | echo 18 | echo "Got:"; 19 | echo "${actual_tap}"; 20 | exit 1; 21 | fi 22 | } 23 | 24 | test_tap_output "NORMAL" "${expected_normal_tap}" 25 | test_tap_output "EXIT_TEST" "${expected_aborted_tap}" 26 | 27 | exit 0 28 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/test_log_output.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | OUTPUT_FILE=test.log 4 | 5 | . ./test_vars 6 | . $(dirname $0)/test_output_strings 7 | 8 | test_log_output ( ) { 9 | rm -f ${OUTPUT_FILE} 10 | ./ex_output${EXEEXT} "${1}" "LOG" "NORMAL" > /dev/null 11 | actual=`cat ${OUTPUT_FILE} | tr -d "\r"` 12 | if [ x"${2}" != x"${actual}" ]; then 13 | echo "Problem with ex_log_output${EXEEXT} ${1} LOG NORMAL"; 14 | echo "Expected:"; 15 | echo "${expected}"; 16 | echo "Got:"; 17 | echo "${actual}"; 18 | exit 1; 19 | fi 20 | 21 | } 22 | 23 | test_log_output "CK_SILENT" "${expected_log_log}" 24 | test_log_output "CK_MINIMAL" "${expected_log_log}" 25 | test_log_output "CK_NORMAL" "${expected_log_log}" 26 | test_log_output "CK_VERBOSE" "${expected_log_log}" 27 | exit 0 28 | -------------------------------------------------------------------------------- /deps/check-0.10.0/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 3337 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.2]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3337]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.2' 20 | macro_revision='1.3337' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/between_the_lines/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | int foo; 10 | 11 | 12 | #line 5 13 | int bar; 14 | 15 | 16 | #line 9 17 | int baz; 18 | 19 | START_TEST(C) 20 | { 21 | #line 12 22 | fail_unless(foo | bar | baz == 0); 23 | } 24 | END_TEST 25 | 26 | int main(void) 27 | { 28 | Suite *s1 = suite_create("A"); 29 | TCase *tc1_1 = tcase_create("B"); 30 | SRunner *sr = srunner_create(s1); 31 | int nf; 32 | 33 | suite_add_tcase(s1, tc1_1); 34 | tcase_add_test(tc1_1, C); 35 | 36 | srunner_run_all(sr, CK_ENV); 37 | nf = srunner_ntests_failed(sr); 38 | srunner_free(sr); 39 | 40 | return nf == 0 ? 0 : 1; 41 | } 42 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/gettimeofday.c: -------------------------------------------------------------------------------- 1 | #include "libcompat.h" 2 | #include 3 | 4 | #if defined(_MSC_VER) || defined(__BORLANDC__) 5 | #define EPOCHFILETIME (116444736000000000i64) 6 | #else 7 | #define EPOCHFILETIME (116444736000000000LL) 8 | #endif 9 | 10 | int gettimeofday(struct timeval *tv, void *tz) 11 | { 12 | #if _MSC_VER 13 | union 14 | { 15 | __int64 ns100; /*time since 1 Jan 1601 in 100ns units */ 16 | FILETIME ft; 17 | } now; 18 | 19 | GetSystemTimeAsFileTime(&now.ft); 20 | tv->tv_usec = (long)((now.ns100 / 10LL) % 1000000LL); 21 | tv->tv_sec = (long)((now.ns100 - EPOCHFILETIME) / 10000000LL); 22 | return (0); 23 | #else 24 | // Return that there is no implementation of this on the system 25 | errno = ENOSYS; 26 | return -1; 27 | #endif /* _MSC_VER */ 28 | } 29 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/main_pre_multiple/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* A complete test example */ 10 | 11 | #include 12 | 13 | 14 | 15 | START_TEST(the_test) 16 | { 17 | #line 10 18 | int nc; 19 | const char msg[] = "\n\n Hello, world!\n"; 20 | 21 | nc = printf("%s", msg); 22 | fail_unless(nc == (sizeof msg 23 | - 1) /* for terminating NUL. */ 24 | ); 25 | 26 | } 27 | END_TEST 28 | 29 | int main(void) 30 | { 31 | Suite *s1 = suite_create("The Suite"); 32 | TCase *tc1_1 = tcase_create("The Test Case"); 33 | SRunner *sr = srunner_create(s1); 34 | int nf; 35 | 36 | /* User-specified pre-run code */ 37 | #line 19 38 | int declare_me = 0; 39 | 40 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/test_after_main_pre/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* A complete test example */ 10 | 11 | #include 12 | 13 | 14 | 15 | START_TEST(the_test) 16 | { 17 | #line 10 18 | int nc; 19 | const char msg[] = "\n\n Hello, world!\n"; 20 | 21 | nc = printf("%s", msg); 22 | fail_unless(nc == (sizeof msg 23 | - 1) /* for terminating NUL. */ 24 | ); 25 | 26 | } 27 | END_TEST 28 | 29 | int main(void) 30 | { 31 | Suite *s1 = suite_create("The Suite"); 32 | TCase *tc1_1 = tcase_create("The Test Case"); 33 | SRunner *sr = srunner_create(s1); 34 | int nf; 35 | 36 | /* User-specified pre-run code */ 37 | #line 19 38 | int declare_me = 0; 39 | 40 | -------------------------------------------------------------------------------- /src/streaming.h: -------------------------------------------------------------------------------- 1 | #ifndef STREAMING_H 2 | #define STREAMING_H 3 | #include 4 | #include "metrics.h" 5 | 6 | /** 7 | * This callback is used to stream data to the external command. 8 | * It is provided with all the metrics and a pipe. The command should 9 | * return 1 to terminate. See metric_callback for more info. 10 | */ 11 | typedef int(*stream_callback)(FILE *pipe, void *data, metric_type type, char *name, void *value); 12 | 13 | /** 14 | * Streams the metrics stored in a metrics object to an external command 15 | * @arg m The metrics object to stream 16 | * @arg data An opaque handle passed to the callback 17 | * @arg cb The callback to invoke 18 | * @arg cmd The command to invoke, invoked with a shell. 19 | * @return 0 on success, or the value of stream callback. 20 | */ 21 | int stream_to_command(metrics *m, void *data, stream_callback cb, char *cmd); 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/timer_delete.c: -------------------------------------------------------------------------------- 1 | #include "libcompat.h" 2 | 3 | int timer_delete(timer_t timerid CK_ATTRIBUTE_UNUSED) 4 | { 5 | #ifdef HAVE_SETITIMER 6 | /* 7 | * If the system does not have timer_settime() but does have 8 | * setitimer() use that instead of alarm(). 9 | */ 10 | struct itimerval interval; 11 | 12 | /* 13 | * Setting values to '0' results in disabling the running timer. 14 | */ 15 | interval.it_value.tv_sec = 0; 16 | interval.it_value.tv_usec = 0; 17 | interval.it_interval.tv_sec = 0; 18 | interval.it_interval.tv_usec = 0; 19 | 20 | return setitimer(ITIMER_REAL, &interval, NULL); 21 | #else 22 | /* 23 | * There is only one timer, that used by alarm. 24 | * Setting alarm(0) will not set a new alarm, and 25 | * will kill the previous timer. 26 | */ 27 | 28 | alarm(0); 29 | 30 | return 0; 31 | #endif 32 | } 33 | -------------------------------------------------------------------------------- /deps/check-0.10.0/cmake/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 51 4 | /p/check/code/!svn/ver/1219/tags/check-0.10.0/cmake 5 | END 6 | CheckHeaderDirent.cmake 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 75 10 | /p/check/code/!svn/ver/1219/tags/check-0.10.0/cmake/CheckHeaderDirent.cmake 11 | END 12 | check_stdint.h.in 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 69 16 | /p/check/code/!svn/ver/1219/tags/check-0.10.0/cmake/check_stdint.h.in 17 | END 18 | CheckTypeExists.cmake 19 | K 25 20 | svn:wc:ra_dav:version-url 21 | V 73 22 | /p/check/code/!svn/ver/1219/tags/check-0.10.0/cmake/CheckTypeExists.cmake 23 | END 24 | config.h.in 25 | K 25 26 | svn:wc:ra_dav:version-url 27 | V 63 28 | /p/check/code/!svn/ver/1219/tags/check-0.10.0/cmake/config.h.in 29 | END 30 | CheckStructMember.cmake 31 | K 25 32 | svn:wc:ra_dav:version-url 33 | V 75 34 | /p/check/code/!svn/ver/1219/tags/check-0.10.0/cmake/CheckStructMember.cmake 35 | END 36 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/test_mem_leaks.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | UNIT_TEST=./check_mem_leaks 4 | VALGRIND_LOG_FILE=${UNIT_TEST}.valgrind 5 | LEAK_MESSAGE="are definitely lost" 6 | 7 | # This test runs valgrind against the check_mem_leaks unit test 8 | # program, looking for memory leaks. If any are found, "exit 1" 9 | # is invoked, and one must look through the resulting valgrind log 10 | # file for details on the leak. 11 | 12 | rm -f ${VALGRIND_LOG_FILE} 13 | libtool --mode=execute valgrind --leak-check=full ${UNIT_TEST} 2>&1 | tee ${VALGRIND_LOG_FILE} 14 | 15 | NUM_LEAKS=$(grep "${LEAK_MESSAGE}" ${VALGRIND_LOG_FILE} | wc -l) 16 | 17 | if test ${NUM_LEAKS} -gt 0; then 18 | echo "ERROR: ${NUM_LEAKS} memory leaks were detected by valgrind." 19 | echo " Look through ${VALGRIND_LOG_FILE} for details," 20 | echo " searching for \"${LEAK_MESSAGE}\"." 21 | exit 1 22 | else 23 | echo "No memory leaks found" 24 | exit 0 25 | fi 26 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/getline.c: -------------------------------------------------------------------------------- 1 | #include "libcompat.h" 2 | #include 3 | 4 | #define INITIAL_SIZE 16 5 | #define DELIMITER '\n' 6 | 7 | ssize_t getline(char **lineptr, size_t *n, FILE *stream) 8 | { 9 | ssize_t written = 0; 10 | int character; 11 | 12 | if(*lineptr == NULL || *n < INITIAL_SIZE) 13 | { 14 | free(*lineptr); 15 | *lineptr = (char *)malloc(INITIAL_SIZE); 16 | *n = INITIAL_SIZE; 17 | } 18 | 19 | while( (character = fgetc(stream)) != EOF) 20 | { 21 | written += 1; 22 | if(written >= *n) 23 | { 24 | *n = *n * 2; 25 | *lineptr = realloc(*lineptr, *n); 26 | } 27 | 28 | (*lineptr)[written-1] = character; 29 | 30 | if(character == DELIMITER) 31 | { 32 | break; 33 | } 34 | } 35 | 36 | (*lineptr)[written] = '\0'; 37 | 38 | return written; 39 | } 40 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/clean_mode/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | /* A complete test example */ 9 | 10 | #include 11 | 12 | 13 | 14 | START_TEST(the_test) 15 | { 16 | int nc; 17 | const char msg[] = "\n\n Hello, world!\n"; 18 | 19 | nc = printf("%s", msg); 20 | fail_unless(nc == (sizeof msg 21 | - 1) /* for terminating NUL. */ 22 | ); 23 | } 24 | END_TEST 25 | 26 | int main(void) 27 | { 28 | Suite *s1 = suite_create("The Suite"); 29 | TCase *tc1_1 = tcase_create("The Test Case"); 30 | SRunner *sr = srunner_create(s1); 31 | int nf; 32 | 33 | suite_add_tcase(s1, tc1_1); 34 | tcase_add_test(tc1_1, the_test); 35 | 36 | srunner_run_all(sr, CK_ENV); 37 | nf = srunner_ntests_failed(sr); 38 | srunner_free(sr); 39 | 40 | return nf == 0 ? 0 : 1; 41 | } 42 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/basic_complete/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* A complete test example */ 10 | 11 | #include 12 | 13 | 14 | 15 | START_TEST(the_test) 16 | { 17 | #line 10 18 | int nc; 19 | const char msg[] = "\n\n Hello, world!\n"; 20 | 21 | nc = printf("%s", msg); 22 | fail_unless(nc == (sizeof msg 23 | - 1) /* for terminating NUL. */ 24 | ); 25 | } 26 | END_TEST 27 | 28 | int main(void) 29 | { 30 | Suite *s1 = suite_create("The Suite"); 31 | TCase *tc1_1 = tcase_create("The Test Case"); 32 | SRunner *sr = srunner_create(s1); 33 | int nf; 34 | 35 | suite_add_tcase(s1, tc1_1); 36 | tcase_add_test(tc1_1, the_test); 37 | 38 | srunner_run_all(sr, CK_ENV); 39 | nf = srunner_ntests_failed(sr); 40 | srunner_free(sr); 41 | 42 | return nf == 0 ? 0 : 1; 43 | } 44 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/name_enc/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "\aa"" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "\\aa\"" 9 | /* A complete test example */ 10 | 11 | #include 12 | 13 | 14 | 15 | START_TEST(the_test) 16 | { 17 | #line 10 18 | int nc; 19 | const char msg[] = "\n\n Hello, world!\n"; 20 | 21 | nc = printf("%s", msg); 22 | fail_unless(nc == (sizeof msg 23 | - 1) /* for terminating NUL. */ 24 | ); 25 | } 26 | END_TEST 27 | 28 | int main(void) 29 | { 30 | Suite *s1 = suite_create("The Suite"); 31 | TCase *tc1_1 = tcase_create("The Test Case"); 32 | SRunner *sr = srunner_create(s1); 33 | int nf; 34 | 35 | suite_add_tcase(s1, tc1_1); 36 | tcase_add_test(tc1_1, the_test); 37 | 38 | srunner_run_all(sr, CK_ENV); 39 | nf = srunner_ntests_failed(sr); 40 | srunner_free(sr); 41 | 42 | return nf == 0 ? 0 : 1; 43 | } 44 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/case_insensitive_pp/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* Test case-insensitive directives. */ 10 | 11 | #include 12 | 13 | 14 | 15 | START_TEST(the_test) 16 | { 17 | #line 10 18 | int nc; 19 | const char msg[] = "\n\n Hello, world!\n"; 20 | 21 | nc = printf("%s", msg); 22 | fail_unless(nc == (sizeof msg 23 | - 1) /* for terminating NUL. */ 24 | ); 25 | } 26 | END_TEST 27 | 28 | int main(void) 29 | { 30 | Suite *s1 = suite_create("The Suite"); 31 | TCase *tc1_1 = tcase_create("The Test Case"); 32 | SRunner *sr = srunner_create(s1); 33 | int nf; 34 | 35 | suite_add_tcase(s1, tc1_1); 36 | tcase_add_test(tc1_1, the_test); 37 | 38 | srunner_run_all(sr, CK_ENV); 39 | nf = srunner_ntests_failed(sr); 40 | srunner_free(sr); 41 | 42 | return nf == 0 ? 0 : 1; 43 | } 44 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/trailing_ws/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* A complete test example (with trailing whitespace) */ 10 | 11 | #include 12 | 13 | 14 | 15 | START_TEST(the_test) 16 | { 17 | #line 10 18 | int nc; 19 | const char msg[] = "\n\n Hello, world!\n"; 20 | 21 | nc = printf("%s", msg); 22 | fail_unless(nc == (sizeof msg 23 | - 1) /* for terminating NUL. */ 24 | ); 25 | } 26 | END_TEST 27 | 28 | int main(void) 29 | { 30 | Suite *s1 = suite_create("The Suite"); 31 | TCase *tc1_1 = tcase_create("The Test Case"); 32 | SRunner *sr = srunner_create(s1); 33 | int nf; 34 | 35 | suite_add_tcase(s1, tc1_1); 36 | tcase_add_test(tc1_1, the_test); 37 | 38 | srunner_run_all(sr, CK_ENV); 39 | nf = srunner_ntests_failed(sr); 40 | srunner_free(sr); 41 | 42 | return nf == 0 ? 0 : 1; 43 | } 44 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/non_word_chars/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* Non-word characters */ 10 | 11 | #include 12 | 13 | 14 | 15 | START_TEST(the_test) 16 | { 17 | #line 10 18 | int nc; 19 | const char msg[] = "\n\n Hello, world!\n"; 20 | 21 | nc = printf("%s", msg); 22 | fail_unless(nc == (sizeof msg 23 | - 1) /* for terminating NUL. */ 24 | ); 25 | } 26 | END_TEST 27 | 28 | int main(void) 29 | { 30 | Suite *s1 = suite_create("The Suite (of Test Cases/\\TCases)"); 31 | TCase *tc1_1 = tcase_create("The \"Test Case\""); 32 | SRunner *sr = srunner_create(s1); 33 | int nf; 34 | 35 | suite_add_tcase(s1, tc1_1); 36 | tcase_add_test(tc1_1, the_test); 37 | 38 | srunner_run_all(sr, CK_ENV); 39 | nf = srunner_ntests_failed(sr); 40 | srunner_free(sr); 41 | 42 | return nf == 0 ? 0 : 1; 43 | } 44 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/ucn/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* A complete test example */ 10 | 11 | #include 12 | 13 | 14 | 15 | START_TEST(the_\u4ECA\u65E5\u306F_test) 16 | { 17 | #line 10 18 | int nc; 19 | const char msg[] = "\n\n Hello, world!\n"; 20 | 21 | nc = printf("%s", msg); 22 | fail_unless(nc == (sizeof msg 23 | - 1) /* for terminating NUL. */ 24 | ); 25 | } 26 | END_TEST 27 | 28 | int main(void) 29 | { 30 | Suite *s1 = suite_create("The Suite"); 31 | TCase *tc1_1 = tcase_create("The Test Case"); 32 | SRunner *sr = srunner_create(s1); 33 | int nf; 34 | 35 | suite_add_tcase(s1, tc1_1); 36 | tcase_add_test(tc1_1, the_\u4ECA\u65E5\u306F_test); 37 | 38 | srunner_run_all(sr, CK_ENV); 39 | nf = srunner_ntests_failed(sr); 40 | srunner_free(sr); 41 | 42 | return nf == 0 ? 0 : 1; 43 | } 44 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/tests/check_money.3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "../src/money.h" 4 | 5 | START_TEST(test_money_create) 6 | { 7 | Money *m; 8 | 9 | m = money_create(5, "USD"); 10 | ck_assert_int_eq(money_amount(m), 5); 11 | ck_assert_str_eq(money_currency(m), "USD"); 12 | money_free(m); 13 | } 14 | END_TEST 15 | 16 | Suite * money_suite(void) 17 | { 18 | Suite *s; 19 | TCase *tc_core; 20 | 21 | s = suite_create("Money"); 22 | 23 | /* Core test case */ 24 | tc_core = tcase_create("Core"); 25 | 26 | tcase_add_test(tc_core, test_money_create); 27 | suite_add_tcase(s, tc_core); 28 | 29 | return s; 30 | } 31 | 32 | int main(void) 33 | { 34 | int number_failed; 35 | Suite *s; 36 | SRunner *sr; 37 | 38 | s = money_suite(); 39 | sr = srunner_create(s); 40 | 41 | srunner_run_all(sr, CK_NORMAL); 42 | number_failed = srunner_ntests_failed(sr); 43 | srunner_free(sr); 44 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 45 | } 46 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/check_check_limit.c: -------------------------------------------------------------------------------- 1 | #include "../lib/libcompat.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include "check_check.h" 7 | #include "check_str.h" 8 | 9 | 10 | static SRunner *sr; 11 | 12 | static void limit_setup (void) 13 | { 14 | Suite *s = suite_create("Empty"); 15 | sr = srunner_create(s); 16 | srunner_run_all(sr, CK_VERBOSE); 17 | } 18 | 19 | static void limit_teardown (void) 20 | { 21 | srunner_free(sr); 22 | } 23 | 24 | START_TEST(test_summary) 25 | { 26 | char * string = sr_stat_str(sr); 27 | ck_assert_msg(strcmp(string, 28 | "100%: Checks: 0, Failures: 0, Errors: 0") == 0, 29 | "Bad statistics string for empty suite"); 30 | free(string); 31 | } 32 | END_TEST 33 | 34 | Suite *make_limit_suite (void) 35 | { 36 | Suite *s = suite_create("Limit"); 37 | TCase *tc = tcase_create("Empty"); 38 | 39 | tcase_add_test(tc,test_summary); 40 | tcase_add_unchecked_fixture(tc,limit_setup,limit_teardown); 41 | 42 | suite_add_tcase(s, tc); 43 | 44 | return s; 45 | } 46 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/main_post/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* A complete test example */ 10 | 11 | #include 12 | 13 | 14 | 15 | START_TEST(the_test) 16 | { 17 | #line 10 18 | int nc; 19 | const char msg[] = "\n\n Hello, world!\n"; 20 | 21 | nc = printf("%s", msg); 22 | fail_unless(nc == (sizeof msg 23 | - 1) /* for terminating NUL. */ 24 | ); 25 | 26 | } 27 | END_TEST 28 | 29 | int main(void) 30 | { 31 | Suite *s1 = suite_create("The Suite"); 32 | TCase *tc1_1 = tcase_create("The Test Case"); 33 | SRunner *sr = srunner_create(s1); 34 | int nf; 35 | 36 | suite_add_tcase(s1, tc1_1); 37 | tcase_add_test(tc1_1, the_test); 38 | 39 | srunner_run_all(sr, CK_ENV); 40 | nf = srunner_ntests_failed(sr); 41 | srunner_free(sr); 42 | 43 | /* User-specified post-run code */ 44 | #line 19 45 | return 0; /* Always report success. */ 46 | } 47 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/main_post_multiple/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* A complete test example */ 10 | 11 | #include 12 | 13 | 14 | 15 | START_TEST(the_test) 16 | { 17 | #line 10 18 | int nc; 19 | const char msg[] = "\n\n Hello, world!\n"; 20 | 21 | nc = printf("%s", msg); 22 | fail_unless(nc == (sizeof msg 23 | - 1) /* for terminating NUL. */ 24 | ); 25 | 26 | } 27 | END_TEST 28 | 29 | int main(void) 30 | { 31 | Suite *s1 = suite_create("The Suite"); 32 | TCase *tc1_1 = tcase_create("The Test Case"); 33 | SRunner *sr = srunner_create(s1); 34 | int nf; 35 | 36 | suite_add_tcase(s1, tc1_1); 37 | tcase_add_test(tc1_1, the_test); 38 | 39 | srunner_run_all(sr, CK_ENV); 40 | nf = srunner_ntests_failed(sr); 41 | srunner_free(sr); 42 | 43 | /* User-specified post-run code */ 44 | #line 19 45 | return 0; /* Always report success. */ 46 | 47 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/main_pre_after_post/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* A complete test example */ 10 | 11 | #include 12 | 13 | 14 | 15 | START_TEST(the_test) 16 | { 17 | #line 10 18 | int nc; 19 | const char msg[] = "\n\n Hello, world!\n"; 20 | 21 | nc = printf("%s", msg); 22 | fail_unless(nc == (sizeof msg 23 | - 1) /* for terminating NUL. */ 24 | ); 25 | 26 | } 27 | END_TEST 28 | 29 | int main(void) 30 | { 31 | Suite *s1 = suite_create("The Suite"); 32 | TCase *tc1_1 = tcase_create("The Test Case"); 33 | SRunner *sr = srunner_create(s1); 34 | int nf; 35 | 36 | suite_add_tcase(s1, tc1_1); 37 | tcase_add_test(tc1_1, the_test); 38 | 39 | srunner_run_all(sr, CK_ENV); 40 | nf = srunner_ntests_failed(sr); 41 | srunner_free(sr); 42 | 43 | /* User-specified post-run code */ 44 | #line 19 45 | return 0; /* Always report success. */ 46 | 47 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/test_after_main_post/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* A complete test example */ 10 | 11 | #include 12 | 13 | 14 | 15 | START_TEST(the_test) 16 | { 17 | #line 10 18 | int nc; 19 | const char msg[] = "\n\n Hello, world!\n"; 20 | 21 | nc = printf("%s", msg); 22 | fail_unless(nc == (sizeof msg 23 | - 1) /* for terminating NUL. */ 24 | ); 25 | 26 | } 27 | END_TEST 28 | 29 | int main(void) 30 | { 31 | Suite *s1 = suite_create("The Suite"); 32 | TCase *tc1_1 = tcase_create("The Test Case"); 33 | SRunner *sr = srunner_create(s1); 34 | int nf; 35 | 36 | suite_add_tcase(s1, tc1_1); 37 | tcase_add_test(tc1_1, the_test); 38 | 39 | srunner_run_all(sr, CK_ENV); 40 | nf = srunner_ntests_failed(sr); 41 | srunner_free(sr); 42 | 43 | /* User-specified post-run code */ 44 | #line 19 45 | return 0; /* Always report success. */ 46 | 47 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/no_args/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file (standard input) instead. 4 | */ 5 | 6 | #include 7 | 8 | /* A complete test example */ 9 | 10 | #include 11 | 12 | 13 | 14 | START_TEST(the_test) 15 | { 16 | int nc; 17 | const char msg[] = "\n\n Hello, world!\n"; 18 | 19 | nc = printf("%s", msg); 20 | fail_unless(nc == (sizeof msg 21 | - 1) /* for terminating NUL. */ 22 | ); 23 | 24 | } 25 | END_TEST 26 | 27 | int main(void) 28 | { 29 | Suite *s1 = suite_create("The Suite"); 30 | TCase *tc1_1 = tcase_create("The Test Case"); 31 | SRunner *sr = srunner_create(s1); 32 | int nf; 33 | 34 | /* User-specified pre-run code */ 35 | int fooyah; 36 | 37 | 38 | suite_add_tcase(s1, tc1_1); 39 | tcase_add_test(tc1_1, the_test); 40 | 41 | srunner_run_all(sr, CK_ENV); 42 | nf = srunner_ntests_failed(sr); 43 | srunner_free(sr); 44 | 45 | /* User-specified post-run code */ 46 | return nf; 47 | } 48 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/declarations/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* A complete test example */ 10 | 11 | #include 12 | 13 | 14 | 15 | START_TEST(the_test) 16 | { 17 | #line 10 18 | int nc; 19 | const char msg[] = "\n\n Hello, world!\n"; 20 | 21 | nc = printf("%s", msg); 22 | fail_unless(nc == (sizeof msg 23 | - 1) /* for terminating NUL. */ 24 | ); 25 | 26 | } 27 | END_TEST 28 | 29 | int main(void) 30 | { 31 | Suite *s1 = suite_create("The Suite"); 32 | TCase *tc1_1 = tcase_create("The Test Case"); 33 | SRunner *sr = srunner_create(s1); 34 | int nf; 35 | 36 | /* User-specified pre-run code */ 37 | #line 19 38 | int declare_me = 0; 39 | 40 | suite_add_tcase(s1, tc1_1); 41 | tcase_add_test(tc1_1, the_test); 42 | 43 | srunner_run_all(sr, CK_ENV); 44 | nf = srunner_ntests_failed(sr); 45 | srunner_free(sr); 46 | 47 | return nf == 0 ? 0 : 1; 48 | } 49 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/configure.ac: -------------------------------------------------------------------------------- 1 | # Process this file with autoconf to produce a configure script. 2 | 3 | # Prelude. 4 | AC_PREREQ([2.59]) 5 | AC_INIT([Money], [0.3], [check-devel AT lists.sourceforge.net]) 6 | AM_PROG_AR 7 | 8 | # unique source file --- primitive safety check 9 | AC_CONFIG_SRCDIR([src/money.c]) 10 | 11 | # place to put some extra build scripts installed 12 | AC_CONFIG_AUX_DIR([build-aux]) 13 | 14 | # fairly severe build strictness 15 | # change foreign to gnu or gnits to comply with gnu standards 16 | AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11.2]) 17 | 18 | # Checks for programs. 19 | AC_PROG_CC 20 | AC_PROG_LIBTOOL 21 | 22 | # Checks for libraries. 23 | 24 | PKG_CHECK_MODULES([CHECK], [check >= 0.9.6]) 25 | AM_PROG_CC_C_O 26 | 27 | # Checks for header files. 28 | AC_HEADER_STDC 29 | AC_CHECK_HEADERS([stdlib.h]) 30 | 31 | # Checks for typedefs, structures, and compiler characteristics. 32 | 33 | # Checks for library functions. 34 | AC_FUNC_MALLOC 35 | 36 | # Output files 37 | AC_CONFIG_HEADERS([config.h]) 38 | 39 | AC_CONFIG_FILES([Makefile 40 | src/Makefile 41 | tests/Makefile]) 42 | 43 | AC_OUTPUT 44 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/multiple_everything/in: -------------------------------------------------------------------------------- 1 | /* Multiple everything... */ 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void print_message(const char *msg, size_t msgsz) 8 | { 9 | int nc; 10 | 11 | nc = printf("%s", msg); 12 | fail_unless(nc == msgsz, "failed to print completely: %s", 13 | strerror(errno)); 14 | } 15 | 16 | # suite A Suite 17 | 18 | # tcase A Test Case 19 | 20 | # test hello_world 21 | const char msg[] = "Hello, world!\n"; 22 | print_message(msg, sizeof msg - 1); 23 | 24 | # test neverending_story 25 | const char msg[] = "Bastian Balthazar Bux\n"; 26 | print_message(msg, sizeof msg - 1); 27 | 28 | # tcase Another Test Case 29 | 30 | # test math_problem 31 | fail_unless(1 + 1 == 2, "Something's broken..."); 32 | 33 | # suite Another Suite 34 | 35 | # tcase A Test Case for Another Suite 36 | 37 | # test more_math 38 | fail_unless(2/2 == 1, "Another weird math result"); 39 | 40 | # tcase A Basket Case 41 | 42 | # test weave 43 | int i; 44 | const char msg[] = "###\n"; 45 | 46 | for (i=0; i != 3; ++i) 47 | print_message(row, sizeof row - 1); 48 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/examples/multiple_everything.ts: -------------------------------------------------------------------------------- 1 | /* Multiple everything... */ 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | void print_message(const char *msg, size_t msgsz) 8 | { 9 | int nc; 10 | 11 | nc = printf("%s", msg); 12 | fail_unless(nc == msgsz, "failed to print completely: %s", 13 | strerror(errno)); 14 | } 15 | 16 | # suite A Suite 17 | 18 | # tcase A Test Case 19 | 20 | # test hello_world 21 | const char msg[] = "Hello, world!\n"; 22 | print_message(msg, sizeof msg - 1); 23 | 24 | # test neverending_story 25 | const char msg[] = "Bastian Balthazar Bux\n"; 26 | print_message(msg, sizeof msg - 1); 27 | 28 | # tcase Another Test Case 29 | 30 | # test math_problem 31 | fail_unless(1 + 1 == 2, "Something's broken..."); 32 | 33 | # suite Another Suite 34 | 35 | # tcase A Test Case for Another Suite 36 | 37 | # test more_math 38 | fail_unless(2/2 == 1, "Another weird math result"); 39 | 40 | # tcase A Basket Case 41 | 42 | # test weave 43 | int i; 44 | const char msg[] = "###\n"; 45 | 46 | for (i=0; i != 3; ++i) 47 | print_message(row, sizeof row - 1); 48 | -------------------------------------------------------------------------------- /src/conn_handler.h: -------------------------------------------------------------------------------- 1 | #ifndef CONN_HANDLER_H 2 | #define CONN_HANDLER_H 3 | #include "config.h" 4 | #include "networking.h" 5 | 6 | /** 7 | * This structure is used to communicate 8 | * between the connection handlers and the 9 | * networking layer. 10 | */ 11 | typedef struct { 12 | statsite_config *config; // Global configuration 13 | statsite_conn_info *conn; // Opaque handle into the networking stack 14 | } statsite_conn_handler; 15 | 16 | /** 17 | * Invoked to initialize the conn handler layer. 18 | */ 19 | void init_conn_handler(statsite_config *config); 20 | 21 | /** 22 | * Invoked to when we've reached the flush interval timeout 23 | */ 24 | void flush_interval_trigger(); 25 | 26 | /** 27 | * Called when statsite is terminating to flush the 28 | * final set of metrics 29 | */ 30 | void final_flush(); 31 | 32 | /** 33 | * Invoked by the networking layer when there is new 34 | * data to be handled. The connection handler should 35 | * consume all the input possible, and generate responses 36 | * to all requests. 37 | * @arg handle The connection related information 38 | * @return 0 on success. 39 | */ 40 | int handle_client_connect(statsite_conn_handler *handle); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/check_check_main.c: -------------------------------------------------------------------------------- 1 | #include "../lib/libcompat.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include "check_check.h" 7 | 8 | int main (void) 9 | { 10 | int n; 11 | SRunner *sr; 12 | 13 | fork_setup(); 14 | setup_fixture(); 15 | setup(); 16 | 17 | sr = srunner_create (make_master_suite()); 18 | srunner_add_suite(sr, make_list_suite()); 19 | srunner_add_suite(sr, make_msg_suite()); 20 | srunner_add_suite(sr, make_log_suite()); 21 | srunner_add_suite(sr, make_log_internal_suite()); 22 | srunner_add_suite(sr, make_limit_suite()); 23 | srunner_add_suite(sr, make_fork_suite()); 24 | srunner_add_suite(sr, make_fixture_suite()); 25 | srunner_add_suite(sr, make_pack_suite()); 26 | 27 | #if defined(HAVE_FORK) && HAVE_FORK==1 28 | srunner_add_suite(sr, make_exit_suite()); 29 | #endif 30 | 31 | srunner_add_suite(sr, make_selective_suite()); 32 | 33 | printf ("Ran %d tests in subordinate suite\n", sub_ntests); 34 | srunner_run_all (sr, CK_VERBOSE); 35 | cleanup(); 36 | fork_teardown(); 37 | teardown_fixture(); 38 | n = srunner_ntests_failed(sr); 39 | srunner_free(sr); 40 | return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 41 | } 42 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/timer_settime.c: -------------------------------------------------------------------------------- 1 | #include "libcompat.h" 2 | 3 | int timer_settime(timer_t timerid CK_ATTRIBUTE_UNUSED, 4 | int flags CK_ATTRIBUTE_UNUSED, 5 | const struct itimerspec *new_value, 6 | struct itimerspec *old_value CK_ATTRIBUTE_UNUSED) 7 | { 8 | #ifdef HAVE_SETITIMER 9 | /* 10 | * If the system does not have timer_settime() but does have 11 | * setitimer() use that instead of alarm(). 12 | */ 13 | struct itimerval interval; 14 | 15 | interval.it_value.tv_sec = new_value->it_value.tv_sec; 16 | interval.it_value.tv_usec = new_value->it_value.tv_nsec / 1000; 17 | interval.it_interval.tv_sec = new_value->it_interval.tv_sec; 18 | interval.it_interval.tv_usec = new_value->it_interval.tv_nsec / 1000; 19 | 20 | return setitimer(ITIMER_REAL, &interval, NULL); 21 | #else 22 | int seconds = new_value->it_value.tv_sec; 23 | 24 | /* 25 | * As the alarm() call has only second precision, if the caller 26 | * specifies partial seconds, we round up to the nearest second. 27 | */ 28 | if(new_value->it_value.tv_nsec > 0) 29 | { 30 | seconds += 1; 31 | } 32 | 33 | alarm(seconds); 34 | 35 | return 0; 36 | #endif 37 | } 38 | -------------------------------------------------------------------------------- /deps/check-0.10.0/cmake/CheckHeaderDirent.cmake: -------------------------------------------------------------------------------- 1 | # - Check if the system has the specified type 2 | # CHECK_HEADER_DIRENT (HEADER1 HEARDER2 ...) 3 | # 4 | # HEADER - the header(s) where the prototype should be declared 5 | # 6 | # The following variables may be set before calling this macro to 7 | # modify the way the check is run: 8 | # 9 | # CMAKE_REQUIRED_FLAGS = string of compile command line flags 10 | # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) 11 | # CMAKE_REQUIRED_INCLUDES = list of include directories 12 | # Copyright (c) 2009, Michihiro NAKAJIMA 13 | # 14 | # Redistribution and use is allowed according to the terms of the BSD license. 15 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 16 | 17 | 18 | INCLUDE(CheckTypeExists) 19 | 20 | MACRO (CHECK_HEADER_DIRENT) 21 | CHECK_TYPE_EXISTS("DIR *" dirent.h HAVE_DIRENT_H) 22 | IF(NOT HAVE_DIRENT_H) 23 | CHECK_TYPE_EXISTS("DIR *" sys/ndir.h HAVE_SYS_NDIR_H) 24 | IF(NOT HAVE_SYS_NDIR_H) 25 | CHECK_TYPE_EXISTS("DIR *" ndir.h HAVE_NDIR_H) 26 | IF(NOT HAVE_NDIR_H) 27 | CHECK_TYPE_EXISTS("DIR *" sys/dir.h HAVE_SYS_DIR_H) 28 | ENDIF(NOT HAVE_NDIR_H) 29 | ENDIF(NOT HAVE_SYS_NDIR_H) 30 | ENDIF(NOT HAVE_DIRENT_H) 31 | ENDMACRO (CHECK_HEADER_DIRENT) 32 | 33 | -------------------------------------------------------------------------------- /Vagrantfile.centos: -------------------------------------------------------------------------------- 1 | VAGRANTFILE_API_VERSION = "2" 2 | 3 | $script = < $script 32 | 33 | 34 | config.vm.post_up_message = < 7 | 8 | #line 1 "in" 9 | /* Test that repeated suites/tcases are only disallowed when they've 10 | * actually been used in defining a test. */ 11 | 12 | 13 | 14 | #line 8 15 | /* But no test... */ 16 | 17 | 18 | 19 | START_TEST(quuux) 20 | { 21 | #line 15 22 | const char msg[] = "Howdy doody!\n"; 23 | int nc = printf(msg); 24 | 25 | fail_unless(nc == sizeof msg - 1); 26 | 27 | } 28 | END_TEST 29 | 30 | 31 | START_TEST(huh) 32 | { 33 | #line 25 34 | fail_unless(ALLOWED_AFTER_ALL); 35 | } 36 | END_TEST 37 | 38 | int main(void) 39 | { 40 | Suite *s1 = suite_create("Baz"); 41 | TCase *tc1_1 = tcase_create("Quux"); 42 | Suite *s2 = suite_create("Foo"); 43 | TCase *tc2_1 = tcase_create("Bar"); 44 | SRunner *sr = srunner_create(s1); 45 | int nf; 46 | 47 | suite_add_tcase(s1, tc1_1); 48 | tcase_add_test(tc1_1, quuux); 49 | suite_add_tcase(s2, tc2_1); 50 | tcase_add_test(tc2_1, huh); 51 | 52 | srunner_add_suite(sr, s2); 53 | 54 | srunner_run_all(sr, CK_ENV); 55 | nf = srunner_ntests_failed(sr); 56 | srunner_free(sr); 57 | 58 | return nf == 0 ? 0 : 1; 59 | } 60 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/test_xml_output.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | OUTPUT_FILE=test.xml 4 | CK_DEFAULT_TIMEOUT=4 5 | 6 | . ./test_vars 7 | . $(dirname $0)/test_output_strings 8 | 9 | rm -f ${OUTPUT_FILE} 10 | export CK_DEFAULT_TIMEOUT 11 | ./ex_output${EXEEXT} CK_MINIMAL XML NORMAL > /dev/null 12 | actual_xml=`cat ${OUTPUT_FILE} | tr -d "\r" | grep -v \ | grep -v \ | grep -v \` 13 | if [ x"${expected_xml}" != x"${actual_xml}" ]; then 14 | echo "Problem with ex_xml_output${EXEEXT}"; 15 | echo "Expected:"; 16 | echo "${expected_xml}"; 17 | echo "Got:"; 18 | echo "${actual_xml}"; 19 | exit 1; 20 | fi 21 | 22 | actual_duration_count=`grep -c \ ${OUTPUT_FILE}` 23 | if [ x"${expected_duration_count}" != x"${actual_duration_count}" ]; then 24 | echo "Wrong number of elements in ${OUTPUT_FILE}, ${expected_duration_count} vs ${actual_duration_count}"; 25 | exit 1; 26 | fi 27 | 28 | for duration in `grep "\" ${OUTPUT_FILE} | cut -d ">" -f 2 | cut -d "<" -f 1`; do 29 | int_duration=`echo $duration | cut -d "." -f 1` 30 | if [ "${int_duration}" -ne "-1" ] && [ "${int_duration}" -gt "${CK_DEFAULT_TIMEOUT}" ]; then 31 | echo "Problem with duration ${duration}; is not valid. Should be -1 or in [0, ${CK_DEFAULT_TIMEOUT}]" 32 | exit 1 33 | fi 34 | done 35 | 36 | 37 | exit 0 38 | -------------------------------------------------------------------------------- /Vagrantfile.debian: -------------------------------------------------------------------------------- 1 | VAGRANTFILE_API_VERSION = "2" 2 | 3 | $script = < $script 32 | 33 | 34 | config.vm.post_up_message = < 2 | #include "hll.h" 3 | 4 | #ifndef SET_H 5 | #define SET_H 6 | 7 | /** 8 | * This is the maximum number of items 9 | * we represent exactly before switching 10 | * to a HyperLogLog 11 | */ 12 | #define SET_MAX_EXACT 64 13 | 14 | typedef enum { 15 | EXACT, // Exact representation, used for small cardinalities 16 | APPROX // Approximate representation, used for large cardinalities 17 | } set_type; 18 | 19 | typedef struct { 20 | unsigned char precision; 21 | uint32_t count; 22 | uint64_t *hashes; 23 | } exact_set; 24 | 25 | typedef struct { 26 | set_type type; 27 | union { 28 | hll_t h; 29 | exact_set s; 30 | } store; 31 | } set_t; 32 | 33 | /** 34 | * Initializes a new set 35 | * @arg precision The precision to use when converting to an HLL 36 | * @arg s The set to initialize 37 | * @return 0 on success. 38 | */ 39 | int set_init(unsigned char precision, set_t *s); 40 | 41 | /** 42 | * Destroys the set 43 | * @return 0 on sucess 44 | */ 45 | int set_destroy(set_t *s); 46 | 47 | /** 48 | * Adds a new key to the set 49 | * @arg s The set to add to 50 | * @arg key The key to add 51 | */ 52 | void set_add(set_t *s, char *key); 53 | 54 | /** 55 | * Returns the size of the set. May be approximate. 56 | * @arg s The set to query 57 | * @return The size of the set. 58 | */ 59 | uint64_t set_size(set_t *s); 60 | 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/hll.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifndef HLL_H 4 | #define HLL_H 5 | 6 | // Ensure precision in a sane bound 7 | #define HLL_MIN_PRECISION 4 // 16 registers 8 | #define HLL_MAX_PRECISION 18 // 262,144 registers 9 | 10 | typedef struct { 11 | unsigned char precision; 12 | uint32_t *registers; 13 | } hll_t; 14 | 15 | /** 16 | * Initializes a new HLL 17 | * @arg precision The digits of precision to use 18 | * @arg h The HLL to initialize 19 | * @return 0 on success 20 | */ 21 | int hll_init(unsigned char precision, hll_t *h); 22 | 23 | /** 24 | * Destroys an hll 25 | * @return 0 on success 26 | */ 27 | int hll_destroy(hll_t *h); 28 | 29 | /** 30 | * Adds a new key to the HLL 31 | * @arg h The hll to add to 32 | * @arg key The key to add 33 | */ 34 | void hll_add(hll_t *h, char *key); 35 | 36 | /** 37 | * Adds a new hash to the HLL 38 | * @arg h The hll to add to 39 | * @arg hash The hash to add 40 | */ 41 | void hll_add_hash(hll_t *h, uint64_t hash); 42 | 43 | /** 44 | * Estimates the cardinality of the HLL 45 | * @arg h The hll to query 46 | * @return An estimate of the cardinality 47 | */ 48 | double hll_size(hll_t *h); 49 | 50 | /** 51 | * Computes the minimum digits of precision 52 | * needed to hit a target error. 53 | * @arg error The target error rate 54 | * @return The number of digits needed, or 55 | * negative on error. 56 | */ 57 | int hll_precision_for_error(double err); 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/cmake/COPYING-CMAKE-SCRIPTS.txt: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without 2 | modification, are permitted provided that the following conditions 3 | are met: 4 | 5 | 1. Redistributions of source code must retain the copyright 6 | notice, this list of conditions and the following disclaimer. 7 | 2. Redistributions in binary form must reproduce the copyright 8 | notice, this list of conditions and the following disclaimer in the 9 | documentation and/or other materials provided with the distribution. 10 | 3. The name of the author may not be used to endorse or promote products 11 | derived from this software without specific prior written permission. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /deps/check-0.10.0/src/check_print.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Check: a unit test framework for C 3 | * Copyright (C) 2001, 2002 Arien Malec 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef CHECK_PRINT_H 22 | #define CHECK_PRINT_H 23 | 24 | /* escape XML special characters (" ' < > &) in str and print to file */ 25 | void fprint_xml_esc(FILE * file, const char *str); 26 | void tr_fprint(FILE * file, TestResult * tr, enum print_output print_mode); 27 | void tr_xmlprint(FILE * file, TestResult * tr, enum print_output print_mode); 28 | void srunner_fprint(FILE * file, SRunner * sr, enum print_output print_mode); 29 | enum print_output get_env_printmode(void); 30 | 31 | 32 | #endif /* CHECK_PRINT_H */ 33 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/check_check_exit.c: -------------------------------------------------------------------------------- 1 | #include "../lib/libcompat.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "check.h" 9 | #include "check_check.h" 10 | 11 | START_TEST(test_early_exit_normal) 12 | { 13 | exit(0); 14 | ck_abort_msg("Should've exitted..."); 15 | } 16 | END_TEST 17 | 18 | START_TEST(test_early_exit_with_allowed_error) 19 | { 20 | exit(-1); 21 | ck_abort_msg("Should've exitted..."); 22 | } 23 | END_TEST 24 | 25 | START_TEST(loop_early_exit_normal) 26 | { 27 | exit(0); 28 | ck_abort_msg("Should've exitted..."); 29 | } 30 | END_TEST 31 | 32 | START_TEST(loop_early_exit_allowed_exit) 33 | { 34 | exit(-2); 35 | ck_abort_msg("Should've exitted..."); 36 | } 37 | END_TEST 38 | 39 | START_TEST(loop_early_exit_signal_segv) 40 | { 41 | raise (SIGSEGV); 42 | ck_abort_msg("Should've exitted..."); 43 | } 44 | END_TEST 45 | 46 | Suite *make_exit_suite(void) 47 | { 48 | Suite *s; 49 | TCase *tc; 50 | 51 | s = suite_create("Exit"); 52 | tc = tcase_create("Core"); 53 | 54 | suite_add_tcase (s, tc); 55 | tcase_add_test(tc,test_early_exit_normal); 56 | tcase_add_exit_test(tc,test_early_exit_with_allowed_error,-1); 57 | tcase_add_loop_test(tc,loop_early_exit_normal,0,5); 58 | tcase_add_loop_exit_test(tc,loop_early_exit_allowed_exit,-2,0,5); 59 | tcase_add_loop_test_raise_signal(tc, loop_early_exit_signal_segv, SIGSEGV, 0, 5); 60 | return s; 61 | } 62 | -------------------------------------------------------------------------------- /deps/check-0.10.0/src/check_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Check: a unit test framework for C 3 | * Copyright (C) 2001, 2002 Arien Malec 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef ERROR_H 22 | #define ERROR_H 23 | 24 | #include "../lib/libcompat.h" 25 | #include 26 | 27 | extern jmp_buf error_jmp_buffer; 28 | 29 | /* Include stdlib.h beforehand */ 30 | 31 | /* Print error message and die 32 | If fmt ends in colon, include system error information */ 33 | void eprintf(const char *fmt, const char *file, int line, 34 | ...) CK_ATTRIBUTE_NORETURN; 35 | /* malloc or die */ 36 | void *emalloc(size_t n); 37 | void *erealloc(void *, size_t n); 38 | 39 | #endif /*ERROR_H */ 40 | -------------------------------------------------------------------------------- /deps/check-0.10.0/src/check_msg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Check: a unit test framework for C 3 | * Copyright (C) 2001, 2002 Arien Malec 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef CHECK_MSG_NEW_H 22 | #define CHECK_MSG_NEW_H 23 | 24 | 25 | /* Functions implementing messaging during test runs */ 26 | 27 | void send_failure_info(const char *msg); 28 | void send_loc_info(const char *file, int line); 29 | void send_ctx_info(enum ck_result_ctx ctx); 30 | void send_duration_info(int duration); 31 | 32 | TestResult *receive_test_result(int waserror); 33 | 34 | void setup_messaging(void); 35 | void teardown_messaging(void); 36 | 37 | FILE *open_tmp_file(char **name); 38 | 39 | #endif /*CHECK_MSG_NEW_H */ 40 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/check_stress.c: -------------------------------------------------------------------------------- 1 | #include "../lib/libcompat.h" 2 | 3 | /* note: this test appears pretty useless, so we aren't including it 4 | in the TESTS variable of Makefile.am */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | Suite *s; 12 | TCase *tc; 13 | SRunner *sr; 14 | 15 | START_TEST(test_pass) 16 | { 17 | ck_assert_msg(1,"Shouldn't see this message"); 18 | } 19 | END_TEST 20 | 21 | START_TEST(test_fail) 22 | { 23 | ck_abort_msg("This test fails"); 24 | } 25 | END_TEST 26 | 27 | 28 | static void run (int num_iters) 29 | { 30 | int i; 31 | s = suite_create ("Stress"); 32 | tc = tcase_create ("Stress"); 33 | sr = srunner_create (s); 34 | suite_add_tcase(s, tc); 35 | 36 | for (i = 0; i < num_iters; i++) { 37 | tcase_add_test (tc, test_pass); 38 | tcase_add_test (tc, test_fail); 39 | } 40 | 41 | srunner_run_all(sr, CK_SILENT); 42 | if (srunner_ntests_failed (sr) != num_iters) { 43 | printf ("Error: expected %d failures, got %d\n", 44 | num_iters, srunner_ntests_failed(sr)); 45 | return; 46 | } 47 | 48 | srunner_free(sr); 49 | } 50 | 51 | 52 | int main(void) 53 | { 54 | int i; 55 | time_t t1; 56 | int iters[] = {1, 100, 1000, 2000, 4000, 8000, 10000, 20000, 40000, -1}; 57 | 58 | for (i = 0; iters[i] != -1; i++) { 59 | t1 = time(NULL); 60 | run(iters[i]); 61 | printf ("%d, %d\n", iters[i], (int) difftime(time(NULL), t1)); 62 | } 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /deps/check-0.10.0/cmake/CheckTypeExists.cmake: -------------------------------------------------------------------------------- 1 | # - Check if the system has the specified type 2 | # CHECK_TYPE_EXISTS (TYPE HEADER VARIABLE) 3 | # 4 | # TYPE - the name of the type or struct or class you are interested in 5 | # HEADER - the header(s) where the prototype should be declared 6 | # VARIABLE - variable to store the result 7 | # 8 | # The following variables may be set before calling this macro to 9 | # modify the way the check is run: 10 | # 11 | # CMAKE_REQUIRED_FLAGS = string of compile command line flags 12 | # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) 13 | # CMAKE_REQUIRED_INCLUDES = list of include directories 14 | # Copyright (c) 2009, Michihiro NAKAJIMA 15 | # Copyright (c) 2006, Alexander Neundorf, 16 | # 17 | # Redistribution and use is allowed according to the terms of the BSD license. 18 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 19 | 20 | 21 | INCLUDE(CheckCSourceCompiles) 22 | 23 | MACRO (CHECK_TYPE_EXISTS _TYPE _HEADER _RESULT) 24 | SET(_INCLUDE_FILES) 25 | FOREACH (it ${_HEADER}) 26 | SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") 27 | ENDFOREACH (it) 28 | 29 | SET(_CHECK_TYPE_EXISTS_SOURCE_CODE " 30 | ${_INCLUDE_FILES} 31 | int main() 32 | { 33 | static ${_TYPE} tmp; 34 | if (sizeof(tmp)) 35 | return 0; 36 | return 0; 37 | } 38 | ") 39 | CHECK_C_SOURCE_COMPILES("${_CHECK_TYPE_EXISTS_SOURCE_CODE}" ${_RESULT}) 40 | 41 | ENDMACRO (CHECK_TYPE_EXISTS) 42 | 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | 9 | # Compiled Static libraries 10 | *.lai 11 | *.la 12 | *.a 13 | 14 | .lvimrc 15 | .sconsign.dblite 16 | tests/build/ 17 | test_runner 18 | statsite 19 | deb/statsite 20 | *.deb 21 | .vagrant 22 | *.pyc 23 | depcomp 24 | compile 25 | 26 | integ/.cache 27 | config.log 28 | .sconsign.dblite 29 | .libs 30 | .deps 31 | .deps/* 32 | src/.deps 33 | /src/.deps 34 | 35 | # http://www.gnu.org/software/automake 36 | 37 | /Makefile 38 | 39 | # http://www.gnu.org/software/autoconf 40 | 41 | autom4te.cache 42 | autoscan.log 43 | autoscan-*.log 44 | compile 45 | configure.scan 46 | config.status 47 | depcomp 48 | install-sh 49 | missing 50 | stamp-h1 51 | 52 | autom4te.cache 53 | 54 | .dirstamp 55 | /dist/ 56 | /config.* 57 | 58 | #OSX 59 | .DS_Store 60 | 61 | /libtool 62 | 63 | Makefile.in 64 | /Makefile 65 | man/Makefile 66 | Makefile 67 | libtool 68 | aclocal.m4 69 | ac_config 70 | configure 71 | 72 | src/buildconfig.h 73 | src/buildconfig.h.in 74 | 75 | 76 | deps/check-0.10.0/build-aux/ 77 | deps/check-0.10.0/config.h.in 78 | deps/check-0.10.0/config.h.in~ 79 | deps/check-0.10.0/check.pc 80 | deps/check-0.10.0/check_stdint.h 81 | deps/check-0.10.0/checkmk/checkmk 82 | deps/check-0.10.0/config.h 83 | deps/check-0.10.0/src/check.h 84 | deps/check-0.10.0/tests/test_vars 85 | 86 | gmon.out 87 | src/buildconfig.h.in~ 88 | test-suite.log 89 | tests/runner 90 | tests/runner.log 91 | tests/runner.trs 92 | -------------------------------------------------------------------------------- /deps/check-0.10.0/cmake/.svn/text-base/CheckTypeExists.cmake.svn-base: -------------------------------------------------------------------------------- 1 | # - Check if the system has the specified type 2 | # CHECK_TYPE_EXISTS (TYPE HEADER VARIABLE) 3 | # 4 | # TYPE - the name of the type or struct or class you are interested in 5 | # HEADER - the header(s) where the prototype should be declared 6 | # VARIABLE - variable to store the result 7 | # 8 | # The following variables may be set before calling this macro to 9 | # modify the way the check is run: 10 | # 11 | # CMAKE_REQUIRED_FLAGS = string of compile command line flags 12 | # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) 13 | # CMAKE_REQUIRED_INCLUDES = list of include directories 14 | # Copyright (c) 2009, Michihiro NAKAJIMA 15 | # Copyright (c) 2006, Alexander Neundorf, 16 | # 17 | # Redistribution and use is allowed according to the terms of the BSD license. 18 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 19 | 20 | 21 | INCLUDE(CheckCSourceCompiles) 22 | 23 | MACRO (CHECK_TYPE_EXISTS _TYPE _HEADER _RESULT) 24 | SET(_INCLUDE_FILES) 25 | FOREACH (it ${_HEADER}) 26 | SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") 27 | ENDFOREACH (it) 28 | 29 | SET(_CHECK_TYPE_EXISTS_SOURCE_CODE " 30 | ${_INCLUDE_FILES} 31 | int main() 32 | { 33 | static ${_TYPE} tmp; 34 | if (sizeof(tmp)) 35 | return 0; 36 | return 0; 37 | } 38 | ") 39 | CHECK_C_SOURCE_COMPILES("${_CHECK_TYPE_EXISTS_SOURCE_CODE}" ${_RESULT}) 40 | 41 | ENDMACRO (CHECK_TYPE_EXISTS) 42 | 43 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/check_nofork.c: -------------------------------------------------------------------------------- 1 | #include "../lib/libcompat.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | Suite *s; 9 | TCase *tc; 10 | SRunner *sr; 11 | 12 | START_TEST(test_nofork_exit) 13 | { 14 | char* s = NULL; 15 | 16 | ck_assert(NULL != s); 17 | 18 | /* this test should not crash in nofork mode */ 19 | ck_assert_str_eq("test", s); 20 | } 21 | END_TEST 22 | 23 | #if !defined(HAVE_FORK) || HAVE_FORK == 0 24 | START_TEST(test_check_fork) 25 | { 26 | ck_assert_int_eq(-1, check_fork()); 27 | } 28 | END_TEST 29 | #endif 30 | 31 | int main(void) 32 | { 33 | s = suite_create("NoFork"); 34 | tc = tcase_create("Exit"); 35 | sr = srunner_create(s); 36 | 37 | suite_add_tcase(s, tc); 38 | tcase_add_test(tc, test_nofork_exit); 39 | 40 | srunner_set_fork_status(sr, CK_NOFORK); 41 | srunner_run_all(sr, CK_MINIMAL); 42 | srunner_free(sr); 43 | 44 | #if !defined(HAVE_FORK) || HAVE_FORK == 0 45 | s = suite_create("NoForkSupport"); 46 | tc = tcase_create("NoFork"); 47 | sr = srunner_create(s); 48 | 49 | /* The following should not fail, but should be ignored */ 50 | srunner_set_fork_status(sr, CK_FORK); 51 | if(srunner_fork_status(sr) != CK_NOFORK) 52 | { 53 | fprintf(stderr, "Call to srunner_set_fork_status() was not ignored\n"); 54 | exit(1); 55 | } 56 | 57 | suite_add_tcase(s, tc); 58 | tcase_add_test(tc, test_check_fork); 59 | srunner_run_all(sr, CK_MINIMAL); 60 | srunner_free(sr); 61 | #endif 62 | 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /deps/check-0.10.0/cmake/CheckStructMember.cmake: -------------------------------------------------------------------------------- 1 | # - Check if the given struct or class has the specified member variable 2 | # CHECK_STRUCT_MEMBER (STRUCT MEMBER HEADER VARIABLE) 3 | # 4 | # STRUCT - the name of the struct or class you are interested in 5 | # MEMBER - the member which existence you want to check 6 | # HEADER - the header(s) where the prototype should be declared 7 | # VARIABLE - variable to store the result 8 | # 9 | # The following variables may be set before calling this macro to 10 | # modify the way the check is run: 11 | # 12 | # CMAKE_REQUIRED_FLAGS = string of compile command line flags 13 | # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) 14 | # CMAKE_REQUIRED_INCLUDES = list of include directories 15 | 16 | # Copyright (c) 2006, Alexander Neundorf, 17 | # 18 | # Redistribution and use is allowed according to the terms of the BSD license. 19 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 20 | 21 | 22 | INCLUDE(CheckCSourceCompiles) 23 | 24 | MACRO (CHECK_STRUCT_MEMBER _STRUCT _MEMBER _HEADER _RESULT) 25 | SET(_INCLUDE_FILES) 26 | FOREACH (it ${_HEADER}) 27 | SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") 28 | ENDFOREACH (it) 29 | 30 | SET(_CHECK_STRUCT_MEMBER_SOURCE_CODE " 31 | ${_INCLUDE_FILES} 32 | int main() 33 | { 34 | static ${_STRUCT} tmp; 35 | if (sizeof(tmp.${_MEMBER})) 36 | return 0; 37 | return 0; 38 | } 39 | ") 40 | CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT}) 41 | 42 | ENDMACRO (CHECK_STRUCT_MEMBER) 43 | 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause 2 | Copyright (c) 2012, Armon Dadgar 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of the organization nor the 13 | names of its contributors may be used to endorse or promote products 14 | derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL ARMON DADGAR BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | -------------------------------------------------------------------------------- /deps/check-0.10.0/cmake/.svn/text-base/CheckStructMember.cmake.svn-base: -------------------------------------------------------------------------------- 1 | # - Check if the given struct or class has the specified member variable 2 | # CHECK_STRUCT_MEMBER (STRUCT MEMBER HEADER VARIABLE) 3 | # 4 | # STRUCT - the name of the struct or class you are interested in 5 | # MEMBER - the member which existence you want to check 6 | # HEADER - the header(s) where the prototype should be declared 7 | # VARIABLE - variable to store the result 8 | # 9 | # The following variables may be set before calling this macro to 10 | # modify the way the check is run: 11 | # 12 | # CMAKE_REQUIRED_FLAGS = string of compile command line flags 13 | # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) 14 | # CMAKE_REQUIRED_INCLUDES = list of include directories 15 | 16 | # Copyright (c) 2006, Alexander Neundorf, 17 | # 18 | # Redistribution and use is allowed according to the terms of the BSD license. 19 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 20 | 21 | 22 | INCLUDE(CheckCSourceCompiles) 23 | 24 | MACRO (CHECK_STRUCT_MEMBER _STRUCT _MEMBER _HEADER _RESULT) 25 | SET(_INCLUDE_FILES) 26 | FOREACH (it ${_HEADER}) 27 | SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") 28 | ENDFOREACH (it) 29 | 30 | SET(_CHECK_STRUCT_MEMBER_SOURCE_CODE " 31 | ${_INCLUDE_FILES} 32 | int main() 33 | { 34 | static ${_STRUCT} tmp; 35 | if (sizeof(tmp.${_MEMBER})) 36 | return 0; 37 | return 0; 38 | } 39 | ") 40 | CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT}) 41 | 42 | ENDMACRO (CHECK_STRUCT_MEMBER) 43 | 44 | -------------------------------------------------------------------------------- /deps/inih/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | The "inih" library is distributed under the New BSD license: 3 | 4 | Copyright (c) 2009, Brush Technology 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of Brush Technology nor the names of its contributors 15 | may be used to endorse or promote products derived from this software 16 | without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY BRUSH TECHNOLOGY ''AS IS'' AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL BRUSH TECHNOLOGY BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /bench_bin.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import time 3 | import random 4 | import struct 5 | 6 | NUM = 1024 * 1024 7 | KEYS = ["test", "foobar", "zipzap"] 8 | VALS = [32, 100, 82, 101, 5, 6, 42, 73] 9 | 10 | BINARY_HEADER = struct.Struct(" 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "check_check.h" 13 | 14 | 15 | #if ENABLE_SUBUNIT 16 | START_TEST(test_init_logging_subunit) 17 | { 18 | /* init_logging with CK_SUBUNIT sets stdout 19 | * to a subunit function, not any log. 20 | */ 21 | Log * first_log = NULL; 22 | Suite *s = suite_create("Suite"); 23 | SRunner *sr = srunner_create(s); 24 | srunner_init_logging(sr, CK_SUBUNIT); 25 | check_list_front (sr->loglst); 26 | ck_assert_msg (!check_list_at_end(sr->loglst), "No entries in log list"); 27 | first_log = (Log *)check_list_val(sr->loglst); 28 | ck_assert_msg (first_log != NULL, "log is NULL"); 29 | check_list_advance(sr->loglst); 30 | ck_assert_msg(check_list_at_end(sr->loglst), "More than one entry in log list"); 31 | ck_assert_msg(first_log->lfun == subunit_lfun, 32 | "Log function is not the subunit lfun."); 33 | srunner_end_logging(sr); 34 | srunner_free(sr); 35 | } 36 | END_TEST 37 | #endif 38 | 39 | Suite *make_log_internal_suite(void) 40 | { 41 | Suite *s; 42 | 43 | #if ENABLE_SUBUNIT 44 | TCase *tc_core_subunit; 45 | s = suite_create("Log"); 46 | tc_core_subunit = tcase_create("Core SubUnit"); 47 | suite_add_tcase(s, tc_core_subunit); 48 | tcase_add_test(tc_core_subunit, test_init_logging_subunit); 49 | #else 50 | s = suite_create("Log"); 51 | #endif 52 | 53 | return s; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /sinks/binary_sink.py: -------------------------------------------------------------------------------- 1 | import struct 2 | import sys 3 | 4 | # Line format. We have: 5 | # 8 byte unsigned timestamp 6 | # 1 byte metric type 7 | # 1 byte value type 8 | # 2 byte key length 9 | # 8 byte value 10 | LINE = struct.Struct(" 2 | #include 3 | #include "../src/money.h" 4 | 5 | START_TEST(test_money_create) 6 | { 7 | Money *m; 8 | 9 | m = money_create(5, "USD"); 10 | ck_assert_int_eq(money_amount(m), 5); 11 | ck_assert_str_eq(money_currency(m), "USD"); 12 | money_free(m); 13 | } 14 | END_TEST 15 | 16 | START_TEST(test_money_create_neg) 17 | { 18 | Money *m = money_create(-1, "USD"); 19 | 20 | ck_assert_msg(m == NULL, 21 | "NULL should be returned on attempt to create with " 22 | "a negative amount"); 23 | } 24 | END_TEST 25 | 26 | START_TEST(test_money_create_zero) 27 | { 28 | Money *m = money_create(0, "USD"); 29 | 30 | if (money_amount(m) != 0) 31 | { 32 | ck_abort_msg("Zero is a valid amount of money"); 33 | } 34 | } 35 | END_TEST 36 | 37 | Suite * money_suite(void) 38 | { 39 | Suite *s; 40 | TCase *tc_core; 41 | TCase *tc_limits; 42 | 43 | s = suite_create("Money"); 44 | 45 | /* Core test case */ 46 | tc_core = tcase_create("Core"); 47 | 48 | tcase_add_test(tc_core, test_money_create); 49 | suite_add_tcase(s, tc_core); 50 | 51 | /* Limits test case */ 52 | tc_limits = tcase_create("Limits"); 53 | 54 | tcase_add_test(tc_limits, test_money_create_neg); 55 | tcase_add_test(tc_limits, test_money_create_zero); 56 | suite_add_tcase(s, tc_limits); 57 | 58 | return s; 59 | } 60 | 61 | int main(void) 62 | { 63 | int number_failed; 64 | Suite *s; 65 | SRunner *sr; 66 | 67 | s = money_suite(); 68 | sr = srunner_create(s); 69 | 70 | srunner_run_all(sr, CK_NORMAL); 71 | number_failed = srunner_ntests_failed(sr); 72 | srunner_free(sr); 73 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 74 | } 75 | -------------------------------------------------------------------------------- /tests/test_set.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "set.h" 10 | 11 | START_TEST(test_set_init_destroy) 12 | { 13 | set_t s; 14 | fail_unless(set_init(12, &s) == 0); 15 | fail_unless(set_destroy(&s) == 0); 16 | } 17 | END_TEST 18 | 19 | START_TEST(test_set_add_size_exact) 20 | { 21 | set_t s; 22 | fail_unless(set_init(12, &s) == 0); 23 | fail_unless(set_size(&s) == 0); 24 | 25 | char buf[100]; 26 | for (int i=0; i < SET_MAX_EXACT; i++) { 27 | fail_unless(sprintf((char*)&buf, "test%d", i)); 28 | set_add(&s, (char*)&buf); 29 | fail_unless(set_size(&s) == i+1); 30 | } 31 | 32 | fail_unless(set_destroy(&s) == 0); 33 | } 34 | END_TEST 35 | 36 | START_TEST(test_set_add_size_exact_dedup) 37 | { 38 | set_t s; 39 | fail_unless(set_init(12, &s) == 0); 40 | fail_unless(set_size(&s) == 0); 41 | 42 | char buf[100]; 43 | fail_unless(sprintf((char*)&buf, "test")); 44 | 45 | for (int i=0; i < SET_MAX_EXACT; i++) { 46 | set_add(&s, (char*)&buf); 47 | fail_unless(set_size(&s) == 1); 48 | } 49 | 50 | fail_unless(set_destroy(&s) == 0); 51 | } 52 | END_TEST 53 | 54 | START_TEST(test_set_error_bound) 55 | { 56 | // Precision 14 -> variance of 1% 57 | set_t s; 58 | fail_unless(set_init(14, &s) == 0); 59 | 60 | char buf[100]; 61 | for (int i=0; i < 10000; i++) { 62 | fail_unless(sprintf((char*)&buf, "test%d", i)); 63 | set_add(&s, (char*)&buf); 64 | } 65 | 66 | // Should be within 1 % 67 | uint64_t size = set_size(&s); 68 | fail_unless(size > 9900 && size < 10100); 69 | 70 | fail_unless(set_destroy(&s) == 0); 71 | } 72 | END_TEST 73 | 74 | 75 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/check_nofork_teardown.c: -------------------------------------------------------------------------------- 1 | #include "../lib/libcompat.h" 2 | 3 | #include 4 | #include 5 | #include "check.h" 6 | 7 | /** 8 | * This test checks the result if in CK_NOFORK 9 | * mode a unit test fails but a checked teardown 10 | * runs after the failed test. 11 | * 12 | * Previously, the failure would be reported as: 13 | * 14 | * 0%: Checks: 1, Failures: 1, Errors: 0 15 | * (null):-1:S:tc:will_fail:0: Assertion '0' failed 16 | * 17 | * The reason why this happens is this: the end of the 18 | * message sequence coming down the pipe is CK_MSG_LOC 19 | * (location of failing test), CK_MSG_FAIL, CK_MSG_CTX 20 | * (TEARDOWN). It is this final message that confuses 21 | * things, because rcvmsg_update_ctx() updates 22 | * rmsg->lastctx (which likely is the right thing for it 23 | * to do), which is the ctx value used by the first 'if' 24 | * body in construct_test_result() in its call to 25 | * tr_set_loc_by_ctx(). 26 | * 27 | * After the fix, the test failure should be reported 28 | * as: 29 | * 30 | * 0%: Checks: 1, Failures: 1, Errors: 0 31 | * check_nofork_teardown.c:33:F:tc:will_fail:0: Assertion '0' failed 32 | */ 33 | 34 | START_TEST( will_fail ) 35 | { 36 | ck_assert(0); 37 | } 38 | END_TEST 39 | 40 | static void empty_checked_teardown( void ) 41 | { 42 | } 43 | 44 | int main( void ) 45 | { 46 | SRunner *sr = srunner_create( NULL ); 47 | Suite *s = suite_create( "bug-99" ); 48 | TCase *tc = tcase_create( "tc" ); 49 | int result; 50 | 51 | srunner_add_suite( sr, s ); 52 | srunner_set_fork_status( sr, CK_NOFORK ); 53 | suite_add_tcase( s, tc ); 54 | tcase_add_checked_fixture( tc, NULL, empty_checked_teardown ); 55 | tcase_add_test( tc, will_fail ); 56 | 57 | srunner_run_all( sr, CK_ENV ); 58 | result = srunner_ntests_failed( sr ) ? EXIT_FAILURE : EXIT_SUCCESS; 59 | srunner_free( sr ); 60 | 61 | return result; 62 | } 63 | -------------------------------------------------------------------------------- /deps/check-0.10.0/src/check_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Check: a unit test framework for C 3 | * Copyright (C) 2001, 2002 Arien Malec 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef CHECK_LIST_H 22 | #define CHECK_LIST_H 23 | 24 | typedef struct List List; 25 | 26 | /* Create an empty list */ 27 | List *check_list_create(void); 28 | 29 | /* Is list at end? */ 30 | int check_list_at_end(List * lp); 31 | 32 | /* Position list at front */ 33 | void check_list_front(List * lp); 34 | 35 | /* Add a value to the front of the list, 36 | positioning newly added value as current value. 37 | More expensive than list_add_end, as it uses memmove. */ 38 | void check_list_add_front(List * lp, void *val); 39 | 40 | /* Add a value to the end of the list, 41 | positioning newly added value as current value */ 42 | void check_list_add_end(List * lp, void *val); 43 | 44 | /* Give the value of the current node */ 45 | void *check_list_val(List * lp); 46 | 47 | /* Position the list at the next node */ 48 | void check_list_advance(List * lp); 49 | 50 | /* Free a list, but don't free values */ 51 | void check_list_free(List * lp); 52 | 53 | void check_list_apply(List * lp, void (*fp) (void *)); 54 | 55 | 56 | #endif /* CHECK_LIST_H */ 57 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/check_check.h: -------------------------------------------------------------------------------- 1 | #ifndef CHECK_CHECK_H 2 | #define CHECK_CHECK_H 3 | 4 | #ifndef TIMEOUT_TESTS_ENABLED 5 | #define TIMEOUT_TESTS_ENABLED 1 6 | #endif 7 | 8 | /* 9 | * Certain unit tests are known to leak memory. This 10 | * #define will prevent those unit tests from being built 11 | * if the program is to be used against valgrind. 12 | */ 13 | #ifndef MEMORY_LEAKING_TESTS_ENABLED 14 | #define MEMORY_LEAKING_TESTS_ENABLED 1 15 | #endif 16 | 17 | extern int sub_ntests; 18 | 19 | void fork_setup (void); 20 | void fork_teardown (void); 21 | void setup_fixture(void); 22 | void teardown_fixture (void); 23 | void setup (void); 24 | void cleanup (void); 25 | Suite *make_sub_suite(void); 26 | Suite *make_sub2_suite(void); 27 | Suite *make_master_suite(void); 28 | Suite *make_list_suite(void); 29 | Suite *make_msg_suite(void); 30 | Suite *make_log_suite(void); 31 | Suite *make_log_internal_suite(void); 32 | Suite *make_limit_suite(void); 33 | Suite *make_fork_suite(void); 34 | Suite *make_fixture_suite(void); 35 | Suite *make_pack_suite(void); 36 | Suite *make_exit_suite(void); 37 | Suite *make_selective_suite(void); 38 | 39 | extern int master_tests_lineno[]; 40 | void init_master_tests_lineno(int num_master_tests); 41 | 42 | /** 43 | * Record a line number for a test which is to fail. 44 | * 45 | * This is used to record the failure line numbers for 46 | * all tests in check_check_sub.c. Simply make this 47 | * call right before an assert to record the proper 48 | * line number. The line number is adjusted +1 internally, 49 | * to account for making this call before the failure. 50 | */ 51 | void record_failure_line_num(const int line); 52 | 53 | /** 54 | * Once the failure file numbers have been recorded 55 | * to file and the file has been rewind(), this 56 | * call will extract the next line number from the 57 | * file. 58 | * 59 | * If there are no more lines to read, -1 is returned. 60 | */ 61 | int get_next_failure_line_num(FILE * file); 62 | 63 | #endif /* CHECK_CHECK_H */ 64 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/clock_gettime.c: -------------------------------------------------------------------------------- 1 | #include "libcompat.h" 2 | 3 | #ifdef __MACH__ 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #endif 10 | 11 | #define NANOSECONDS_PER_SECOND 1000000000 12 | 13 | 14 | 15 | int clock_gettime(clockid_t clk_id CK_ATTRIBUTE_UNUSED, struct timespec *ts) 16 | { 17 | 18 | #ifdef __MACH__ 19 | /* OS X does not have clock_gettime, use mach_absolute_time */ 20 | 21 | static mach_timebase_info_data_t sTimebaseInfo; 22 | uint64_t rawTime; 23 | uint64_t nanos; 24 | 25 | rawTime = mach_absolute_time(); 26 | 27 | /* 28 | * OS X has a function to convert abs time to nano seconds: AbsoluteToNanoseconds 29 | * However, the function may not be available as we may not have 30 | * access to CoreServices. Because of this, we convert the abs time 31 | * to nano seconds manually. 32 | */ 33 | 34 | /* 35 | * First grab the time base used on the system, if this is the first 36 | * time we are being called. We can check if the value is uninitialized, 37 | * as the denominator will be zero. 38 | */ 39 | if(sTimebaseInfo.denom == 0) 40 | { 41 | (void)mach_timebase_info(&sTimebaseInfo); 42 | } 43 | 44 | /* 45 | * Do the conversion. We hope that the multiplication doesn't 46 | * overflow; the price you pay for working in fixed point. 47 | */ 48 | nanos = rawTime * sTimebaseInfo.numer / sTimebaseInfo.denom; 49 | 50 | /* 51 | * Fill in the timespec container 52 | */ 53 | ts->tv_sec = nanos / NANOSECONDS_PER_SECOND; 54 | ts->tv_nsec = nanos - (ts->tv_sec * NANOSECONDS_PER_SECOND); 55 | #else 56 | /* 57 | * As there is no function to fall back onto to get the current 58 | * time, zero out the time so the caller will have a sane value. 59 | */ 60 | ts->tv_sec = 0; 61 | ts->tv_nsec = 0; 62 | #endif 63 | 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /deps/check-0.10.0/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Check: a unit test framework for C 3 | # Copyright (C) 2011 Mateusz Loskot 4 | # Copyright (C) 2001, 2002 Arien Malec 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Lesser General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2.1 of the License, or (at your option) any later version. 10 | # 11 | # This library is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | # Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this library; if not, write to the 18 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | # Boston, MA 02111-1307, USA. 20 | # 21 | 22 | set(SOURCES 23 | check.c 24 | check_error.c 25 | check_list.c 26 | check_log.c 27 | check_msg.c 28 | check_pack.c 29 | check_print.c 30 | check_run.c 31 | check_str.c) 32 | 33 | set(HEADERS 34 | ${CONFIG_HEADER} 35 | ${CMAKE_CURRENT_BINARY_DIR}/check.h 36 | check.h.in 37 | check_error.h 38 | check_impl.h 39 | check_list.h 40 | check_log.h 41 | check_msg.h 42 | check_pack.h 43 | check_print.h 44 | check_str.h) 45 | 46 | configure_file(check.h.in check.h) 47 | 48 | # Enable finding check.h 49 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) 50 | 51 | add_library(check STATIC ${SOURCES} ${HEADERS}) 52 | target_link_libraries(check ${LIBM} ${LIBRT} ${SUBUNIT}) 53 | 54 | if(MSVC) 55 | add_definitions(-DCK_DLL_EXP=_declspec\(dllexport\)) 56 | endif (MSVC) 57 | 58 | install(TARGETS check 59 | EXPORT check 60 | RUNTIME DESTINATION bin 61 | LIBRARY DESTINATION lib 62 | ARCHIVE DESTINATION lib) 63 | 64 | install(FILES ${CMAKE_BINARY_DIR}/src/check.h DESTINATION include) 65 | install(EXPORT check DESTINATION cmake) 66 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/check_thread_stress.c: -------------------------------------------------------------------------------- 1 | #include "../lib/libcompat.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | Suite *s; 8 | TCase *tc; 9 | SRunner *sr; 10 | 11 | #if defined (HAVE_PTHREAD) || defined (HAVE_FORK) 12 | static void * 13 | sendinfo (void *userdata CK_ATTRIBUTE_UNUSED) 14 | { 15 | unsigned int i; 16 | for (i = 0; i < 999; i++) 17 | { 18 | ck_assert_msg (1, "Shouldn't see this message"); 19 | } 20 | return NULL; 21 | } 22 | #endif /* HAVE_PTHREAD || HAVE_FORK */ 23 | 24 | #ifdef HAVE_PTHREAD 25 | START_TEST (test_stress_threads) 26 | { 27 | pthread_t a, b; 28 | pthread_create (&a, NULL, sendinfo, (void *) 0xa); 29 | pthread_create (&b, NULL, sendinfo, (void *) 0xb); 30 | 31 | pthread_join (a, NULL); 32 | pthread_join (b, NULL); 33 | } 34 | END_TEST 35 | #endif /* HAVE_PTHREAD */ 36 | 37 | #if defined(HAVE_FORK) && HAVE_FORK==1 38 | START_TEST (test_stress_forks) 39 | { 40 | pid_t cpid = fork (); 41 | if (cpid == 0) 42 | { 43 | /* child */ 44 | sendinfo ((void *) 0x1); 45 | exit (EXIT_SUCCESS); 46 | } 47 | else 48 | { 49 | /* parent */ 50 | sendinfo ((void *) 0x2); 51 | } 52 | } 53 | END_TEST 54 | #endif /* HAVE_FORK */ 55 | 56 | int 57 | main (void) 58 | { 59 | int nf; 60 | s = suite_create ("ForkThreadStress"); 61 | tc = tcase_create ("ForkThreadStress"); 62 | sr = srunner_create (s); 63 | suite_add_tcase (s, tc); 64 | 65 | #ifdef HAVE_PTHREAD 66 | tcase_add_loop_test (tc, test_stress_threads, 0, 100); 67 | #endif /* HAVE_PTHREAD */ 68 | 69 | #if defined(HAVE_FORK) && HAVE_FORK==1 70 | tcase_add_loop_test (tc, test_stress_forks, 0, 100); 71 | #endif /* HAVE_FORK */ 72 | 73 | srunner_run_all (sr, CK_VERBOSE); 74 | nf = srunner_ntests_failed (sr); 75 | srunner_free (sr); 76 | 77 | /* hack to give us XFAIL on non-posix platforms */ 78 | #ifndef HAVE_FORK 79 | nf++; 80 | #endif /* !HAVE_FORK */ 81 | 82 | return nf ? EXIT_FAILURE : EXIT_SUCCESS; 83 | } 84 | -------------------------------------------------------------------------------- /rpm/statsite.initscript: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # statsite Startup script for statsite 4 | # 5 | # chkconfig: - 85 15 6 | # processname: statsite 7 | # config: /etc/statsite/statsite.conf 8 | # config: /etc/sysconfig/statsite 9 | # pidfile: /var/run/statsite.pid 10 | # description: Statsite is a metrics aggregation server 11 | # 12 | ### BEGIN INIT INFO 13 | # Provides: statsite 14 | # Required-Start: $local_fs $remote_fs $network 15 | # Required-Stop: $local_fs $remote_fs $network 16 | # Default-Start: 2 3 4 5 17 | # Default-Stop: 0 1 6 18 | # Short-Description: start and stop statsite 19 | ### END INIT INFO 20 | 21 | # Source function library. 22 | . /etc/rc.d/init.d/functions 23 | 24 | if [ -f /etc/sysconfig/statsite ]; then 25 | . /etc/sysconfig/statsite 26 | fi 27 | 28 | prog=statsite 29 | user=${STATSITEUSER-statsite} 30 | statsite=${STATSITE-/usr/sbin/statsite} 31 | conffile=${CONFFILE-/etc/statsite/statsite.conf} 32 | pidfile=${PIDFILE-/var/run/statsite/statsite.pid} 33 | RETVAL=0 34 | 35 | start() { 36 | echo -n $"Starting $prog: " 37 | 38 | # Nuke stale pidfile 39 | pkill -9 -U ${user} ${prog} 40 | rm -f ${pidfile} 41 | 42 | daemon --user ${user} --pidfile=${pidfile} ${statsite} -f ${conffile} 43 | RETVAL=$? 44 | echo 45 | return $RETVAL 46 | } 47 | 48 | stop() { 49 | echo -n $"Stopping $prog: " 50 | killproc -p ${pidfile} ${prog} 51 | RETVAL=$? 52 | echo 53 | [ $RETVAL = 0 ] && rm -f ${pidfile} 54 | } 55 | 56 | rh_status() { 57 | status -p ${pidfile} ${statsite} 58 | } 59 | 60 | # See how we were called. 61 | case "$1" in 62 | start) 63 | rh_status >/dev/null 2>&1 && exit 0 64 | start 65 | ;; 66 | stop) 67 | stop 68 | ;; 69 | status) 70 | rh_status 71 | RETVAL=$? 72 | ;; 73 | restart) 74 | stop 75 | start 76 | ;; 77 | *) 78 | echo $"Usage: $prog {start|stop|restart|status|help}" 79 | RETVAL=2 80 | esac 81 | 82 | exit $RETVAL 83 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/tests/check_money.7.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "../src/money.h" 4 | 5 | Money *five_dollars; 6 | 7 | void setup(void) 8 | { 9 | five_dollars = money_create(5, "USD"); 10 | } 11 | 12 | void teardown(void) 13 | { 14 | money_free(five_dollars); 15 | } 16 | 17 | START_TEST(test_money_create) 18 | { 19 | ck_assert_int_eq(money_amount(five_dollars), 5); 20 | ck_assert_str_eq(money_currency(five_dollars), "USD"); 21 | } 22 | END_TEST 23 | 24 | START_TEST(test_money_create_neg) 25 | { 26 | Money *m = money_create(-1, "USD"); 27 | 28 | ck_assert_msg(m == NULL, 29 | "NULL should be returned on attempt to create with " 30 | "a negative amount"); 31 | } 32 | END_TEST 33 | 34 | START_TEST(test_money_create_zero) 35 | { 36 | Money *m = money_create(0, "USD"); 37 | 38 | if (money_amount(m) != 0) 39 | { 40 | ck_abort_msg("Zero is a valid amount of money"); 41 | } 42 | } 43 | END_TEST 44 | 45 | Suite * money_suite(void) 46 | { 47 | Suite *s; 48 | TCase *tc_core; 49 | TCase *tc_limits; 50 | 51 | s = suite_create("Money"); 52 | 53 | /* Core test case */ 54 | tc_core = tcase_create("Core"); 55 | 56 | tcase_add_checked_fixture(tc_core, setup, teardown); 57 | tcase_add_test(tc_core, test_money_create); 58 | suite_add_tcase(s, tc_core); 59 | 60 | /* Limits test case */ 61 | tc_limits = tcase_create("Limits"); 62 | 63 | tcase_add_test(tc_limits, test_money_create_neg); 64 | tcase_add_test(tc_limits, test_money_create_zero); 65 | suite_add_tcase(s, tc_limits); 66 | 67 | return s; 68 | } 69 | 70 | int main(void) 71 | { 72 | int number_failed; 73 | Suite *s; 74 | SRunner *sr; 75 | 76 | s = money_suite(); 77 | sr = srunner_create(s); 78 | 79 | srunner_run_all(sr, CK_NORMAL); 80 | number_failed = srunner_ntests_failed(sr); 81 | srunner_free(sr); 82 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 83 | } 84 | -------------------------------------------------------------------------------- /deps/inih/inih.h: -------------------------------------------------------------------------------- 1 | /* inih -- simple .INI file parser 2 | 3 | inih is released under the New BSD license (see LICENSE.txt). Go to the project 4 | home page for more info: 5 | 6 | http://code.google.com/p/inih/ 7 | 8 | */ 9 | 10 | #ifndef __INI_H__ 11 | #define __INI_H__ 12 | 13 | /* Make this header file easier to include in C++ code */ 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #include 19 | 20 | /* Parse given INI-style file. May have [section]s, name=value pairs 21 | (whitespace stripped), and comments starting with ';' (semicolon). Section 22 | is "" if name=value pair parsed before any section heading. name:value 23 | pairs are also supported as a concession to Python's ConfigParser. 24 | 25 | For each name=value pair parsed, call handler function with given user 26 | pointer as well as section, name, and value (data only valid for duration 27 | of handler call). Handler should return nonzero on success, zero on error. 28 | 29 | Returns 0 on success, line number of first error on parse error (doesn't 30 | stop on first error), or -1 on file open error. 31 | */ 32 | int ini_parse(const char* filename, 33 | int (*handler)(void* user, const char* section, 34 | const char* name, const char* value), 35 | void* user); 36 | 37 | /* Same as ini_parse(), but takes a FILE* instead of filename. This doesn't 38 | close the file when it's finished -- the caller must do that. */ 39 | int ini_parse_file(FILE* file, 40 | int (*handler)(void* user, const char* section, 41 | const char* name, const char* value), 42 | void* user); 43 | 44 | /* Nonzero to allow multi-line value parsing, in the style of Python's 45 | ConfigParser. If allowed, ini_parse() will call the handler with the same 46 | name for each subsequent line parsed. */ 47 | #ifndef INI_ALLOW_MULTILINE 48 | #define INI_ALLOW_MULTILINE 0 49 | #endif 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* __INI_H__ */ 56 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/tests/check_money.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "../src/money.h" 6 | 7 | Money *five_dollars; 8 | 9 | void setup(void) 10 | { 11 | five_dollars = money_create(5, "USD"); 12 | } 13 | 14 | void teardown(void) 15 | { 16 | money_free(five_dollars); 17 | } 18 | 19 | START_TEST(test_money_create) 20 | { 21 | ck_assert_int_eq(money_amount(five_dollars), 5); 22 | ck_assert_str_eq(money_currency(five_dollars), "USD"); 23 | } 24 | END_TEST 25 | 26 | START_TEST(test_money_create_neg) 27 | { 28 | Money *m = money_create(-1, "USD"); 29 | 30 | ck_assert_msg(m == NULL, 31 | "NULL should be returned on attempt to create with " 32 | "a negative amount"); 33 | } 34 | END_TEST 35 | 36 | START_TEST(test_money_create_zero) 37 | { 38 | Money *m = money_create(0, "USD"); 39 | 40 | if (money_amount(m) != 0) 41 | { 42 | ck_abort_msg("Zero is a valid amount of money"); 43 | } 44 | } 45 | END_TEST 46 | 47 | Suite * money_suite(void) 48 | { 49 | Suite *s; 50 | TCase *tc_core; 51 | TCase *tc_limits; 52 | 53 | s = suite_create("Money"); 54 | 55 | /* Core test case */ 56 | tc_core = tcase_create("Core"); 57 | 58 | tcase_add_checked_fixture(tc_core, setup, teardown); 59 | tcase_add_test(tc_core, test_money_create); 60 | suite_add_tcase(s, tc_core); 61 | 62 | /* Limits test case */ 63 | tc_limits = tcase_create("Limits"); 64 | 65 | tcase_add_test(tc_limits, test_money_create_neg); 66 | tcase_add_test(tc_limits, test_money_create_zero); 67 | suite_add_tcase(s, tc_limits); 68 | 69 | return s; 70 | } 71 | 72 | int main(void) 73 | { 74 | int number_failed; 75 | Suite *s; 76 | SRunner *sr; 77 | 78 | s = money_suite(); 79 | sr = srunner_create(s); 80 | 81 | srunner_run_all(sr, CK_NORMAL); 82 | number_failed = srunner_ntests_failed(sr); 83 | srunner_free(sr); 84 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 85 | } 86 | -------------------------------------------------------------------------------- /deps/check-0.10.0/cmake/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 1219 5 | https://svn.code.sf.net/p/check/code/tags/check-0.10.0/cmake 6 | https://svn.code.sf.net/p/check/code 7 | 8 | 9 | 10 | 2014-01-02T02:43:22.146640Z 11 | 1005 12 | brarcher 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 64e312b2-a51f-0410-8e61-82d0ca0eb02a 28 | 29 | CheckStructMember.cmake 30 | file 31 | 32 | 33 | 34 | 35 | 2015-08-02T19:31:23.386440Z 36 | 70a7e0a550d1e641080a848f1712057d 37 | 2013-12-25T03:03:58.307369Z 38 | 928 39 | brarcher 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 1360 62 | 63 | CheckHeaderDirent.cmake 64 | file 65 | 66 | 67 | 68 | 69 | 2015-08-02T19:31:23.386440Z 70 | cb8920ffe101a72cdbd061617f61c86e 71 | 2013-12-25T03:03:58.307369Z 72 | 928 73 | brarcher 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 1125 96 | 97 | check_stdint.h.in 98 | file 99 | 100 | 101 | 102 | 103 | 2015-08-02T19:31:23.386440Z 104 | b3575498dd03e1e55669b858e98a4c71 105 | 2013-12-25T04:39:11.288469Z 106 | 974 107 | brarcher 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 117 130 | 131 | CheckTypeExists.cmake 132 | file 133 | 134 | 135 | 136 | 137 | 2015-08-02T19:31:23.386440Z 138 | 64db5c0f0124b0d357d44623745f5caf 139 | 2013-12-25T03:03:58.307369Z 140 | 928 141 | brarcher 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 1281 164 | 165 | config.h.in 166 | file 167 | 168 | 169 | 170 | 171 | 2015-08-02T19:31:23.386440Z 172 | ae9df198513f8ce7d62c6154e194f26e 173 | 2014-01-02T02:43:22.146640Z 174 | 1005 175 | brarcher 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 10962 198 | 199 | -------------------------------------------------------------------------------- /tests/test_counter.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "counter.h" 11 | 12 | START_TEST(test_counter_init) 13 | { 14 | counter c; 15 | int res = init_counter(&c); 16 | fail_unless(res == 0); 17 | } 18 | END_TEST 19 | 20 | START_TEST(test_counter_init_add) 21 | { 22 | counter c; 23 | int res = init_counter(&c); 24 | fail_unless(res == 0); 25 | 26 | fail_unless(counter_add_sample(&c, 100, 1.0) == 0); 27 | fail_unless(counter_count(&c) == 1); 28 | fail_unless(counter_sum(&c) == 100); 29 | fail_unless(counter_mean(&c) == 100); 30 | fail_unless(counter_stddev(&c) == 0); 31 | fail_unless(counter_squared_sum(&c) == 10000); 32 | fail_unless(counter_min(&c) == 100); 33 | fail_unless(counter_max(&c) == 100); 34 | } 35 | END_TEST 36 | 37 | START_TEST(test_counter_add_loop) 38 | { 39 | counter c; 40 | int res = init_counter(&c); 41 | fail_unless(res == 0); 42 | 43 | for (int i=1; i<=100; i++) 44 | fail_unless(counter_add_sample(&c, i, 1.0) == 0); 45 | 46 | fail_unless(counter_count(&c) == 100); 47 | fail_unless(counter_sum(&c) == 5050); 48 | fail_unless(counter_mean(&c) == 50.5); 49 | fail_unless(round(counter_stddev(&c)*1000)/1000 == 29.011); 50 | fail_unless(counter_squared_sum(&c) == 338350); 51 | fail_unless(counter_min(&c) == 1); 52 | fail_unless(counter_max(&c) == 100); 53 | } 54 | END_TEST 55 | 56 | START_TEST(test_counter_sample_rate) 57 | { 58 | counter c; 59 | int res = init_counter(&c); 60 | fail_unless(res == 0); 61 | 62 | for (int i=1; i<=100; i++) 63 | fail_unless(counter_add_sample(&c, i, 0.5) == 0); 64 | 65 | fail_unless(counter_count(&c) == 200); 66 | fail_unless(counter_sum(&c) == 5050); 67 | fail_unless(counter_mean(&c) == 50.5); 68 | fail_unless(round(counter_stddev(&c)*1000)/1000 == 29.011); 69 | fail_unless(counter_squared_sum(&c) == 338350); 70 | fail_unless(counter_min(&c) == 1); 71 | fail_unless(counter_max(&c) == 100); 72 | } 73 | END_TEST 74 | -------------------------------------------------------------------------------- /deps/check-0.10.0/src/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | lib_LTLIBRARIES = libcheck.la 4 | noinst_LTLIBRARIES = libcheckinternal.la 5 | 6 | include_HEADERS = check.h 7 | 8 | EXTRA_DIST = check.h.in 9 | 10 | AM_CFLAGS = @GCOV_CFLAGS@ @PTHREAD_CFLAGS@ $(LIBSUBUNIT_CFLAGS) 11 | 12 | CFILES =\ 13 | check.c \ 14 | check_error.c \ 15 | check_list.c \ 16 | check_log.c \ 17 | check_msg.c \ 18 | check_pack.c \ 19 | check_print.c \ 20 | check_run.c \ 21 | check_str.c 22 | 23 | HFILES =\ 24 | check.h \ 25 | check_error.h \ 26 | check_impl.h \ 27 | check_list.h \ 28 | check_log.h \ 29 | check_msg.h \ 30 | check_pack.h \ 31 | check_print.h \ 32 | check_str.h 33 | 34 | 35 | EXPORT_SYM = exported.sym 36 | $(EXPORT_SYM): check.h.in 37 | ${SED} -n -e 's/^..*CK_EXPORT[[:space:]][[:space:]]*\([[:alnum:]_][[:alnum:]_]*\)..*$$/\1/p' @top_srcdir@/src/check.h.in > $@ 38 | 39 | libcheck_la_DEPENDENCIES= $(EXPORT_SYM) 40 | libcheck_la_LDFLAGS = -no-undefined -export-symbols $(EXPORT_SYM) 41 | libcheck_la_SOURCES = $(CFILES) $(HFILES) 42 | libcheck_la_LIBADD = @GCOV_LIBS@ @PTHREAD_LIBS@ $(LIBSUBUNIT_LIBS) $(top_builddir)/lib/libcompat.la 43 | 44 | libcheckinternal_la_LDFLAGS = -no-undefined 45 | libcheckinternal_la_SOURCES = $(CFILES) $(HFILES) 46 | libcheckinternal_la_LIBADD = @GCOV_LIBS@ @PTHREAD_LIBS@ $(LIBSUBUNIT_LIBS) $(top_builddir)/lib/libcompat.la 47 | 48 | CLEANFILES = *~ *.gcno $(EXPORT_SYM) 49 | 50 | LCOV_INPUT = $(CFILES:%.c=.libs/%.gcda) 51 | LCOV_OUTPUT = lcov.info 52 | LCOV_HTML = lcov_html 53 | LCOV_LCOV = @LCOV@ 54 | LCOV_GENHTML = @GENHTML@ 55 | 56 | lcov: $(LCOV_HTML) 57 | 58 | $(LCOV_INPUT): libcheck.la libcheckinternal.la 59 | @$(MAKE) -C $(top_builddir)/tests check 60 | 61 | $(LCOV_OUTPUT): $(LCOV_INPUT) 62 | $(LCOV_LCOV) --capture --directory . --base-directory . --output-file $@ 63 | 64 | $(LCOV_HTML): $(LCOV_OUTPUT) 65 | -$(RM) -r $@ 66 | LANG=C $(LCOV_GENHTML) --output-directory $@ --title "Check Code Coverage" --show-details $< 67 | @echo "Point a web browser at $(LCOV_HTML)/index.html to see results." 68 | 69 | clean-local: lcov-clean 70 | 71 | .PHONY: lcov-clean 72 | lcov-clean: 73 | -$(RM) -r $(LCOV_HTML) $(LCOV_OUTPUT) 74 | -------------------------------------------------------------------------------- /src/counter.h: -------------------------------------------------------------------------------- 1 | #ifndef COUNTER_H 2 | #define COUNTER_H 3 | #include 4 | 5 | typedef struct { 6 | uint64_t actual_count; // Actual items recieved 7 | uint64_t count; // Count of items 8 | double sum; // Sum of the values 9 | double squared_sum; // Sum of the squared values 10 | double min; // Minimum value 11 | double max; // Maximum value 12 | } counter; 13 | 14 | /** 15 | * Initializes the counter struct 16 | * @arg counter The counter struct to initialize 17 | * @return 0 on success. 18 | */ 19 | int init_counter(counter *counter); 20 | 21 | /** 22 | * Adds a new sample to the struct 23 | * @arg counter The counter to add to 24 | * @arg sample The new sample value 25 | * @return 0 on success. 26 | */ 27 | int counter_add_sample(counter *counter, double sample, double sample_rate); 28 | 29 | /** 30 | * Returns the number of samples in the counter 31 | * @arg counter The counter to query 32 | * @return The number of samples 33 | */ 34 | uint64_t counter_count(counter *counter); 35 | 36 | /** 37 | * Returns the mean counter value 38 | * @arg counter The counter to query 39 | * @return The mean value 40 | */ 41 | double counter_mean(counter *counter); 42 | 43 | /** 44 | * Returns the sample standard deviation counter value 45 | * @arg counter The counter to query 46 | * @return The sample standard deviation 47 | */ 48 | double counter_stddev(counter *counter); 49 | 50 | /** 51 | * Returns the sum of the counter 52 | * @arg counter The counter to query 53 | * @return The sum of values 54 | */ 55 | double counter_sum(counter *counter); 56 | 57 | /** 58 | * Returns the sum squared of the counter 59 | * @arg counter The counter to query 60 | * @return The sum squared of values 61 | */ 62 | double counter_squared_sum(counter *counter); 63 | 64 | /** 65 | * Returns the minimum value of the counter 66 | * @arg counter The counter to query 67 | * @return The minimum value. 68 | */ 69 | double counter_min(counter *counter); 70 | 71 | /** 72 | * Returns the maximum value of the counter 73 | * @arg counter The counter to query 74 | * @return The maximum value. 75 | */ 76 | double counter_max(counter *counter); 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /deps/check-0.10.0/src/check_pack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Check: a unit test framework for C 3 | * Copyright (C) 2001, 2002 Arien Malec 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef CHECK_PACK_H 22 | #define CHECK_PACK_H 23 | 24 | 25 | enum ck_msg_type 26 | { 27 | CK_MSG_CTX, 28 | CK_MSG_FAIL, 29 | CK_MSG_LOC, 30 | CK_MSG_DURATION, 31 | CK_MSG_LAST 32 | }; 33 | 34 | typedef struct CtxMsg 35 | { 36 | enum ck_result_ctx ctx; 37 | } CtxMsg; 38 | 39 | typedef struct LocMsg 40 | { 41 | int line; 42 | char *file; 43 | } LocMsg; 44 | 45 | typedef struct FailMsg 46 | { 47 | char *msg; 48 | } FailMsg; 49 | 50 | typedef struct DurationMsg 51 | { 52 | int duration; 53 | } DurationMsg; 54 | 55 | typedef union 56 | { 57 | CtxMsg ctx_msg; 58 | FailMsg fail_msg; 59 | LocMsg loc_msg; 60 | DurationMsg duration_msg; 61 | } CheckMsg; 62 | 63 | typedef struct RcvMsg 64 | { 65 | enum ck_result_ctx lastctx; 66 | enum ck_result_ctx failctx; 67 | char *fixture_file; 68 | int fixture_line; 69 | char *test_file; 70 | int test_line; 71 | char *msg; 72 | int duration; 73 | } RcvMsg; 74 | 75 | void rcvmsg_free(RcvMsg * rmsg); 76 | 77 | 78 | int pack(enum ck_msg_type type, char **buf, CheckMsg * msg); 79 | int upack(char *buf, CheckMsg * msg, enum ck_msg_type *type); 80 | 81 | void ppack(FILE * fdes, enum ck_msg_type type, CheckMsg * msg); 82 | RcvMsg *punpack(FILE * fdes); 83 | 84 | #endif /*CHECK_PACK_H */ 85 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/check_mem_leaks.c: -------------------------------------------------------------------------------- 1 | /** 2 | * The purpose of this test is to be used by valgrind to check for 3 | * memory leaks. Each public API that check exports is used at 4 | * least once. Tests which use non-public API, or leak intentionally, 5 | * are not included here. 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "config.h" 13 | #include "check_check.h" 14 | 15 | int main () 16 | { 17 | int n; 18 | SRunner *sr; 19 | 20 | /* 21 | * First, the sub suite is run. This suite has failures which 22 | * are intentional, as the output of the failures is checked 23 | * in check_check_master.c. However, here we do not check if 24 | * the failures are expected. Instead, we just want to run 25 | * them and see if they leak. Because of this, the result 26 | * of the suite is not checked. 27 | */ 28 | sr = srunner_create(make_sub_suite()); 29 | /* 30 | * Enable all logging types, just in case one of them 31 | * leaks memory. 32 | */ 33 | srunner_set_log (sr, "test_mem_leak.log"); 34 | srunner_set_xml (sr, "test_mem_leak.xml"); 35 | srunner_set_tap (sr, "test_mem_leak.tap"); 36 | srunner_run_all(sr, CK_NORMAL); 37 | srunner_free(sr); 38 | 39 | /* Now, the other suite is run. These are all expected to pass. */ 40 | 41 | /* The following setup is necessary for the fork suite */ 42 | fork_setup(); 43 | 44 | sr = srunner_create (make_log_suite()); 45 | srunner_add_suite(sr, make_fork_suite()); 46 | 47 | #if defined(HAVE_FORK) && HAVE_FORK==1 48 | srunner_add_suite(sr, make_exit_suite()); 49 | #endif 50 | 51 | srunner_add_suite(sr, make_selective_suite()); 52 | 53 | /* 54 | * Enable all logging types, just in case one of them 55 | * leaks memory. 56 | */ 57 | srunner_set_log (sr, "test_mem_leak.log"); 58 | srunner_set_xml (sr, "test_mem_leak.xml"); 59 | srunner_set_tap (sr, "test_mem_leak.tap"); 60 | 61 | srunner_run_all(sr, CK_NORMAL); 62 | 63 | /* Cleanup from the fork suite setup */ 64 | fork_teardown(); 65 | 66 | n = srunner_ntests_failed(sr); 67 | srunner_free(sr); 68 | return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 69 | } 70 | 71 | -------------------------------------------------------------------------------- /deps/check-0.10.0/src/check_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Check: a unit test framework for C 3 | * Copyright (C) 2001,2002 Arien Malec 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef CHECK_LOG_H 22 | #define CHECK_LOG_H 23 | 24 | void log_srunner_start(SRunner * sr); 25 | void log_srunner_end(SRunner * sr); 26 | void log_suite_start(SRunner * sr, Suite * s); 27 | void log_suite_end(SRunner * sr, Suite * s); 28 | void log_test_end(SRunner * sr, TestResult * tr); 29 | void log_test_start(SRunner * sr, TCase * tc, TF * tfun); 30 | 31 | void stdout_lfun(SRunner * sr, FILE * file, enum print_output, 32 | void *obj, enum cl_event evt); 33 | 34 | void lfile_lfun(SRunner * sr, FILE * file, enum print_output, 35 | void *obj, enum cl_event evt); 36 | 37 | void xml_lfun(SRunner * sr, FILE * file, enum print_output, 38 | void *obj, enum cl_event evt); 39 | 40 | void tap_lfun(SRunner * sr, FILE * file, enum print_output, 41 | void *obj, enum cl_event evt); 42 | 43 | void subunit_lfun(SRunner * sr, FILE * file, enum print_output, 44 | void *obj, enum cl_event evt); 45 | 46 | void srunner_register_lfun(SRunner * sr, FILE * lfile, int close, 47 | LFun lfun, enum print_output); 48 | 49 | FILE *srunner_open_lfile(SRunner * sr); 50 | FILE *srunner_open_xmlfile(SRunner * sr); 51 | FILE *srunner_open_tapfile(SRunner * sr); 52 | void srunner_init_logging(SRunner * sr, enum print_output print_mode); 53 | void srunner_end_logging(SRunner * sr); 54 | 55 | #endif /* CHECK_LOG_H */ 56 | -------------------------------------------------------------------------------- /deps/check-0.10.0/src/check_error.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Check: a unit test framework for C 3 | * Copyright (C) 2001, 2002 Arien Malec 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #include "../lib/libcompat.h" 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include "check_error.h" 31 | 32 | /** 33 | * Storage for setjmp/longjmp context information used in NOFORK mode 34 | */ 35 | jmp_buf error_jmp_buffer; 36 | 37 | 38 | /* FIXME: including a colon at the end is a bad way to indicate an error */ 39 | void eprintf(const char *fmt, const char *file, int line, ...) 40 | { 41 | va_list args; 42 | 43 | fflush(stderr); 44 | 45 | fprintf(stderr, "%s:%d: ", file, line); 46 | va_start(args, line); 47 | vfprintf(stderr, fmt, args); 48 | va_end(args); 49 | 50 | /*include system error information if format ends in colon */ 51 | if(fmt[0] != '\0' && fmt[strlen(fmt) - 1] == ':') 52 | fprintf(stderr, " %s", strerror(errno)); 53 | fprintf(stderr, "\n"); 54 | 55 | exit(2); 56 | } 57 | 58 | void *emalloc(size_t n) 59 | { 60 | void *p; 61 | 62 | p = malloc(n); 63 | if(p == NULL) 64 | eprintf("malloc of %u bytes failed:", __FILE__, __LINE__ - 2, n); 65 | return p; 66 | } 67 | 68 | void *erealloc(void *ptr, size_t n) 69 | { 70 | void *p; 71 | 72 | p = realloc(ptr, n); 73 | if(p == NULL) 74 | eprintf("realloc of %u bytes failed:", __FILE__, __LINE__ - 2, n); 75 | return p; 76 | } 77 | -------------------------------------------------------------------------------- /sinks/cloudwatch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Cloudwatch sink. 4 | # Requires aws cli tools: https://aws.amazon.com/cli/. 5 | # Cloudwatch needs the following things: 6 | # * Namespace 7 | # * Metricname 8 | # and optionally 9 | # * Dimensions. 10 | # These three things are parsed out of the key like that: 11 | # Namespace:Metricname[:DimensionKey=DimensionValue]* 12 | # 13 | # The dimension InstanceId is added automatically if the command ec2metadata is 14 | # available. The colon is a special character if this sink is used and should 15 | # only be used to seperate the fields as described. 16 | 17 | command -v aws &> /dev/null 18 | if [[ "$?" != 0 ]]; then 19 | echo "aws cli missing." 1>&2 20 | exit 0 21 | fi 22 | 23 | OIFS=$IFS 24 | while read line 25 | do 26 | # line format: key|val|timestamp\n 27 | if [[ -z $line ]]; then continue; fi 28 | 29 | # splitting it at | 30 | IFS='|' 31 | arr=($line); origkey=${arr[0]}; value=${arr[1]}; timestamp=${arr[2]} 32 | 33 | # extracting namespace, metricname and dimensions 34 | namespace=` echo $origkey | cut -d ':' -f 1` 35 | key=` echo $origkey | cut -d ':' -f 2` 36 | dimensions=`echo $origkey | cut -d ':' -f 3-` 37 | 38 | if [[ -z $namespace || -z $key || -z $timestamp ]]; then 39 | echo "namespace, key or timestamp missing: $line" 1>&2 40 | continue 41 | fi 42 | 43 | # generate json payload 44 | json="\"MetricName\": \"$key\"" 45 | json="$json, \"Value\": $value" 46 | json="$json, \"Timestamp\": $timestamp" 47 | 48 | # add dimensions 49 | IFS=':' 50 | 51 | dimensions_json="" 52 | # add instance_id to dimensions if available 53 | command -v ec2metadata &> /dev/null 54 | if [[ "$?" == 0 ]]; then 55 | instance_id=`ec2metadata | awk '/instance-id.*/ { print $2 }'` 56 | dimensions_json="{\"Name\": \"InstanceId\", \"Value\": \"$instance_id\"}" 57 | fi 58 | 59 | for d in $dimensions; do 60 | dk=`echo $d | cut -d '=' -f 1` 61 | dv=`echo $d | cut -d '=' -f 2` 62 | if [[ ! -z "$dimensions_json" ]]; then dimensions_json+=","; fi 63 | dimensions_json="$dimensions_json{\"Name\": \"$dk\", \"Value\": \"$dv\"}" 64 | done 65 | 66 | json="[{$json, \"Dimensions\":[$dimensions_json]}]" 67 | 68 | aws cloudwatch put-metric-data --namespace $namespace --metric-data "$json" 69 | done 70 | IFS=$OIFS 71 | 72 | exit 0 73 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/cmake/FindCheck.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find the CHECK libraries 2 | # Once done this will define 3 | # 4 | # CHECK_FOUND - system has check 5 | # CHECK_INCLUDE_DIR - the check include directory 6 | # CHECK_LIBRARIES - check library 7 | # 8 | # This configuration file for finding libcheck is originally from 9 | # the opensync project. The originally was downloaded from here: 10 | # opensync.org/browser/branches/3rd-party-cmake-modules/modules/FindCheck.cmake 11 | # 12 | # Copyright (c) 2007 Daniel Gollub 13 | # Copyright (c) 2007 Bjoern Ricks 14 | # 15 | # Redistribution and use is allowed according to the terms of the New 16 | # BSD license. 17 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 18 | 19 | 20 | INCLUDE( FindPkgConfig ) 21 | 22 | # Take care about check.pc settings 23 | PKG_SEARCH_MODULE( CHECK check ) 24 | 25 | # Look for CHECK include dir and libraries 26 | IF( NOT CHECK_FOUND ) 27 | IF ( CHECK_INSTALL_DIR ) 28 | MESSAGE ( STATUS "Using override CHECK_INSTALL_DIR to find check" ) 29 | SET ( CHECK_INCLUDE_DIR "${CHECK_INSTALL_DIR}/include" ) 30 | SET ( CHECK_INCLUDE_DIRS "${CHECK_INCLUDE_DIR}" ) 31 | FIND_LIBRARY( CHECK_LIBRARY NAMES check PATHS "${CHECK_INSTALL_DIR}/lib" ) 32 | FIND_LIBRARY( COMPAT_LIBRARY NAMES compat PATHS "${CHECK_INSTALL_DIR}/lib" ) 33 | SET ( CHECK_LIBRARIES "${CHECK_LIBRARY}" "${COMPAT_LIBRARY}" ) 34 | ELSE ( CHECK_INSTALL_DIR ) 35 | FIND_PATH( CHECK_INCLUDE_DIR check.h ) 36 | FIND_LIBRARY( CHECK_LIBRARIES NAMES check ) 37 | ENDIF ( CHECK_INSTALL_DIR ) 38 | 39 | IF ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES ) 40 | SET( CHECK_FOUND 1 ) 41 | IF ( NOT Check_FIND_QUIETLY ) 42 | MESSAGE ( STATUS "Found CHECK: ${CHECK_LIBRARIES}" ) 43 | ENDIF ( NOT Check_FIND_QUIETLY ) 44 | ELSE ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES ) 45 | IF ( Check_FIND_REQUIRED ) 46 | MESSAGE( FATAL_ERROR "Could NOT find CHECK" ) 47 | ELSE ( Check_FIND_REQUIRED ) 48 | IF ( NOT Check_FIND_QUIETLY ) 49 | MESSAGE( STATUS "Could NOT find CHECK" ) 50 | ENDIF ( NOT Check_FIND_QUIETLY ) 51 | ENDIF ( Check_FIND_REQUIRED ) 52 | ENDIF ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES ) 53 | ENDIF( NOT CHECK_FOUND ) 54 | 55 | # Hide advanced variables from CMake GUIs 56 | MARK_AS_ADVANCED( CHECK_INCLUDE_DIR CHECK_LIBRARIES ) 57 | 58 | -------------------------------------------------------------------------------- /src/radix.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This modules implements a radix tree. 3 | * We use this for fast longest-prefix matching. 4 | * 5 | * It is not particularly space efficient as each of 6 | * the nodes are quite large, but it is suitable for the 7 | * small number of patterns that are needed for 8 | * histograms. 9 | * 10 | */ 11 | 12 | #ifndef RADIX_H 13 | #define RADIX_H 14 | 15 | typedef struct { 16 | char *key; 17 | void *value; 18 | } radix_leaf; 19 | 20 | typedef struct radix_node { 21 | char *key; 22 | int key_len; 23 | void *edges[256]; 24 | } radix_node; 25 | 26 | typedef struct { 27 | radix_node root; 28 | } radix_tree; 29 | 30 | /** 31 | * Initializes the radix tree 32 | * @arg tree The tree to initialize 33 | * @return 0 on success 34 | */ 35 | int radix_init(radix_tree *tree); 36 | 37 | /** 38 | * Destroys the tree 39 | * @arg tree The tree to destroy 40 | * @return 0 on success 41 | */ 42 | int radix_destroy(radix_tree *tree); 43 | 44 | /** 45 | * Inserts a value into the tree 46 | * @arg t The tree to insert into 47 | * @arg key The key of the value 48 | * @arg value Initially points to the value to insert, replaced 49 | * by the value that was updated if any 50 | * @return 0 if the value was inserted, 1 if the value was updated. 51 | */ 52 | int radix_insert(radix_tree *t, char *key, void **value); 53 | 54 | /** 55 | * Finds a value in the tree 56 | * @arg t The tree to search 57 | * @arg key The key to search 58 | * @arg value The value of the key 59 | * @return 0 if found 60 | */ 61 | int radix_search(radix_tree *t, char *key, void **value); 62 | 63 | /** 64 | * Finds the longest matching prefix 65 | * @arg t The tree to search 66 | * @arg key The key to search 67 | * @arg value The value of the key with the longest prefix 68 | * @return 0 if found 69 | */ 70 | int radix_longest_prefix(radix_tree *t, char *key, void **value); 71 | 72 | /** 73 | * Iterates through all the nodes in the radix tree 74 | * @arg t The tree to iter through 75 | * @arg data Opaque handle passed through to callback 76 | * @arg iter_func A callback function to iterate through. Returns 77 | * non-zero to stop iteration. 78 | * @return 0 on sucess. 1 if the iteration was stopped. 79 | */ 80 | int radix_foreach(radix_tree *t, void *data, int(*iter_func)(void* data, char *key, void *value)); 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /deps/check-0.10.0/lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Check: a unit test framework for C 3 | # Copyright (C) 2011 Mateusz Loskot 4 | # 5 | # This library is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU Lesser General Public 7 | # License as published by the Free Software Foundation; either 8 | # version 2.1 of the License, or (at your option) any later version. 9 | # 10 | # This library is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with this library; if not, write to the 17 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | # Boston, MA 02111-1307, USA. 19 | # 20 | 21 | 22 | set(SOURCES libcompat.c) 23 | 24 | if (NOT HAVE_LIBRT) 25 | set(SOURCES ${SOURCES} clock_gettime.c) 26 | set(SOURCES ${SOURCES} timer_create.c) 27 | set(SOURCES ${SOURCES} timer_delete.c) 28 | set(SOURCES ${SOURCES} timer_settime.c) 29 | endif(NOT HAVE_LIBRT) 30 | 31 | if(NOT HAVE_GETLINE) 32 | set(SOURCES ${SOURCES} getline.c) 33 | endif(NOT HAVE_GETLINE) 34 | 35 | if(NOT HAVE_GETTIMEOFDAY) 36 | set(SOURCES ${SOURCES} gettimeofday.c) 37 | endif(NOT HAVE_GETTIMEOFDAY) 38 | 39 | if(NOT HAVE_DECL_LOCALTIME_R) 40 | set(SOURCES ${SOURCES} localtime_r.c) 41 | endif(NOT HAVE_DECL_LOCALTIME_R) 42 | 43 | if(NOT HAVE_MALLOC) 44 | set(SOURCES ${SOURCES} malloc.c) 45 | endif(NOT HAVE_MALLOC) 46 | 47 | if(NOT HAVE_REALLOC) 48 | set(SOURCES ${SOURCES} realloc.c) 49 | endif(NOT HAVE_REALLOC) 50 | 51 | if(NOT HAVE_SNPRINTF) 52 | set(SOURCES ${SOURCES} snprintf.c) 53 | endif(NOT HAVE_SNPRINTF) 54 | 55 | if(NOT HAVE_DECL_STRDUP AND NOT HAVE__STRDUP) 56 | set(SOURCES ${SOURCES} strdup.c) 57 | endif(NOT HAVE_DECL_STRDUP AND NOT HAVE__STRDUP) 58 | 59 | if(NOT HAVE_DECL_STRSIGNAL) 60 | set(SOURCES ${SOURCES} strsignal.c) 61 | endif(NOT HAVE_DECL_STRSIGNAL) 62 | 63 | 64 | set(HEADERS libcompat.h) 65 | 66 | add_library(compat STATIC ${SOURCES} ${HEADERS}) 67 | 68 | install(TARGETS compat 69 | RUNTIME DESTINATION bin 70 | LIBRARY DESTINATION lib 71 | ARCHIVE DESTINATION lib) 72 | 73 | install(FILES ${CMAKE_BINARY_DIR}/lib/libcompat.h DESTINATION include) 74 | -------------------------------------------------------------------------------- /src/hashmap.h: -------------------------------------------------------------------------------- 1 | #ifndef HASHMAP_H 2 | #define HASHMAP_H 3 | 4 | /** 5 | * Opaque hashmap reference 6 | */ 7 | typedef struct hashmap hashmap; 8 | typedef int(*hashmap_callback)(void *data, const char *key, void *value); 9 | 10 | /** 11 | * Creates a new hashmap and allocates space for it. 12 | * @arg initial_size The minimim initial size. 0 for default (64). 13 | * @arg map Output. Set to the address of the map 14 | * @return 0 on success. 15 | */ 16 | int hashmap_init(int initial_size, hashmap **map); 17 | 18 | /** 19 | * Destroys a map and cleans up all associated memory 20 | * @arg map The hashmap to destroy. Frees memory. 21 | */ 22 | int hashmap_destroy(hashmap *map); 23 | 24 | /** 25 | * Returns the size of the hashmap in items 26 | */ 27 | int hashmap_size(hashmap *map); 28 | 29 | /** 30 | * Gets a value. 31 | * @arg key The key to look for. Must be null terminated. 32 | * @arg value Output. Set to the value of th key. 33 | * 0 on success. -1 if not found. 34 | */ 35 | int hashmap_get(hashmap *map, char *key, void **value); 36 | 37 | /** 38 | * Puts a key/value pair. 39 | * @arg key The key to set. This is copied, and a seperate 40 | * version is owned by the hashmap. The caller the key at will. 41 | * @notes This method is not thread safe. 42 | * @arg key_len The key length 43 | * @arg value The value to set. 44 | * 0 if updated, 1 if added. 45 | */ 46 | int hashmap_put(hashmap *map, char *key, void *value); 47 | 48 | /** 49 | * Deletes a key/value pair. 50 | * @notes This method is not thread safe. 51 | * @arg key The key to delete 52 | * @arg key_len The key length 53 | * 0 on success. -1 if not found. 54 | */ 55 | int hashmap_delete(hashmap *map, char *key); 56 | 57 | /** 58 | * Clears all the key/value pairs. 59 | * @notes This method is not thread safe. 60 | * 0 on success. -1 if not found. 61 | */ 62 | int hashmap_clear(hashmap *map); 63 | 64 | /** 65 | * Iterates through the key/value pairs in the map, 66 | * invoking a callback for each. The call back gets a 67 | * key, value for each and returns an integer stop value. 68 | * If the callback returns 1, then the iteration stops. 69 | * @arg map The hashmap to iterate over 70 | * @arg cb The callback function to invoke 71 | * @arg data Opaque handle passed to the callback 72 | * @return 0 on success, or the return of the callback. 73 | */ 74 | int hashmap_iter(hashmap *map, hashmap_callback cb, void *data); 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /deps/inih/.deps/ini.Plo: -------------------------------------------------------------------------------- 1 | deps/inih/ini.lo: deps/inih/ini.c /usr/include/stdc-predef.h \ 2 | /usr/include/stdio.h /usr/include/features.h \ 3 | /usr/include/x86_64-linux-gnu/sys/cdefs.h \ 4 | /usr/include/x86_64-linux-gnu/bits/wordsize.h \ 5 | /usr/include/x86_64-linux-gnu/gnu/stubs.h \ 6 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ 7 | /usr/lib/gcc/x86_64-linux-gnu/4.9/include/stddef.h \ 8 | /usr/include/x86_64-linux-gnu/bits/types.h \ 9 | /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ 10 | /usr/include/_G_config.h /usr/include/wchar.h \ 11 | /usr/lib/gcc/x86_64-linux-gnu/4.9/include/stdarg.h \ 12 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ 13 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ 14 | /usr/include/x86_64-linux-gnu/bits/stdio.h /usr/include/ctype.h \ 15 | /usr/include/endian.h /usr/include/x86_64-linux-gnu/bits/endian.h \ 16 | /usr/include/x86_64-linux-gnu/bits/byteswap.h \ 17 | /usr/include/x86_64-linux-gnu/bits/byteswap-16.h /usr/include/xlocale.h \ 18 | /usr/include/string.h /usr/include/x86_64-linux-gnu/bits/string.h \ 19 | /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/stdlib.h \ 20 | deps/inih/ini.h 21 | 22 | /usr/include/stdc-predef.h: 23 | 24 | /usr/include/stdio.h: 25 | 26 | /usr/include/features.h: 27 | 28 | /usr/include/x86_64-linux-gnu/sys/cdefs.h: 29 | 30 | /usr/include/x86_64-linux-gnu/bits/wordsize.h: 31 | 32 | /usr/include/x86_64-linux-gnu/gnu/stubs.h: 33 | 34 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h: 35 | 36 | /usr/lib/gcc/x86_64-linux-gnu/4.9/include/stddef.h: 37 | 38 | /usr/include/x86_64-linux-gnu/bits/types.h: 39 | 40 | /usr/include/x86_64-linux-gnu/bits/typesizes.h: 41 | 42 | /usr/include/libio.h: 43 | 44 | /usr/include/_G_config.h: 45 | 46 | /usr/include/wchar.h: 47 | 48 | /usr/lib/gcc/x86_64-linux-gnu/4.9/include/stdarg.h: 49 | 50 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h: 51 | 52 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h: 53 | 54 | /usr/include/x86_64-linux-gnu/bits/stdio.h: 55 | 56 | /usr/include/ctype.h: 57 | 58 | /usr/include/endian.h: 59 | 60 | /usr/include/x86_64-linux-gnu/bits/endian.h: 61 | 62 | /usr/include/x86_64-linux-gnu/bits/byteswap.h: 63 | 64 | /usr/include/x86_64-linux-gnu/bits/byteswap-16.h: 65 | 66 | /usr/include/xlocale.h: 67 | 68 | /usr/include/string.h: 69 | 70 | /usr/include/x86_64-linux-gnu/bits/string.h: 71 | 72 | /usr/include/x86_64-linux-gnu/bits/string2.h: 73 | 74 | /usr/include/stdlib.h: 75 | 76 | deps/inih/ini.h: 77 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/multiple_everything/x_output: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE. Generated by checkmk. 3 | * Edit the original source file "in" instead. 4 | */ 5 | 6 | #include 7 | 8 | #line 1 "in" 9 | /* Multiple everything... */ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | void print_message(const char *msg, size_t msgsz) 16 | { 17 | int nc; 18 | 19 | nc = printf("%s", msg); 20 | fail_unless(nc == msgsz, "failed to print completely: %s", 21 | strerror(errno)); 22 | } 23 | 24 | 25 | 26 | START_TEST(hello_world) 27 | { 28 | #line 21 29 | const char msg[] = "Hello, world!\n"; 30 | print_message(msg, sizeof msg - 1); 31 | 32 | } 33 | END_TEST 34 | 35 | START_TEST(neverending_story) 36 | { 37 | #line 25 38 | const char msg[] = "Bastian Balthazar Bux\n"; 39 | print_message(msg, sizeof msg - 1); 40 | 41 | } 42 | END_TEST 43 | 44 | START_TEST(math_problem) 45 | { 46 | #line 31 47 | fail_unless(1 + 1 == 2, "Something's broken..."); 48 | 49 | } 50 | END_TEST 51 | 52 | 53 | START_TEST(more_math) 54 | { 55 | #line 38 56 | fail_unless(2/2 == 1, "Another weird math result"); 57 | 58 | } 59 | END_TEST 60 | 61 | START_TEST(weave) 62 | { 63 | #line 43 64 | int i; 65 | const char msg[] = "###\n"; 66 | 67 | for (i=0; i != 3; ++i) 68 | print_message(row, sizeof row - 1); 69 | } 70 | END_TEST 71 | 72 | int main(void) 73 | { 74 | Suite *s1 = suite_create("A Suite"); 75 | TCase *tc1_1 = tcase_create("A Test Case"); 76 | TCase *tc1_2 = tcase_create("Another Test Case"); 77 | Suite *s2 = suite_create("Another Suite"); 78 | TCase *tc2_1 = tcase_create("A Test Case for Another Suite"); 79 | TCase *tc2_2 = tcase_create("A Basket Case"); 80 | SRunner *sr = srunner_create(s1); 81 | int nf; 82 | 83 | suite_add_tcase(s1, tc1_1); 84 | tcase_add_test(tc1_1, hello_world); 85 | tcase_add_test(tc1_1, neverending_story); 86 | suite_add_tcase(s1, tc1_2); 87 | tcase_add_test(tc1_2, math_problem); 88 | suite_add_tcase(s2, tc2_1); 89 | tcase_add_test(tc2_1, more_math); 90 | suite_add_tcase(s2, tc2_2); 91 | tcase_add_test(tc2_2, weave); 92 | 93 | srunner_add_suite(sr, s2); 94 | 95 | srunner_run_all(sr, CK_ENV); 96 | nf = srunner_ntests_failed(sr); 97 | srunner_free(sr); 98 | 99 | return nf == 0 ? 0 : 1; 100 | } 101 | -------------------------------------------------------------------------------- /src/streaming.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "streaming.h" 6 | 7 | // Struct to hold the callback info 8 | struct callback_info { 9 | FILE *f; 10 | void *data; 11 | stream_callback cb; 12 | }; 13 | 14 | /** 15 | * Local callback that invokes the user specified callback with the pip 16 | */ 17 | static int stream_cb(void *data, metric_type type, char *name, void *val) { 18 | struct callback_info *info = data; 19 | return info->cb(info->f, info->data, type, name, val); 20 | } 21 | 22 | /** 23 | * Streams the metrics stored in a metrics object to an external command 24 | * @arg m The metrics object to stream 25 | * @arg data An opaque handle passed to the callback 26 | * @arg cb The callback to invoke 27 | * @arg cmd The command to invoke, invoked with a shell. 28 | * @return 0 on success, or the value of stream callback. 29 | */ 30 | int stream_to_command(metrics *m, void *data, stream_callback cb, char *cmd) { 31 | // Create a pipe to the child 32 | int filedes[2] = {0, 0}; 33 | int res = pipe(filedes); 34 | if (res < 0) return res; 35 | 36 | // Fork and exec 37 | int status = 0; 38 | pid_t pid = fork(); 39 | if (pid < 0) return res; 40 | 41 | // Check if we are the child 42 | if (pid == 0) { 43 | // Set stdin to the pipe 44 | if (dup2(filedes[0], STDIN_FILENO)){ 45 | perror("Failed to initialize stdin!"); 46 | exit(250); 47 | } 48 | close(filedes[1]); 49 | 50 | // Try to run the command 51 | res = execl("/bin/sh", "sh", "-c", cmd, NULL); 52 | if (res != 0) perror("Failed to execute command!"); 53 | 54 | // Always exit 55 | exit(255); 56 | } else { 57 | // Close the read end 58 | close(filedes[0]); 59 | waitpid(pid, &status, WNOHANG); 60 | } 61 | 62 | // Create a file wrapper 63 | FILE *f = fdopen(filedes[1], "w"); 64 | 65 | // Wrap the relevant pointers 66 | struct callback_info info = {f, data, cb}; 67 | 68 | // Start iterating 69 | metrics_iter(m, &info, stream_cb); 70 | 71 | // Close everything out 72 | fclose(f); 73 | close(filedes[1]); 74 | 75 | // Wait for termination 76 | do { 77 | if (waitpid(pid, &status, 0) < 0) break; 78 | usleep(100000); 79 | } while (!WIFEXITED(status)); 80 | 81 | // Return the result of the process 82 | return WEXITSTATUS(status); 83 | } 84 | 85 | -------------------------------------------------------------------------------- /deps/check-0.10.0/xml/check_unittest.xslt: -------------------------------------------------------------------------------- 1 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | Test results 17 |

18 | 19 | 20 | 21 |

Unittests

22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Test suite 32 | 33 | 34 | Path 35 | Filename 36 | Test ID 37 | Iteration 38 | Duration 39 | Description 40 | Message 41 | 42 | 43 | 44 | 45 | Test ran at: 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 |
82 |
83 | 84 | 85 | 86 | 87 | 88 | 89 | Test duration: seconds 90 | 91 | 92 |
93 | 94 | -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/README: -------------------------------------------------------------------------------- 1 | This is the "money example" from the Check tutorial. 2 | 3 | This demonstrates using Check along with one of two build systems: 4 | autotools and CMake. 5 | 6 | ======================== 7 | Autotools: 8 | 9 | You need the following programs installed on your system: 10 | -- Autoconf 2.59 11 | -- Automake 1.9.6 12 | -- Libtool 1.5.22 13 | -- Check 0.9.9 14 | 15 | Somewhat earlier versions of these programs might work. 16 | 17 | Then, do as follows: 18 | 19 | $ autoreconf --install 20 | $ ./configure 21 | $ make 22 | $ make check 23 | 24 | Don't do "make install" unless you want to install the money example. 25 | 26 | money.c and money.h are built as a library. src/main.c:main() is a 27 | client of libmoney.la, just as tests/check_money.c:main() is a client 28 | of libmoney.la 29 | 30 | To use the autotools example in another project, start with the following 31 | files: 32 | 33 | example 34 | |--- configure.ac 35 | |--- Makefile.am 36 | |--- src 37 | | |--- Makefile.am 38 | |--- tests 39 | |--- Makefile.am 40 | 41 | Please send bug reports to check-devel AT lists.sourceforge.net. 42 | 43 | ======================== 44 | CMake: 45 | 46 | You need the following programs installed on your system: 47 | -- CMake 2.8 48 | -- Check 0.9.9 49 | -- (pkg-config 0.26 is optional) 50 | 51 | Somewhat earlier versions of these programs might work. 52 | 53 | NOTE: If pkg-config is not installed on the system, and MSVC is being used, 54 | the install location of Check must be inserted manually into the 55 | tests/CMakeLists.txt file, by setting the variable CHECK_INSTALL_DIR 56 | to the install location. Look at the tests/CMakeLists.txt file for 57 | a commented out example. 58 | 59 | Then, do as follows for a Unix-compatible shell: 60 | 61 | $ cmake . 62 | $ make 63 | $ make test 64 | 65 | or the following for MSVC: 66 | 67 | $ cmake -G "NMake Makefiles" . 68 | $ nmake 69 | $ nmake test 70 | 71 | Don't do "make install" or "nmake install" unless you want to install the money example. 72 | 73 | money.c and money.h are built as a library. src/main.c:main() is a 74 | client of libmoney.la, just as tests/check_money.c:main() is a client 75 | of libmoney.la 76 | 77 | To use the CMake example in another project, start with the following files: 78 | 79 | example 80 | |--- CMakeFiles.txt 81 | |--- cmake 82 | | |--- config.h.in 83 | | |--- FindCheck.cmake 84 | |--- src 85 | | |--- CMakeFiles.txt 86 | |--- tests 87 | |--- CMakeFiles.txt 88 | 89 | Please send bug reports to check-devel AT lists.sourceforge.net. 90 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | 5 | ## Set the version in both instances below here: 6 | AC_INIT([Statsite], [0.8.0]) 7 | 8 | STATSITE_MAJOR_VERSION=0 9 | STATSITE_MINOR_VERSION=8 10 | STATSITE_MICRO_VERSION=0 11 | STATSITE_VERSION=$STATSITE_MAJOR_VERSION.$STATSITE_MINOR_VERSION.$STATSITE_MICRO_VERSION 12 | 13 | 14 | 15 | # place to put some extra build scripts installed 16 | AC_CONFIG_AUX_DIR([ac_config]) 17 | 18 | # place where extra autoconf macros are kept 19 | AC_CONFIG_MACRO_DIR([m4]) 20 | 21 | # define things like _GNU_SOURCE appropriately 22 | AC_USE_SYSTEM_EXTENSIONS 23 | 24 | 25 | AC_CONFIG_SRCDIR([src/statsite.c]) 26 | AC_CONFIG_HEADERS([src/buildconfig.h]) 27 | 28 | # Checks for programs. 29 | AC_PROG_CXX 30 | AC_PROG_AWK 31 | AC_PROG_CC 32 | AC_PROG_CPP 33 | AC_PROG_INSTALL 34 | AC_PROG_LN_S 35 | AC_PROG_MAKE_SET 36 | # Automake wants this for per-target CFLAGS 37 | AC_PROG_INSTALL 38 | AC_PROG_LN_S 39 | 40 | 41 | # Check if we have librt 42 | AC_CHECK_LIB([rt], [clock_gettime], [LINK_TO_RT=-lrt], [LINK_TO_RT=]) 43 | 44 | 45 | Checks for header files. 46 | AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stdint.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h]) 47 | 48 | # Checks for typedefs, structures, and compiler characteristics. 49 | #AC_CHECK_HEADER_STDBOOL # - this seems to be archived 50 | AC_C_INLINE 51 | AC_TYPE_INT8_T 52 | AC_TYPE_PID_T 53 | AC_TYPE_SIZE_T 54 | AC_TYPE_SSIZE_T 55 | AC_TYPE_UINT16_T 56 | AC_TYPE_UINT32_T 57 | AC_TYPE_UINT64_T 58 | AC_TYPE_UINT8_T 59 | 60 | # Checks for library functions. 61 | AC_FUNC_ALLOCA 62 | AC_FUNC_FORK 63 | AC_FUNC_MALLOC 64 | AC_FUNC_REALLOC 65 | AC_FUNC_STRTOD 66 | AC_CHECK_FUNCS([bzero dup2 getpagesize gettimeofday inet_ntoa memchr memset pow select socket sqrt strcasecmp strdup strerror strncasecmp strtol]) 67 | 68 | 69 | # PKG-Config based checks 70 | PKG_CHECK_MODULES([CHECK], [check >= 0.9.7], [have_check="yes"], AC_MSG_WARN([Check not found; cannot run unit tests!])) 71 | 72 | AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes") 73 | 74 | # tests 75 | #TESTS = test_runner 76 | #check_PROGRAMS = test_runner 77 | #test_runner_SOURCES = tests/runner.c $(top_builddir)/tests/runner.h 78 | #test_runner_CFLAGS = @CHECK_CFLAGS@ 79 | 80 | 81 | AM_INIT_AUTOMAKE(foreign subdir-objects) 82 | 83 | # This replaces a few constants we setup previously 84 | AC_SUBST(STATSITE_MAJOR_VERSION) 85 | AC_SUBST(STATSITE_MINOR_VERSION) 86 | AC_SUBST(STATSITE_MICRO_VERSION) 87 | AC_SUBST(STATSITE_VERSION) 88 | AC_SUBST(LINK_TO_RT) 89 | 90 | 91 | 92 | 93 | LT_INIT 94 | 95 | AC_OUTPUT(Makefile man/Makefile) 96 | -------------------------------------------------------------------------------- /sinks/opentsdb.js: -------------------------------------------------------------------------------- 1 | var net = require('net'); 2 | var util = require('util'); 3 | 4 | /* 5 | Put into your statsite config as: 6 | **** 7 | stream_cmd = node sinks/opentsdb.js 127.0.0.1 4242 _t_ 8 | **** 9 | */ 10 | 11 | 12 | if (process.argv.length != 5) 13 | { 14 | console.log('Wrong number of arguments'); 15 | console.log('opentsdbsink.js '); 16 | process.exit(1); 17 | } 18 | var host = process.argv[2]; 19 | var port = process.argv[3]; 20 | var tagprefix = process.argv[4]; 21 | 22 | 23 | // Returns a list of "tagname=tagvalue" strings from the given metric name. 24 | function parse_tags(metric_name) { 25 | var parts = metric_name.split("."); 26 | var tags = []; 27 | var current_tag_name = ""; 28 | for (var i in parts) 29 | { 30 | var p = parts[i]; 31 | if (p.indexOf(tagprefix) == 0) 32 | { 33 | current_tag_name = p.split(tagprefix)[1] 34 | } 35 | else if (current_tag_name != "") 36 | { 37 | tags.push(current_tag_name + "=" + p); 38 | current_tag_name = ""; 39 | } 40 | } 41 | 42 | return tags; 43 | } 44 | 45 | // Strips out all tag information from the given metric name 46 | function strip_tags(metric_name) { 47 | var parts = metric_name.split("."); 48 | var rslt_parts = []; 49 | while (parts.length > 0) 50 | { 51 | if (parts[0].indexOf(tagprefix) == 0) 52 | { 53 | parts.shift(); 54 | parts.shift(); 55 | continue; 56 | } 57 | rslt_parts.push(parts.shift()); 58 | } 59 | 60 | return rslt_parts.join("."); 61 | } 62 | 63 | var data = ''; 64 | 65 | process.stdin.setEncoding('utf8'); 66 | process.stdin.on('readable', function () { 67 | var chunk = process.stdin.read(); 68 | if (chunk !== null) data += chunk 69 | }); 70 | process.stdin.on('end', function () { 71 | var suffix = " source=statsd"; 72 | if (data) 73 | { 74 | data = data.split('\n'); 75 | var tString = ''; 76 | for (var i in data) 77 | { 78 | var mParts = data[i].split('|'); 79 | tString += ('put ' + strip_tags(mParts[0]) + ' ' + mParts[2] + ' ' + mParts[1] + ' ' + parse_tags(mParts[0]).join(' ') + suffix).replace(/\s+/g, ' ') + '\n'; 80 | } 81 | try 82 | { 83 | var opentsdb = net.createConnection(port, host); 84 | opentsdb.on('connect', function () { 85 | this.write(tString); 86 | this.end(); 87 | process.exit(0); 88 | }); 89 | } 90 | catch (e) 91 | { 92 | util.log(e); 93 | process.exit(1); 94 | } 95 | } 96 | }); 97 | -------------------------------------------------------------------------------- /deps/check-0.10.0/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Check: a unit test framework for C 3 | # 4 | # Copyright (C) 2011 Mateusz Loskot 5 | # Copyright (C) 2001, 2002 Arien Malec 6 | # 7 | # This library is free software; you can redistribute it and/or 8 | # modify it under the terms of the GNU Lesser General Public 9 | # License as published by the Free Software Foundation; either 10 | # version 2.1 of the License, or (at your option) any later version. 11 | # 12 | # This library is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | # Lesser General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Lesser General Public 18 | # License along with this library; if not, write to the 19 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | # Boston, MA 02111-1307, USA. 21 | # 22 | 23 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src) 24 | # Enable finding check.h 25 | include_directories(${CMAKE_CURRENT_BINARY_DIR}/../src) 26 | 27 | # For the test_vars.in script, to give the unit test shell script 28 | # runners the location of the source files 29 | set(srcdir "${CMAKE_CURRENT_SOURCE_DIR}") 30 | 31 | if(WIN32) 32 | # CMake uses Unix slashes for everything, but the tests that 33 | # read srcdir expect platform specific slashes. There are two 34 | # slashes because the shell scripts will consume srcdir. 35 | string(REPLACE "/" "\\\\" srcdir "${srcdir}") 36 | set(EXEEXT ".exe") 37 | set(IS_MSVC "1") 38 | endif(WIN32) 39 | 40 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_vars.in 41 | ${CMAKE_CURRENT_SOURCE_DIR}/test_vars) 42 | 43 | set(CHECK_CHECK_SOURCES 44 | check_check_exit.c 45 | check_check_fixture.c 46 | check_check_fork.c 47 | check_check_limit.c 48 | check_check_log.c 49 | check_check_log_internal.c 50 | check_check_main.c 51 | check_check_master.c 52 | check_check_msg.c 53 | check_check_pack.c 54 | check_check_selective.c 55 | check_check_sub.c 56 | check_list.c) 57 | set(CHECK_CHECK_HEADERS check_check.h) 58 | add_executable(check_check ${CHECK_CHECK_HEADERS} ${CHECK_CHECK_SOURCES}) 59 | target_link_libraries(check_check check compat) 60 | 61 | set(EX_OUTPUT_SOURCES ex_output.c) 62 | add_executable(ex_output ${EX_OUTPUT_SOURCES}) 63 | target_link_libraries(ex_output check compat) 64 | 65 | set(CHECK_NOFORK_SOURCES check_nofork.c) 66 | add_executable(check_nofork ${CHECK_NOFORK_SOURCES}) 67 | target_link_libraries(check_nofork check compat) 68 | 69 | set(CHECK_NOFORK_TEARDOWN_SOURCES check_nofork_teardown.c) 70 | add_executable(check_nofork_teardown ${CHECK_NOFORK_TEARDOWN_SOURCES}) 71 | target_link_libraries(check_nofork_teardown check compat) 72 | -------------------------------------------------------------------------------- /src/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef TIMER_H 2 | #define TIMER_H 3 | #include 4 | #include "cm_quantile.h" 5 | 6 | typedef struct { 7 | uint64_t actual_count; // Actual items recieved 8 | uint64_t count; // Count of items (1 / sample rate) 9 | double sum; // Sum of the values 10 | double squared_sum; // Sum of the squared values 11 | int finalized; // Is the cm_quantile finalized 12 | cm_quantile cm; // Quantile we use 13 | } timer; 14 | 15 | /** 16 | * Initializes the timer struct 17 | * @arg eps The maximum error for the quantiles 18 | * @arg quantiles A sorted array of double quantile values, must be on (0, 1) 19 | * @arg num_quants The number of entries in the quantiles array 20 | * @arg timeer The timer struct to initialize 21 | * @return 0 on success. 22 | */ 23 | int init_timer(double eps, double *quantiles, uint32_t num_quants, timer *timer); 24 | 25 | /** 26 | * Destroy the timer struct. 27 | * @arg timer The timer to destroy 28 | * @return 0 on success. 29 | */ 30 | int destroy_timer(timer *timer); 31 | 32 | /** 33 | * Adds a new sample to the struct 34 | * @arg timer The timer to add to 35 | * @arg sample The new sample value 36 | * @return 0 on success. 37 | */ 38 | int timer_add_sample(timer *timer, double sample, double sample_rate); 39 | 40 | /** 41 | * Queries for a quantile value 42 | * @arg timer The timer to query 43 | * @arg quantile The quantile to query 44 | * @return The value on success or 0. 45 | */ 46 | double timer_query(timer *timer, double quantile); 47 | 48 | /** 49 | * Returns the number of samples in the timer 50 | * @arg timer The timer to query 51 | * @return The number of samples 52 | */ 53 | uint64_t timer_count(timer *timer); 54 | 55 | /** 56 | * Returns the minimum timer value 57 | * @arg timer The timer to query 58 | * @return The number of samples 59 | */ 60 | double timer_min(timer *timer); 61 | 62 | /** 63 | * Returns the mean timer value 64 | * @arg timer The timer to query 65 | * @return The mean value 66 | */ 67 | double timer_mean(timer *timer); 68 | 69 | /** 70 | * Returns the sample standard deviation timer value 71 | * @arg timer The timer to query 72 | * @return The sample standard deviation 73 | */ 74 | double timer_stddev(timer *timer); 75 | 76 | /** 77 | * Returns the sum of the timer 78 | * @arg timer The timer to query 79 | * @return The sum of values 80 | */ 81 | double timer_sum(timer *timer); 82 | 83 | /** 84 | * Returns the sum squared of the timer 85 | * @arg timer The timer to query 86 | * @return The sum squared of values 87 | */ 88 | double timer_squared_sum(timer *timer); 89 | 90 | /** 91 | * Returns the maximum timer value 92 | * @arg timer The timer to query 93 | * @return The maximum value 94 | */ 95 | double timer_max(timer *timer); 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /src/cm_quantile.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This module implements the Cormode-Muthukrishnan algorithm 3 | * for computation of biased quantiles over data streams from 4 | * "Effective Computation of Biased Quantiles over Data Streams" 5 | * 6 | */ 7 | #ifndef CM_QUANTILE_H 8 | #define CM_QUANTILE_H 9 | #include 10 | #include "heap.h" 11 | 12 | typedef struct cm_sample { 13 | double value; // The sampled value 14 | uint64_t width; // The number of ranks represented 15 | uint64_t delta; // Delta between min/max rank 16 | struct cm_sample *next; 17 | struct cm_sample *prev; 18 | } cm_sample; 19 | 20 | struct cm_insert_cursor { 21 | cm_sample *curs; 22 | }; 23 | 24 | struct cm_compress_cursor { 25 | cm_sample *curs; 26 | uint64_t min_rank; 27 | }; 28 | 29 | typedef struct { 30 | double eps; // Desired epsilon 31 | 32 | double *quantiles; // Queryable quantiles, sorted array 33 | uint32_t num_quantiles; // Number of quantiles 34 | 35 | uint64_t num_samples; // Number of samples 36 | uint64_t num_values; // Number of values added 37 | 38 | cm_sample *samples; // Sorted linked list of samples 39 | cm_sample *end; // Pointer to the end of the sampels 40 | heap *bufLess, *bufMore;// Sample buffer 41 | 42 | struct cm_insert_cursor insert; // Insertion cursor 43 | struct cm_compress_cursor compress; // Compression cursor 44 | } cm_quantile; 45 | 46 | 47 | /** 48 | * Initializes the CM quantile struct 49 | * @arg eps The maximum error for the quantiles 50 | * @arg quantiles A sorted array of double quantile values, must be on (0, 1) 51 | * @arg num_quants The number of entries in the quantiles array 52 | * @arg cm_quantile The cm_quantile struct to initialize 53 | * @return 0 on success. 54 | */ 55 | int init_cm_quantile(double eps, double *quantiles, uint32_t num_quants, cm_quantile *cm); 56 | 57 | /** 58 | * Destroy the CM quantile struct. 59 | * @arg cm_quantile The cm_quantile to destroy 60 | * @return 0 on success. 61 | */ 62 | int destroy_cm_quantile(cm_quantile *cm); 63 | 64 | /** 65 | * Adds a new sample to the struct 66 | * @arg cm_quantile The cm_quantile to add to 67 | * @arg sample The new sample value 68 | * @return 0 on success. 69 | */ 70 | int cm_add_sample(cm_quantile *cm, double sample); 71 | 72 | /** 73 | * Queries for a quantile value 74 | * @arg cm_quantile The cm_quantile to query 75 | * @arg quantile The quantile to query 76 | * @return The value on success or 0. 77 | */ 78 | double cm_query(cm_quantile *cm, double quantile); 79 | 80 | /** 81 | * Forces the internal buffers to be flushed, 82 | * this allows query to have maximum accuracy. 83 | * @arg cm_quantile The cm_quantile to add to 84 | * @return 0 on success. 85 | */ 86 | int cm_flush(cm_quantile *cm); 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /deps/check-0.10.0/checkmk/test/argument_ws/in: -------------------------------------------------------------------------------- 1 | #test-exit(0) test1 2 | ck_assert(0 == 0); 3 | #test-exit (1) test2 4 | ck_assert(1 == 0); 5 | #test-exit ( 0) test3 6 | ck_assert(1 == 0); 7 | #test-exit ( +0 ) test4 8 | ck_assert(1 == 0); 9 | #test-exit ( -1 ) test5 10 | ck_assert(1 == 0); 11 | #test-exit ( - 1 ) test6 12 | ck_assert(1 == 0); 13 | #test-exit (- 0 ) test7 14 | ck_assert(1 == 0); 15 | #test-exit ( + 1 ) test8 16 | ck_assert(1 == 0); 17 | 18 | #test-signal(0) test9 19 | ck_assert(0 == 0); 20 | #test-signal (1) test10 21 | ck_assert(1 == 0); 22 | #test-signal ( 0) test11 23 | ck_assert(1 == 0); 24 | #test-signal ( +0 ) test12 25 | ck_assert(1 == 2); 26 | #test-signal ( -1 ) test13 27 | ck_assert(1 == 0); 28 | #test-signal ( - 1 ) test14 29 | ck_assert(1 == 0); 30 | #test-signal (- 0 ) test15 31 | ck_assert(1 == 0); 32 | #test-signal ( + 1 ) test16 33 | ck_assert(1 == 0); 34 | 35 | #test-loop(0,2) test17 36 | ck_assert(0 == 0); 37 | #test-loop (1 ,0) test18 38 | ck_assert(1 == 0); 39 | #test-loop ( 0 , 1) test19 40 | ck_assert(1 == 1); 41 | #test-loop ( +0 , -2) test20 42 | ck_assert(1 == 0); 43 | #test-loop ( -1 ,+ 3) test21 44 | ck_assert(1 == 0); 45 | #test-loop ( - 1, + 2 ) test22 46 | ck_assert(1 == 0); 47 | #test-loop (- 0 , - 2) test23 48 | ck_assert(1 == 0); 49 | #test-loop ( + 1 , - 3 ) test24 50 | ck_assert(1 == 1); 51 | 52 | #test-loop-exit(1,0,2) test25 53 | ck_assert(0 == 1); 54 | #test-loop-exit ( 2,1 ,0) test26 55 | ck_assert(1 == 0); 56 | #test-loop-exit ( 2 ,0 , 1) test27 57 | ck_assert(1 == 0); 58 | #test-loop-exit ( -1 , +0 , -2) test28 59 | ck_assert(1 == 0); 60 | #test-loop-exit ( - 3 , -1 ,+ 3) test29 61 | ck_assert(1 == 1); 62 | #test-loop-exit ( + 0, - 1, + 2 ) test30 63 | ck_assert(1 == 0); 64 | #test-loop-exit (- 4 ,- 0 , - 2) test31 65 | ck_assert(1 == 0); 66 | #test-loop-exit ( +2 , + 1 , - 3 ) test32 67 | ck_assert(1 == 0); 68 | 69 | #test-loop-signal(1,0,2) test33 70 | ck_assert(0 == 0); 71 | #test-loop-signal ( 2,1 ,0) test34 72 | ck_assert(1 == 0); 73 | #test-loop-signal ( 2 ,0 , 1) test35 74 | ck_assert(1 == 1); 75 | #test-loop-signal ( -1 , +0 , -2) test36 76 | ck_assert(1 == 0); 77 | #test-loop-signal ( - 3 , -1 ,+ 3) test37 78 | ck_assert(1 == 0); 79 | #test-loop-signal ( + 0, - 1, + 2 ) test38 80 | ck_assert(1 == 0); 81 | #test-loop-signal (- 4 ,- 0 , - 2) test39 82 | ck_assert(1 == 0); 83 | #test-loop-signal ( +2 , + 1 , - 3 ) test40 84 | ck_assert(1 == 1); -------------------------------------------------------------------------------- /deps/check-0.10.0/doc/example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(money C) 2 | 3 | cmake_minimum_required(VERSION 2.8 FATAL_ERROR) 4 | set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") 5 | 6 | ############################################################################### 7 | # Set build features 8 | set(CMAKE_BUILD_TYPE Debug) 9 | 10 | ############################################################################### 11 | include(CheckCSourceCompiles) 12 | include(CheckCSourceRuns) 13 | include(CheckFunctionExists) 14 | include(CheckIncludeFile) 15 | include(CheckIncludeFiles) 16 | include(CheckLibraryExists) 17 | include(CheckSymbolExists) 18 | include(CheckTypeSize) 19 | 20 | ############################################################################### 21 | # Check headers 22 | set(INCLUDES "") 23 | macro(ck_check_include_file header var) 24 | check_include_files("${INCLUDES};${header}" ${var}) 25 | if(${var}) 26 | set(INCLUDES ${INCLUDES} ${header}) 27 | endif(${var}) 28 | endmacro(ck_check_include_file) 29 | 30 | ck_check_include_file("stdlib.h" HAVE_STDLIB_H) 31 | 32 | ############################################################################### 33 | # Check functions 34 | # (Nothing to check for the money example) 35 | 36 | ############################################################################### 37 | # Check defines 38 | # (Nothing to check for the money example) 39 | 40 | ############################################################################### 41 | # Check struct members 42 | # (Nothing to check for the money example) 43 | 44 | ############################################################################### 45 | # Check for integer types 46 | # (The following are used in check.h. Regardless if they are used in 47 | # the project, they will need to be checked in order to use Check). 48 | check_type_size(intmax_t INTMAX_T) 49 | check_type_size(uintmax_t UINTMAX_T) 50 | 51 | check_type_size(pid_t PID_T) 52 | if(NOT HAVE_PID_T) 53 | if(WIN32) 54 | set(pid_t "int") 55 | else(WIN32) 56 | MESSAGE(FATAL_ERROR "pid_t doesn't exist on this platform?") 57 | endif(WIN32) 58 | endif(NOT HAVE_PID_T) 59 | 60 | ############################################################################### 61 | # Check libraries 62 | 63 | ############################################################################### 64 | # Generate "config.h" from "cmake/config.h.cmake" 65 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.h.in 66 | ${CMAKE_CURRENT_BINARY_DIR}/config.h) 67 | include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) 68 | add_definitions(-DHAVE_CONFIG_H) 69 | set(CONFIG_HEADER ${CMAKE_CURRENT_BINARY_DIR}/config.h) 70 | 71 | ############################################################################### 72 | # Subdirectories 73 | add_subdirectory(src) 74 | add_subdirectory(tests) 75 | 76 | ############################################################################### 77 | # Unit tests 78 | enable_testing() 79 | add_test(NAME check_money COMMAND check_money) 80 | 81 | -------------------------------------------------------------------------------- /deps/check-0.10.0/README: -------------------------------------------------------------------------------- 1 | About Check 2 | ----------- 3 | 4 | Check is a unit testing framework for C. It features a simple interface 5 | for defining unit tests, putting little in the way of the 6 | developer. Tests are run in a separate address space, so Check can 7 | catch both assertion failures and code errors that cause segmentation 8 | faults or other signals. The output from unit tests can be used within 9 | source code editors and IDEs. 10 | 11 | See http://check.sourceforge.net/ for more information, including a 12 | tutorial. The tutorial is also available as `info check'. 13 | 14 | Installation 15 | ------------ 16 | 17 | Check has the following dependencies: 18 | 19 | automake-1.9.6 (1.11.3 on OS X if you are using /usr/bin/ar) 20 | autoconf-2.59 21 | libtool-1.5.22 22 | pkg-config-0.20 23 | texinfo-4.7 (for documentation) 24 | tetex-bin (or any texinfo-compatible TeX installation, for documentation) 25 | POSIX sed 26 | 27 | The versions specified may be higher than those actually needed. 28 | 29 | First, do 30 | 31 | $ autoreconf --install 32 | 33 | in this directory to set everything up. autoreconf calls all of the 34 | necessary tools for you, like autoconf, automake, autoheader, etc. If 35 | you ever change something during development, run autoreconf again 36 | (without --install), and it will perform the minimum set of actions 37 | necessary. 38 | 39 | Then, read the directions in INSTALL if you need more information. 40 | 41 | Linking against Check 42 | --------------------- 43 | 44 | Check uses variadic macros in check.h, and the strict C90 options for 45 | gcc will complain about this. In gcc 4.0 and above you can turn this 46 | off explicitly with -Wno-variadic-macros. In a future API it would be 47 | nice to eliminate these macros. 48 | 49 | Debian rationale for not having upstream build packages (.deb files) 50 | -------------------------------------------------------------------- 51 | 52 | For debian, it is highly undesirable if the upstream source contains a 53 | debian directory as this one will never be the same as the "official" 54 | Debian one, and patching is easier if it's not around. 55 | 56 | Sometimes upstream insists on having the possibility to build Debian 57 | packages themselves, in which case it is best to have a debian 58 | directory in the CVS, but not ship it when doing "make dist". 59 | 60 | Sometimes upstream insists on shipping the debian directory to their 61 | users so these can easily build a .deb, which is really bad because 62 | they usually don't remember to change the Debian changelog and version 63 | accordingly, and generally don't know enough about Debian policy to 64 | make conforming packages. 65 | 66 | So in the end you will have different broken packages compiled on 67 | various systems floating around which all have the same version number 68 | and look like official packages. 69 | 70 | -- Robert Lemmen, 2006 71 | 72 | The same holds for .rpm packages. The Check maintainer for Fedora 73 | Extras, Tom 'spot' Callaway, confirmed that they do not depend on an 74 | upstream rpm target in Check. 75 | --------------------------------------------------------------------------------