├── CMakeLists.txt ├── README.md ├── cmake └── include │ ├── FindPerl2.cmake │ ├── FindRagel.cmake │ ├── GetVariablesFromCMakeDashboards.cmake │ ├── MakefileHelpers.cmake │ ├── UseSwig.cmake │ ├── _cmake_fake_src.cpp │ ├── buildrules.cmake │ ├── codgen.cmake │ ├── compilerinit.cmake │ ├── config.cmake │ ├── deps.cmake │ ├── dtmk.cmake │ ├── fict_exe_source.cpp │ ├── global.cmake │ ├── parseenum.lua │ ├── search_system_type.cmake │ ├── sortpeerlibs.awk │ ├── suffixes.cmake │ ├── svn_info.lua │ ├── tools.cmake │ ├── touch.py │ ├── ut_template.cmake │ └── ysversion.cmake ├── contrib ├── CMakeLists.txt ├── libs │ ├── fastlz │ │ ├── CMakeLists.txt │ │ ├── fastlz.c │ │ ├── fastlz.h │ │ └── rename.h │ ├── libbz2 │ │ ├── CMakeLists.txt │ │ ├── blocksort.c │ │ ├── bzlib.c │ │ ├── bzlib.h │ │ ├── bzlib_private.h │ │ ├── compress.c │ │ ├── crctable.c │ │ ├── decompress.c │ │ ├── gen.sh │ │ ├── huffman.c │ │ ├── randtable.c │ │ └── rename.h │ ├── libiconv │ │ ├── CMakeLists.txt │ │ ├── aliases.gperf │ │ ├── aliases.h │ │ ├── aliases2.h │ │ ├── aliases_aix.h │ │ ├── aliases_aix_sysaix.h │ │ ├── aliases_dos.h │ │ ├── aliases_extra.h │ │ ├── aliases_osf1.h │ │ ├── aliases_osf1_sysosf1.h │ │ ├── aliases_sysaix.gperf │ │ ├── aliases_sysaix.h │ │ ├── aliases_syshpux.gperf │ │ ├── aliases_syshpux.h │ │ ├── aliases_sysosf1.gperf │ │ ├── aliases_sysosf1.h │ │ ├── aliases_syssolaris.gperf │ │ ├── aliases_syssolaris.h │ │ ├── armscii_8.h │ │ ├── ascii.h │ │ ├── atarist.h │ │ ├── big5.h │ │ ├── big5_2003.h │ │ ├── big5hkscs1999.h │ │ ├── big5hkscs2001.h │ │ ├── big5hkscs2004.h │ │ ├── c99.h │ │ ├── canonical.h │ │ ├── canonical_aix.h │ │ ├── canonical_aix_sysaix.h │ │ ├── canonical_dos.h │ │ ├── canonical_extra.h │ │ ├── canonical_local.h │ │ ├── canonical_local_sysaix.h │ │ ├── canonical_local_syshpux.h │ │ ├── canonical_local_sysosf1.h │ │ ├── canonical_local_syssolaris.h │ │ ├── canonical_osf1.h │ │ ├── canonical_osf1_sysosf1.h │ │ ├── canonical_sysaix.h │ │ ├── canonical_syshpux.h │ │ ├── canonical_sysosf1.h │ │ ├── canonical_syssolaris.h │ │ ├── ces_big5.h │ │ ├── ces_gbk.h │ │ ├── charset.alias │ │ ├── cjk_variants.h │ │ ├── cns11643.h │ │ ├── cns11643_1.h │ │ ├── cns11643_15.h │ │ ├── cns11643_2.h │ │ ├── cns11643_3.h │ │ ├── cns11643_4.h │ │ ├── cns11643_4a.h │ │ ├── cns11643_4b.h │ │ ├── cns11643_5.h │ │ ├── cns11643_6.h │ │ ├── cns11643_7.h │ │ ├── cns11643_inv.h │ │ ├── config.h │ │ ├── config.h.in │ │ ├── converters.h │ │ ├── cp1046.h │ │ ├── cp1124.h │ │ ├── cp1125.h │ │ ├── cp1129.h │ │ ├── cp1131.h │ │ ├── cp1133.h │ │ ├── cp1161.h │ │ ├── cp1162.h │ │ ├── cp1163.h │ │ ├── cp1250.h │ │ ├── cp1251.h │ │ ├── cp1252.h │ │ ├── cp1253.h │ │ ├── cp1254.h │ │ ├── cp1255.h │ │ ├── cp1256.h │ │ ├── cp1257.h │ │ ├── cp1258.h │ │ ├── cp437.h │ │ ├── cp737.h │ │ ├── cp775.h │ │ ├── cp850.h │ │ ├── cp852.h │ │ ├── cp853.h │ │ ├── cp855.h │ │ ├── cp856.h │ │ ├── cp857.h │ │ ├── cp858.h │ │ ├── cp860.h │ │ ├── cp861.h │ │ ├── cp862.h │ │ ├── cp863.h │ │ ├── cp864.h │ │ ├── cp865.h │ │ ├── cp866.h │ │ ├── cp869.h │ │ ├── cp874.h │ │ ├── cp922.h │ │ ├── cp932.h │ │ ├── cp932ext.h │ │ ├── cp936.h │ │ ├── cp936ext.h │ │ ├── cp943.h │ │ ├── cp949.h │ │ ├── cp950.h │ │ ├── cp950ext.h │ │ ├── dec_hanyu.h │ │ ├── dec_kanji.h │ │ ├── encodings.def │ │ ├── encodings_aix.def │ │ ├── encodings_dos.def │ │ ├── encodings_extra.def │ │ ├── encodings_local.def │ │ ├── encodings_osf1.def │ │ ├── euc_cn.h │ │ ├── euc_jisx0213.h │ │ ├── euc_jp.h │ │ ├── euc_kr.h │ │ ├── euc_tw.h │ │ ├── flags.h │ │ ├── flushwc.h │ │ ├── gb12345.h │ │ ├── gb12345ext.h │ │ ├── gb18030.h │ │ ├── gb18030ext.h │ │ ├── gb18030uni.h │ │ ├── gb2312.h │ │ ├── gbk.h │ │ ├── gbkext1.h │ │ ├── gbkext2.h │ │ ├── gbkext_inv.h │ │ ├── genaliases.c │ │ ├── genaliases2.c │ │ ├── genflags.c │ │ ├── gentranslit.c │ │ ├── georgian_academy.h │ │ ├── georgian_ps.h │ │ ├── hkscs1999.h │ │ ├── hkscs2001.h │ │ ├── hkscs2004.h │ │ ├── hp_roman8.h │ │ ├── hz.h │ │ ├── iconv.c │ │ ├── iconv.h │ │ ├── iconv_open1.h │ │ ├── iconv_open2.h │ │ ├── iso2022_cn.h │ │ ├── iso2022_cnext.h │ │ ├── iso2022_jp.h │ │ ├── iso2022_jp1.h │ │ ├── iso2022_jp2.h │ │ ├── iso2022_jp3.h │ │ ├── iso2022_kr.h │ │ ├── iso646_cn.h │ │ ├── iso646_jp.h │ │ ├── iso8859_1.h │ │ ├── iso8859_10.h │ │ ├── iso8859_11.h │ │ ├── iso8859_13.h │ │ ├── iso8859_14.h │ │ ├── iso8859_15.h │ │ ├── iso8859_16.h │ │ ├── iso8859_2.h │ │ ├── iso8859_3.h │ │ ├── iso8859_4.h │ │ ├── iso8859_5.h │ │ ├── iso8859_6.h │ │ ├── iso8859_7.h │ │ ├── iso8859_8.h │ │ ├── iso8859_9.h │ │ ├── isoir165.h │ │ ├── isoir165ext.h │ │ ├── java.h │ │ ├── jisx0201.h │ │ ├── jisx0208.h │ │ ├── jisx0212.h │ │ ├── jisx0213.h │ │ ├── johab.h │ │ ├── johab_hangul.h │ │ ├── koi8_r.h │ │ ├── koi8_ru.h │ │ ├── koi8_t.h │ │ ├── koi8_u.h │ │ ├── ksc5601.h │ │ ├── libcharset.h │ │ ├── localcharset.h │ │ ├── loop_unicode.h │ │ ├── loop_wchar.h │ │ ├── loops.h │ │ ├── mac_arabic.h │ │ ├── mac_centraleurope.h │ │ ├── mac_croatian.h │ │ ├── mac_cyrillic.h │ │ ├── mac_greek.h │ │ ├── mac_hebrew.h │ │ ├── mac_iceland.h │ │ ├── mac_roman.h │ │ ├── mac_romania.h │ │ ├── mac_thai.h │ │ ├── mac_turkish.h │ │ ├── mac_ukraine.h │ │ ├── mulelao.h │ │ ├── nextstep.h │ │ ├── pt154.h │ │ ├── relocatable.c │ │ ├── relocatable.h │ │ ├── riscos1.h │ │ ├── rk1048.h │ │ ├── shift_jisx0213.h │ │ ├── sjis.h │ │ ├── tcvn.h │ │ ├── tds565.h │ │ ├── tis620.h │ │ ├── translit.def │ │ ├── translit.h │ │ ├── ucs2.h │ │ ├── ucs2be.h │ │ ├── ucs2internal.h │ │ ├── ucs2le.h │ │ ├── ucs2swapped.h │ │ ├── ucs4.h │ │ ├── ucs4be.h │ │ ├── ucs4internal.h │ │ ├── ucs4le.h │ │ ├── ucs4swapped.h │ │ ├── uhc_1.h │ │ ├── uhc_2.h │ │ ├── utf16.h │ │ ├── utf16be.h │ │ ├── utf16le.h │ │ ├── utf32.h │ │ ├── utf32be.h │ │ ├── utf32le.h │ │ ├── utf7.h │ │ ├── utf8.h │ │ ├── vietcomb.h │ │ └── viscii.h │ ├── lua │ │ ├── CMakeLists.txt │ │ ├── common │ │ │ └── stdlib.lua │ │ ├── lib.cpp │ │ ├── lua-5.1.4 │ │ │ ├── COPYRIGHT │ │ │ ├── src │ │ │ │ ├── lapi.c │ │ │ │ ├── lapi.h │ │ │ │ ├── lauxlib.c │ │ │ │ ├── lauxlib.h │ │ │ │ ├── lbaselib.c │ │ │ │ ├── lcode.c │ │ │ │ ├── lcode.h │ │ │ │ ├── ldblib.c │ │ │ │ ├── ldebug.c │ │ │ │ ├── ldebug.h │ │ │ │ ├── ldo.c │ │ │ │ ├── ldo.h │ │ │ │ ├── ldump.c │ │ │ │ ├── lfunc.c │ │ │ │ ├── lfunc.h │ │ │ │ ├── lgc.c │ │ │ │ ├── lgc.h │ │ │ │ ├── linit.c │ │ │ │ ├── liolib.c │ │ │ │ ├── llex.c │ │ │ │ ├── llex.h │ │ │ │ ├── llimits.h │ │ │ │ ├── lmathlib.c │ │ │ │ ├── lmem.c │ │ │ │ ├── lmem.h │ │ │ │ ├── loadlib.c │ │ │ │ ├── lobject.c │ │ │ │ ├── lobject.h │ │ │ │ ├── lopcodes.c │ │ │ │ ├── lopcodes.h │ │ │ │ ├── loslib.c │ │ │ │ ├── lparser.c │ │ │ │ ├── lparser.h │ │ │ │ ├── lstate.c │ │ │ │ ├── lstate.h │ │ │ │ ├── lstring.c │ │ │ │ ├── lstring.h │ │ │ │ ├── lstrlib.c │ │ │ │ ├── ltable.c │ │ │ │ ├── ltable.h │ │ │ │ ├── ltablib.c │ │ │ │ ├── ltm.c │ │ │ │ ├── ltm.h │ │ │ │ ├── lua.c │ │ │ │ ├── lua.h │ │ │ │ ├── luac.c │ │ │ │ ├── luaconf.h │ │ │ │ ├── lualib.h │ │ │ │ ├── lundump.c │ │ │ │ ├── lundump.h │ │ │ │ ├── lvm.c │ │ │ │ ├── lvm.h │ │ │ │ ├── lzio.c │ │ │ │ ├── lzio.h │ │ │ │ └── print.c │ │ │ └── test │ │ │ │ ├── README │ │ │ │ ├── bisect.lua │ │ │ │ ├── cf.lua │ │ │ │ ├── echo.lua │ │ │ │ ├── env.lua │ │ │ │ ├── factorial.lua │ │ │ │ ├── fib.lua │ │ │ │ ├── fibfor.lua │ │ │ │ ├── globals.lua │ │ │ │ ├── hello.lua │ │ │ │ ├── life.lua │ │ │ │ ├── luac.lua │ │ │ │ ├── printf.lua │ │ │ │ ├── readonly.lua │ │ │ │ ├── sieve.lua │ │ │ │ ├── sort.lua │ │ │ │ ├── table.lua │ │ │ │ ├── trace-calls.lua │ │ │ │ ├── trace-globals.lua │ │ │ │ └── xd.lua │ │ └── lua.h │ ├── lz4 │ │ ├── CMakeLists.txt │ │ ├── README │ │ ├── lz4.c │ │ ├── lz4.h │ │ ├── lz4hc.c │ │ ├── lz4hc.h │ │ ├── mmc.c │ │ └── mmc.h │ ├── lzmasdk │ │ ├── 7zStream.c │ │ ├── Alloc.c │ │ ├── Alloc.h │ │ ├── CMakeLists.txt │ │ ├── LzFind.c │ │ ├── LzFind.h │ │ ├── LzHash.h │ │ ├── LzmaDec.c │ │ ├── LzmaDec.h │ │ ├── LzmaEnc.c │ │ ├── LzmaEnc.h │ │ ├── LzmaLib.c │ │ ├── LzmaLib.h │ │ ├── LzmaUtil.c │ │ ├── LzmaUtil.h │ │ └── Types.h │ ├── matrixssl │ │ ├── CMakeLists.txt │ │ ├── matrixCommon.h │ │ ├── matrixSsl.h │ │ ├── src │ │ │ ├── cipherSuite.c │ │ │ ├── crypto │ │ │ │ ├── cryptoLayer.h │ │ │ │ ├── matrixCrypto.h │ │ │ │ └── peersec │ │ │ │ │ ├── arc4.c │ │ │ │ │ ├── base64.c │ │ │ │ │ ├── des3.c │ │ │ │ │ ├── md2.c │ │ │ │ │ ├── md5.c │ │ │ │ │ ├── mpi.c │ │ │ │ │ ├── mpi.h │ │ │ │ │ ├── pscrypto.h │ │ │ │ │ ├── rsa.c │ │ │ │ │ └── sha1.c │ │ │ ├── matrixConfig.h │ │ │ ├── matrixInternal.h │ │ │ ├── matrixSsl.c │ │ │ ├── os │ │ │ │ ├── debug.c │ │ │ │ ├── osLayer.h │ │ │ │ ├── psMalloc.h │ │ │ │ └── yandex │ │ │ │ │ └── yandex.cpp │ │ │ ├── pki │ │ │ │ ├── asn1.c │ │ │ │ ├── matrixPki.h │ │ │ │ ├── pkiInternal.h │ │ │ │ ├── rsaPki.c │ │ │ │ └── x509.c │ │ │ ├── sslDecode.c │ │ │ ├── sslEncode.c │ │ │ ├── sslv3.c │ │ │ └── yandex.c │ │ └── yandex.h │ ├── matrixssl3 │ │ ├── Makefile.cfg.cmake │ │ ├── core │ │ │ ├── YANDEX │ │ │ │ └── osdep.cpp │ │ │ ├── coreApi.h │ │ │ ├── coreConfig.h │ │ │ ├── corelib.c │ │ │ ├── list.h │ │ │ ├── osdep.h │ │ │ └── psmalloc.h │ │ ├── crypto │ │ │ ├── cryptoApi.h │ │ │ ├── cryptoConfig.h │ │ │ ├── cryptolib.h │ │ │ ├── digest │ │ │ │ ├── digest.h │ │ │ │ ├── hmac.c │ │ │ │ ├── md5.c │ │ │ │ └── sha1.c │ │ │ ├── keyformat │ │ │ │ ├── asn1.c │ │ │ │ ├── asn1.h │ │ │ │ ├── base64.c │ │ │ │ ├── x509.c │ │ │ │ └── x509.h │ │ │ ├── math │ │ │ │ ├── pstm.c │ │ │ │ └── pstm.h │ │ │ ├── prng │ │ │ │ ├── prng.c │ │ │ │ ├── prng.h │ │ │ │ └── yarrow.c │ │ │ ├── pubkey │ │ │ │ ├── pkcs.c │ │ │ │ ├── pubkey.c │ │ │ │ ├── pubkey.h │ │ │ │ └── rsa.c │ │ │ └── symmetric │ │ │ │ ├── aes.c │ │ │ │ ├── arc4.c │ │ │ │ ├── des3.c │ │ │ │ └── symmetric.h │ │ ├── matrixSsl.h │ │ └── matrixssl │ │ │ ├── cipherSuite.c │ │ │ ├── matrixssl.c │ │ │ ├── matrixsslApi.c │ │ │ ├── matrixsslApi.h │ │ │ ├── matrixsslConfig.h │ │ │ ├── matrixssllib.h │ │ │ ├── sslDecode.c │ │ │ ├── sslEncode.c │ │ │ ├── sslv3.c │ │ │ ├── tls.c │ │ │ └── version.h │ ├── minilzo │ │ ├── CMakeLists.txt │ │ ├── lzoconf.h │ │ ├── lzodefs.h │ │ ├── minilzo.c │ │ ├── minilzo.h │ │ └── protect.h │ ├── pcre │ │ ├── CMakeLists.txt │ │ ├── config.h │ │ ├── pcre.h │ │ ├── pcre_chartables.c │ │ ├── pcre_compile.c │ │ ├── pcre_config.c │ │ ├── pcre_dfa_exec.c │ │ ├── pcre_exec.c │ │ ├── pcre_fullinfo.c │ │ ├── pcre_get.c │ │ ├── pcre_globals.c │ │ ├── pcre_info.c │ │ ├── pcre_internal.h │ │ ├── pcre_maketables.c │ │ ├── pcre_newline.c │ │ ├── pcre_ord2utf8.c │ │ ├── pcre_refcount.c │ │ ├── pcre_study.c │ │ ├── pcre_tables.c │ │ ├── pcre_try_flipped.c │ │ ├── pcre_ucp_searchfuncs.c │ │ ├── pcre_valid_utf8.c │ │ ├── pcre_version.c │ │ ├── pcre_xclass.c │ │ ├── pcreposix.c │ │ ├── pcreposix.h │ │ ├── preprocess.sh │ │ ├── rename.h │ │ ├── ucp.h │ │ ├── ucpinternal.h │ │ └── ucptable.h │ ├── pire │ │ ├── Makefile.am │ │ ├── README │ │ ├── configure.ac │ │ ├── pire │ │ │ ├── Makefile.am │ │ │ ├── align.h │ │ │ ├── any.h │ │ │ ├── classes.cpp │ │ │ ├── defs.h │ │ │ ├── determine.h │ │ │ ├── easy.cpp │ │ │ ├── easy.h │ │ │ ├── encoding.cpp │ │ │ ├── encoding.h │ │ │ ├── extra.h │ │ │ ├── extra │ │ │ │ ├── capture.cpp │ │ │ │ ├── capture.h │ │ │ │ ├── count.cpp │ │ │ │ ├── count.h │ │ │ │ ├── glyphs.cpp │ │ │ │ └── glyphs.h │ │ │ ├── fsm.cpp │ │ │ ├── fsm.h │ │ │ ├── fwd.h │ │ │ ├── glue.h │ │ │ ├── inline.lpp │ │ │ ├── partition.h │ │ │ ├── pire.h │ │ │ ├── platform.h │ │ │ ├── re_lexer.cpp │ │ │ ├── re_lexer.h │ │ │ ├── re_parser.ypp │ │ │ ├── run.h │ │ │ ├── scanner_io.cpp │ │ │ ├── scanners │ │ │ │ ├── common.h │ │ │ │ ├── loaded.h │ │ │ │ ├── multi.h │ │ │ │ ├── null.cpp │ │ │ │ ├── pair.h │ │ │ │ ├── simple.h │ │ │ │ └── slow.h │ │ │ ├── static_assert.h │ │ │ ├── stub │ │ │ │ ├── defaults.h │ │ │ │ ├── hacks.h │ │ │ │ ├── lexical_cast.h │ │ │ │ ├── memstreams.h │ │ │ │ ├── noncopyable.h │ │ │ │ ├── saveload.h │ │ │ │ ├── singleton.h │ │ │ │ ├── stl.h │ │ │ │ └── utf8.h │ │ │ └── vbitset.h │ │ ├── samples │ │ │ ├── Makefile.am │ │ │ └── bench │ │ │ │ ├── Makefile.am │ │ │ │ └── bench.cpp │ │ └── tests │ │ │ ├── Makefile.am │ │ │ ├── capture_ut.cpp │ │ │ ├── common.h │ │ │ ├── count_ut.cpp │ │ │ ├── easy_ut.cpp │ │ │ ├── glyph_ut.cpp │ │ │ ├── inline_ut.cpp │ │ │ ├── pire_ut.cpp │ │ │ └── stub │ │ │ └── cppunit.h │ ├── quicklz │ │ ├── 1.31 │ │ │ ├── quicklz.c │ │ │ └── yquicklz.h │ │ ├── 1.40 │ │ │ ├── quicklz.c │ │ │ ├── quicklz.h │ │ │ └── yquicklz.h │ │ ├── 1_31_0_0.c │ │ ├── 1_31_0_0.h │ │ ├── 1_31_0_100000.c │ │ ├── 1_31_0_100000.h │ │ ├── 1_31_0_1000000.c │ │ ├── 1_31_0_1000000.h │ │ ├── 1_31_1_0.c │ │ ├── 1_31_1_0.h │ │ ├── 1_31_1_100000.c │ │ ├── 1_31_1_100000.h │ │ ├── 1_31_1_1000000.c │ │ ├── 1_31_1_1000000.h │ │ ├── 1_31_2_0.c │ │ ├── 1_31_2_0.h │ │ ├── 1_31_2_100000.c │ │ ├── 1_31_2_100000.h │ │ ├── 1_31_2_1000000.c │ │ ├── 1_31_2_1000000.h │ │ ├── 1_31_3_0.c │ │ ├── 1_31_3_0.h │ │ ├── 1_31_3_100000.c │ │ ├── 1_31_3_100000.h │ │ ├── 1_31_3_1000000.c │ │ ├── 1_31_3_1000000.h │ │ ├── 1_40_1_0.c │ │ ├── 1_40_1_0.h │ │ ├── 1_40_1_100000.c │ │ ├── 1_40_1_100000.h │ │ ├── 1_40_1_1000000.c │ │ ├── 1_40_1_1000000.h │ │ ├── 1_40_2_0.c │ │ ├── 1_40_2_0.h │ │ ├── 1_40_2_100000.c │ │ ├── 1_40_2_100000.h │ │ ├── 1_40_2_1000000.c │ │ ├── 1_40_2_1000000.h │ │ ├── 1_40_3_0.c │ │ ├── 1_40_3_0.h │ │ ├── 1_40_3_100000.c │ │ ├── 1_40_3_100000.h │ │ ├── 1_40_3_1000000.c │ │ ├── 1_40_3_1000000.h │ │ ├── CMakeLists.inc │ │ ├── CMakeLists.txt │ │ ├── epilog.h │ │ ├── gen.sh │ │ ├── prolog.h │ │ ├── quicklz.cpp │ │ ├── quicklz.h │ │ ├── quicklz.inc │ │ ├── table.c │ │ ├── table.h │ │ ├── table.inc │ │ ├── tables1.inc │ │ └── tables2.inc │ ├── snappy │ │ ├── CMakeLists.txt │ │ ├── snappy-c.cc │ │ ├── snappy-c.h │ │ ├── snappy-internal.h │ │ ├── snappy-sinksource.cc │ │ ├── snappy-sinksource.h │ │ ├── snappy-stubs-internal.cc │ │ ├── snappy-stubs-internal.h │ │ ├── snappy-stubs-public.h │ │ ├── snappy.cc │ │ └── snappy.h │ └── zlib │ │ ├── CMakeLists.txt │ │ ├── ChangeLog │ │ ├── FAQ │ │ ├── README │ │ ├── adler32.c │ │ ├── compress.c │ │ ├── crc32.c │ │ ├── crc32.h │ │ ├── deflate.c │ │ ├── deflate.h │ │ ├── gzclose.c │ │ ├── gzguts.h │ │ ├── gzlib.c │ │ ├── gzread.c │ │ ├── gzwrite.c │ │ ├── infback.c │ │ ├── inffast.c │ │ ├── inffast.h │ │ ├── inffixed.h │ │ ├── inflate.c │ │ ├── inflate.h │ │ ├── inftrees.c │ │ ├── inftrees.h │ │ ├── trees.c │ │ ├── trees.h │ │ ├── uncompr.c │ │ ├── zconf.h │ │ ├── zlib.h │ │ ├── zutil.c │ │ └── zutil.h └── tools │ ├── byacc │ ├── CMakeLists.txt │ ├── closure.c │ ├── config.h │ ├── defs.h │ ├── error.c │ ├── graph.c │ ├── lalr.c │ ├── lr0.c │ ├── main.c │ ├── mkpar.c │ ├── output.c │ ├── reader.c │ ├── skeleton.c │ ├── symtab.c │ ├── verbose.c │ └── warshall.c │ ├── file2c │ ├── CMakeLists.txt │ └── file2c.c │ ├── flex-old │ ├── CMakeLists.txt │ ├── FlexLexer.h │ ├── ccl.c │ ├── conf.in │ ├── config.h │ ├── dfa.c │ ├── ecs.c │ ├── fl │ │ ├── CMakeLists.txt │ │ ├── libmain.c │ │ └── libyywrap.c │ ├── flex.skl │ ├── flexdef.h │ ├── gen.c │ ├── main.c │ ├── misc.c │ ├── nfa.c │ ├── parse.c │ ├── parse.h │ ├── scan.c │ ├── skel.c │ ├── sym.c │ ├── tblcmp.c │ ├── version.h │ └── yylex.c │ ├── gperf │ ├── CMakeLists.txt │ ├── bool-array.cpp │ ├── bool-array.h │ ├── bool-array.icc │ ├── config.h │ ├── getline.cpp │ ├── getline.h │ ├── getopt.c │ ├── getopt.h │ ├── getopt1.c │ ├── hash-table.cpp │ ├── hash-table.h │ ├── hash.cpp │ ├── hash.h │ ├── input.cpp │ ├── input.h │ ├── keyword-list.cpp │ ├── keyword-list.h │ ├── keyword-list.icc │ ├── keyword.cpp │ ├── keyword.h │ ├── keyword.icc │ ├── main.cpp │ ├── options.cpp │ ├── options.h │ ├── options.icc │ ├── output.cpp │ ├── output.h │ ├── positions.cpp │ ├── positions.h │ ├── positions.icc │ ├── search.cpp │ ├── search.h │ ├── version.cpp │ └── version.h │ ├── ragel5 │ ├── CMakeLists.txt │ ├── aapl │ │ ├── avlbasic.h │ │ ├── avlcommon.h │ │ ├── avlibasic.h │ │ ├── avlikeyless.h │ │ ├── avlimap.h │ │ ├── avlimel.h │ │ ├── avlimelkey.h │ │ ├── avliset.h │ │ ├── avlitree.h │ │ ├── avlkeyless.h │ │ ├── avlmap.h │ │ ├── avlmel.h │ │ ├── avlmelkey.h │ │ ├── avlset.h │ │ ├── avltree.h │ │ ├── bstcommon.h │ │ ├── bstmap.h │ │ ├── bstset.h │ │ ├── bsttable.h │ │ ├── bubblesort.h │ │ ├── compare.h │ │ ├── dlcommon.h │ │ ├── dlist.h │ │ ├── dlistmel.h │ │ ├── dlistval.h │ │ ├── insertsort.h │ │ ├── mergesort.h │ │ ├── quicksort.h │ │ ├── resize.h │ │ ├── sbstmap.h │ │ ├── sbstset.h │ │ ├── sbsttable.h │ │ ├── svector.h │ │ ├── table.h │ │ └── vector.h │ ├── common │ │ ├── CMakeLists.txt │ │ ├── buffer.h │ │ ├── common.cpp │ │ ├── common.h │ │ ├── config.h │ │ ├── pcheck.h │ │ └── version.h │ ├── ragel │ │ ├── CMakeLists.txt │ │ ├── fsmap.cpp │ │ ├── fsmattach.cpp │ │ ├── fsmbase.cpp │ │ ├── fsmgraph.cpp │ │ ├── fsmgraph.h │ │ ├── fsmmin.cpp │ │ ├── fsmstate.cpp │ │ ├── main.cpp │ │ ├── parsedata.cpp │ │ ├── parsedata.h │ │ ├── parsetree.cpp │ │ ├── parsetree.h │ │ ├── ragel.h │ │ ├── rlparse.cpp │ │ ├── rlparse.h │ │ ├── rlscan.cpp │ │ ├── rlscan.h │ │ ├── xmlcodegen.cpp │ │ └── xmlcodegen.h │ ├── redfsm │ │ ├── CMakeLists.txt │ │ ├── gendata.cpp │ │ ├── gendata.h │ │ ├── redfsm.cpp │ │ ├── redfsm.h │ │ ├── xmlparse.cpp │ │ ├── xmlparse.h │ │ ├── xmlscan.cpp │ │ └── xmltags.cpp │ └── rlgen-cd │ │ ├── CMakeLists.txt │ │ ├── fflatcodegen.cpp │ │ ├── fflatcodegen.h │ │ ├── fgotocodegen.cpp │ │ ├── fgotocodegen.h │ │ ├── flatcodegen.cpp │ │ ├── flatcodegen.h │ │ ├── fsmcodegen.cpp │ │ ├── fsmcodegen.h │ │ ├── ftabcodegen.cpp │ │ ├── ftabcodegen.h │ │ ├── gotocodegen.cpp │ │ ├── gotocodegen.h │ │ ├── ipgotocodegen.cpp │ │ ├── ipgotocodegen.h │ │ ├── main.cpp │ │ ├── rlgen-cd.h │ │ ├── splitcodegen.cpp │ │ ├── splitcodegen.h │ │ ├── tabcodegen.cpp │ │ └── tabcodegen.h │ ├── ragel6 │ ├── CMakeLists.txt │ ├── buffer.h │ ├── cdcodegen.cpp │ ├── cdcodegen.h │ ├── cdfflat.cpp │ ├── cdfflat.h │ ├── cdfgoto.cpp │ ├── cdfgoto.h │ ├── cdflat.cpp │ ├── cdflat.h │ ├── cdftable.cpp │ ├── cdftable.h │ ├── cdgoto.cpp │ ├── cdgoto.h │ ├── cdipgoto.cpp │ ├── cdipgoto.h │ ├── cdsplit.cpp │ ├── cdsplit.h │ ├── cdtable.cpp │ ├── cdtable.h │ ├── common.cpp │ ├── common.h │ ├── config.h │ ├── cscodegen.cpp │ ├── cscodegen.h │ ├── csfflat.cpp │ ├── csfflat.h │ ├── csfgoto.cpp │ ├── csfgoto.h │ ├── csflat.cpp │ ├── csflat.h │ ├── csftable.cpp │ ├── csftable.h │ ├── csgoto.cpp │ ├── csgoto.h │ ├── csipgoto.cpp │ ├── csipgoto.h │ ├── cssplit.cpp │ ├── cssplit.h │ ├── cstable.cpp │ ├── cstable.h │ ├── dotcodegen.cpp │ ├── dotcodegen.h │ ├── fsmap.cpp │ ├── fsmattach.cpp │ ├── fsmbase.cpp │ ├── fsmgraph.cpp │ ├── fsmgraph.h │ ├── fsmmin.cpp │ ├── fsmstate.cpp │ ├── gendata.cpp │ ├── gendata.h │ ├── inputdata.cpp │ ├── inputdata.h │ ├── javacodegen.cpp │ ├── javacodegen.h │ ├── main.cpp │ ├── parsedata.cpp │ ├── parsedata.h │ ├── parsetree.cpp │ ├── parsetree.h │ ├── pcheck.h │ ├── ragel.h │ ├── rbxgoto.cpp │ ├── rbxgoto.h │ ├── redfsm.cpp │ ├── redfsm.h │ ├── rlparse.cpp │ ├── rlparse.h │ ├── rlparse.kh │ ├── rlparse.kl │ ├── rlscan.cpp │ ├── rlscan.h │ ├── rlscan.rl │ ├── rubycodegen.cpp │ ├── rubycodegen.h │ ├── rubyfflat.cpp │ ├── rubyfflat.h │ ├── rubyflat.cpp │ ├── rubyflat.h │ ├── rubyftable.cpp │ ├── rubyftable.h │ ├── rubytable.cpp │ ├── rubytable.h │ ├── version.h │ ├── xmlcodegen.cpp │ └── xmlcodegen.h │ └── yasm │ ├── CMakeLists.txt │ ├── config.h │ ├── frontends │ └── yasm │ │ ├── yasm-options.c │ │ ├── yasm-options.h │ │ └── yasm.c │ ├── gas-token.c │ ├── genstring.c │ ├── lc3bid.c │ ├── libyasm-stdint.h │ ├── libyasm.h │ ├── libyasm │ ├── arch.h │ ├── assocdat.c │ ├── assocdat.h │ ├── bc-align.c │ ├── bc-data.c │ ├── bc-incbin.c │ ├── bc-org.c │ ├── bc-reserve.c │ ├── bitvect.c │ ├── bitvect.h │ ├── bytecode.c │ ├── bytecode.h │ ├── compat-queue.h │ ├── coretype.h │ ├── dbgfmt.h │ ├── errwarn.c │ ├── errwarn.h │ ├── expr.c │ ├── expr.h │ ├── file.c │ ├── file.h │ ├── floatnum.c │ ├── floatnum.h │ ├── genmodule.c │ ├── hamt.c │ ├── hamt.h │ ├── insn.c │ ├── insn.h │ ├── intnum.c │ ├── intnum.h │ ├── inttree.c │ ├── inttree.h │ ├── linemap.c │ ├── linemap.h │ ├── listfmt.h │ ├── md5.c │ ├── md5.h │ ├── mergesort.c │ ├── module.h │ ├── module.in │ ├── objfmt.h │ ├── parser.h │ ├── phash.c │ ├── phash.h │ ├── preproc.h │ ├── section.c │ ├── section.h │ ├── strcasecmp.c │ ├── strsep.c │ ├── symrec.c │ ├── symrec.h │ ├── valparam.c │ ├── valparam.h │ ├── value.c │ ├── value.h │ ├── xmalloc.c │ └── xstrdup.c │ ├── license.c │ ├── module.c │ ├── modules │ ├── arch │ │ ├── lc3b │ │ │ ├── lc3barch.c │ │ │ ├── lc3barch.h │ │ │ └── lc3bbc.c │ │ └── x86 │ │ │ ├── x86arch.c │ │ │ ├── x86arch.h │ │ │ ├── x86bc.c │ │ │ ├── x86expr.c │ │ │ └── x86id.c │ ├── dbgfmts │ │ ├── codeview │ │ │ ├── cv-dbgfmt.c │ │ │ ├── cv-dbgfmt.h │ │ │ ├── cv-symline.c │ │ │ ├── cv-type.c │ │ │ └── cv8.txt │ │ ├── dwarf2 │ │ │ ├── dwarf2-aranges.c │ │ │ ├── dwarf2-dbgfmt.c │ │ │ ├── dwarf2-dbgfmt.h │ │ │ ├── dwarf2-info.c │ │ │ └── dwarf2-line.c │ │ ├── null │ │ │ └── null-dbgfmt.c │ │ └── stabs │ │ │ └── stabs-dbgfmt.c │ ├── listfmts │ │ └── nasm │ │ │ └── nasm-listfmt.c │ ├── objfmts │ │ ├── bin │ │ │ └── bin-objfmt.c │ │ ├── coff │ │ │ ├── coff-objfmt.c │ │ │ ├── coff-objfmt.h │ │ │ └── win64-except.c │ │ ├── dbg │ │ │ └── dbg-objfmt.c │ │ ├── elf │ │ │ ├── elf-machine.h │ │ │ ├── elf-objfmt.c │ │ │ ├── elf-x86-amd64.c │ │ │ ├── elf-x86-x86.c │ │ │ ├── elf.c │ │ │ └── elf.h │ │ ├── macho │ │ │ └── macho-objfmt.c │ │ ├── rdf │ │ │ └── rdf-objfmt.c │ │ └── xdf │ │ │ └── xdf-objfmt.c │ ├── parsers │ │ ├── gas │ │ │ ├── gas-parse.c │ │ │ ├── gas-parser.c │ │ │ └── gas-parser.h │ │ └── nasm │ │ │ ├── nasm-parse.c │ │ │ ├── nasm-parser.c │ │ │ └── nasm-parser.h │ └── preprocs │ │ ├── cpp │ │ └── cpp-preproc.c │ │ ├── nasm │ │ ├── genversion.c │ │ ├── nasm-eval.c │ │ ├── nasm-eval.h │ │ ├── nasm-pp.c │ │ ├── nasm-pp.h │ │ ├── nasm-preproc.c │ │ ├── nasm.h │ │ ├── nasmlib.c │ │ └── nasmlib.h │ │ └── raw │ │ └── raw-preproc.c │ ├── nasm-macros.c │ ├── nasm-token.c │ ├── nasm-version.c │ ├── test_hd.c │ ├── util.h │ ├── win64-gas.c │ ├── win64-nasm.c │ ├── x86cpu.c │ ├── x86insn_gas.c │ ├── x86insn_nasm.c │ ├── x86insns.c │ └── x86regtmod.c ├── generated ├── composition.cpp ├── cp_data.cpp ├── decomposition.cpp ├── encrec_data.cpp ├── unidata.cpp └── uniscripts.cpp ├── library ├── gettimeofday │ ├── CMakeLists.txt │ ├── gettimeofday.cpp │ └── gettimeofday.h ├── lua │ ├── CMakeLists.txt │ ├── README │ ├── wrapper.cpp │ └── wrapper.h ├── pire │ ├── CMakeLists.txt │ ├── Makefile.cfg.cmake │ ├── dbg │ │ ├── CMakeLists.txt │ │ └── dbg.cpp │ ├── extraencodings.cpp │ ├── inline │ │ └── CMakeLists.txt │ ├── pire.h │ ├── regexp.h │ └── test │ │ ├── CMakeLists.txt │ │ └── regexp_ut.cpp ├── svnversion │ ├── CMakeLists.txt │ ├── svnversion.cpp │ └── svnversion.h └── unittest │ ├── CMakeLists.txt │ ├── checks.cpp │ ├── registar.cpp │ ├── registar.h │ ├── tests_data.cpp │ ├── tests_data.h │ └── utmain.cpp ├── tools ├── archiver │ ├── CMakeLists.txt │ └── main.cpp └── lua │ ├── CMakeLists.txt │ └── lua.cpp ├── util ├── CMakeLists.txt ├── array2d.h ├── array2d_writer.h ├── atomizer.h ├── autoarray.h ├── charset │ ├── CMakeLists.txt │ ├── codepage.cpp │ ├── codepage.h │ ├── codepage_ut.cpp │ ├── cp_encrec.cpp │ ├── decomposition_table.h │ ├── doccodes.cpp │ ├── doccodes.h │ ├── doccodes_ut.cpp │ ├── iconv.h │ ├── iconv_ut.cpp │ ├── normalization.cpp │ ├── normalization.h │ ├── recyr.hh │ ├── recyr_int.hh │ ├── unicode_table.h │ ├── unidata.h │ ├── utf.cpp │ ├── utf.h │ ├── wide.cpp │ ├── wide.h │ └── wide_ut.cpp ├── config │ ├── CMakeLists.txt │ ├── conf.cpp │ ├── conf.h │ ├── last_getopt.cpp │ ├── last_getopt.h │ ├── last_getopt_demo │ │ ├── CMakeLists.txt │ │ └── demo.cpp │ ├── last_getopt_support.h │ ├── last_getopt_ut.cpp │ ├── opt.cpp │ ├── opt.h │ ├── opt2.cpp │ ├── opt2.h │ ├── opt2_ut.cpp │ ├── opt_ut.cpp │ ├── posix_getopt.cpp │ ├── posix_getopt.h │ ├── posix_getopt_ut.cpp │ ├── ygetopt.cpp │ ├── ygetopt.h │ └── ygetopt_ut.cpp ├── cont_init.h ├── datetime │ ├── CMakeLists.txt │ ├── base.cpp │ ├── base.h │ ├── base_ut.cpp │ ├── constants.h │ ├── cputimer.cpp │ ├── cputimer.h │ ├── parser.h │ ├── parser.rl │ ├── parser_ut.cpp │ ├── strptime.cpp │ ├── systime.cpp │ └── systime.h ├── digest │ ├── CMakeLists.txt │ ├── city.cpp │ ├── city.h │ ├── crc.cpp │ ├── crc.h │ ├── crc.i │ ├── crc_ut.cpp │ ├── fnv.h │ ├── fnv_ut.cpp │ ├── iterator.h │ ├── md5.cpp │ ├── md5.h │ ├── md5_ut.cpp │ ├── murmur.h │ ├── murmur_ut.cpp │ ├── numeric.h │ ├── sfh.h │ └── sfh_ut.cpp ├── ffb.cpp ├── ffb.h ├── ffb_ut.cpp ├── fgood.h ├── fileptr.cpp ├── folder │ ├── CMakeLists.txt │ ├── dirent_win.c │ ├── dirent_win.h │ ├── dirut.cpp │ ├── dirut.h │ ├── dirut_ut.cpp │ ├── filelist.cpp │ ├── filelist.h │ ├── filelist_ut.cpp │ ├── fts.cpp │ ├── fts.h │ ├── fts_ut.cpp │ ├── iterator.h │ ├── iterator_ut.cpp │ ├── lstat_win.c │ └── lstat_win.h ├── fput.h ├── generic │ ├── CMakeLists.txt │ ├── algorithm.h │ ├── array.h │ ├── avltree.h │ ├── avltree_ut.cpp │ ├── bitmap.h │ ├── bitmap_ut.cpp │ ├── bitops.h │ ├── bitops_ut.cpp │ ├── buffer.cpp │ ├── buffer.h │ ├── buffer_ut.cpp │ ├── cast.h │ ├── cast_ut.cpp │ ├── char_buf.h │ ├── chartraits.cpp │ ├── chartraits.h │ ├── chartraits_ut.cpp │ ├── deque.h │ ├── deque_ut.cpp │ ├── fwd.h │ ├── gentl.py │ ├── hash.h │ ├── hash_set.h │ ├── hash_ut.cpp │ ├── hide.h │ ├── intrlist.h │ ├── intrlist_ut.cpp │ ├── iterator.h │ ├── list.h │ ├── map.h │ ├── map_ut.cpp │ ├── noncopyable.h │ ├── pair.h │ ├── ptr.cpp │ ├── ptr.h │ ├── ptr_ut.cpp │ ├── rbtree.h │ ├── rbtree_ut.cpp │ ├── refcount.h │ ├── set.h │ ├── set_ut.cpp │ ├── singleton.h │ ├── stack.h │ ├── static_assert.h │ ├── stlfwd.h │ ├── strbuf.cpp │ ├── strbuf.h │ ├── strbuf_ut.cpp │ ├── strfcpy.cpp │ ├── strfcpy.h │ ├── strkey.h │ ├── strkey_ut.cpp │ ├── stroka.cpp │ ├── stroka.h │ ├── stroka_io.cpp │ ├── stroka_io.h │ ├── stroka_stdio.cpp │ ├── stroka_ut.cpp │ ├── typehelpers.h │ ├── typelist.h │ ├── typetraits.h │ ├── typetraits_ut.cpp │ ├── utility.h │ ├── utility_ut.cpp │ ├── vector.h │ ├── vector_ut.cpp │ ├── yexception.cpp │ ├── yexception.h │ ├── yexception_ut.c │ ├── yexception_ut.cpp │ ├── yexception_ut.h │ ├── ylimits.h │ ├── ylimits_ut.cpp │ ├── ymath.cpp │ ├── ymath.h │ └── ymath_ut.cpp ├── green │ ├── CMakeLists.txt │ ├── condvar.h │ ├── coroutine_ut.cpp │ ├── events.h │ ├── impl.cpp │ ├── impl.h │ ├── iostatus.h │ ├── iovec.h │ ├── mutex.h │ ├── poller.cpp │ ├── poller.h │ ├── sockpool.h │ └── stack.h ├── http_url.h ├── httpcodes.cpp ├── httpcodes.h ├── httpdate.cpp ├── httpdate.h ├── httpreqdata.h ├── logger │ ├── CMakeLists.txt │ ├── all.h │ ├── backend.cpp │ ├── backend.h │ ├── element.cpp │ ├── element.h │ ├── file.cpp │ ├── file.h │ ├── log.cpp │ ├── log.h │ ├── log_ut.cpp │ ├── null.cpp │ ├── null.h │ ├── priority.h │ ├── record.h │ ├── stream.cpp │ ├── stream.h │ ├── system.cpp │ ├── system.h │ ├── thread.cpp │ └── thread.h ├── longs.cpp ├── longs.h ├── longs_ut.cpp ├── mbitmap.cpp ├── mbitmap.h ├── memory │ ├── CMakeLists.txt │ ├── addstorage.h │ ├── addstorage_ut.cpp │ ├── alloc.cpp │ ├── alloc.h │ ├── blob.cpp │ ├── blob.h │ ├── blob_ut.cpp │ ├── gc.h │ ├── mmapalloc.cpp │ ├── mmapalloc.h │ ├── pool.cpp │ ├── pool.h │ ├── pool_ut.cpp │ ├── profile.cpp │ ├── profile.h │ ├── segmented_string_pool.h │ ├── segpool_alloc.h │ ├── smallobj.h │ ├── smallobj_ut.cpp │ ├── tempbuf.cpp │ ├── tempbuf.h │ └── tempbuf_ut.cpp ├── network │ ├── CMakeLists.txt │ ├── address.cpp │ ├── address.h │ ├── hostip.cpp │ ├── hostip.h │ ├── init.cpp │ ├── init.h │ ├── ip.h │ ├── ip_ut.cpp │ ├── pair.cpp │ ├── pair.h │ ├── poller.cpp │ ├── poller.h │ ├── pollerimpl.h │ ├── sock.h │ ├── sock_ut.cpp │ ├── socket.cpp │ ├── socket.h │ └── socket_ut.cpp ├── private │ ├── galloc │ │ ├── CMakeLists.txt │ │ ├── basictypes.h │ │ ├── commandlineflags.h │ │ ├── galloc.cpp │ │ ├── internal_logging.cc │ │ ├── internal_logging.h │ │ ├── internal_spinlock.h │ │ ├── malloc_extension.cc │ │ ├── malloc_extension.h │ │ ├── malloc_hook.h │ │ ├── pagemap.h │ │ ├── stacktrace.h │ │ ├── system-alloc.cc │ │ ├── system-alloc.h │ │ └── tcmalloc.cc │ ├── jalloc │ │ ├── CMakeLists.txt │ │ ├── cpphooks.cpp │ │ ├── hack.cpp │ │ ├── hack.h │ │ ├── malloc.c │ │ ├── rename.h │ │ ├── spinlock.h │ │ └── tree.h │ ├── lfalloc │ │ ├── CMakeLists.txt │ │ └── lf_allocX64.cpp │ └── stl │ │ ├── CMakeLists.txt │ │ ├── config.h │ │ └── stlport-5.1.4 │ │ ├── src │ │ ├── _stdio_file.h │ │ ├── acquire_release.h │ │ ├── aligned_buffer.h │ │ ├── allocators.cpp │ │ ├── bitset.cpp │ │ ├── c_locale.c │ │ ├── c_locale.h │ │ ├── c_locale_dummy │ │ │ └── c_locale_dummy.c │ │ ├── c_locale_glibc │ │ │ ├── c_locale_glibc.c │ │ │ ├── c_locale_glibc2.c │ │ │ └── gcc_localeinfo.h │ │ ├── c_locale_win32 │ │ │ └── c_locale_win32.c │ │ ├── codecvt.cpp │ │ ├── collate.cpp │ │ ├── complex.cpp │ │ ├── complex_io.cpp │ │ ├── complex_trig.cpp │ │ ├── ctype.cpp │ │ ├── cxa.c │ │ ├── dll_main.cpp │ │ ├── facets_byname.cpp │ │ ├── fstream.cpp │ │ ├── fstream_impl.h │ │ ├── ios.cpp │ │ ├── iostream.cpp │ │ ├── istream.cpp │ │ ├── locale.cpp │ │ ├── locale_catalog.cpp │ │ ├── locale_impl.cpp │ │ ├── locale_impl.h │ │ ├── lock_free_slist.h │ │ ├── message_facets.h │ │ ├── messages.cpp │ │ ├── monetary.cpp │ │ ├── num_get.cpp │ │ ├── num_get_float.cpp │ │ ├── num_put.cpp │ │ ├── num_put_float.cpp │ │ ├── numpunct.cpp │ │ ├── ostream.cpp │ │ ├── sparc_atomic.s │ │ ├── sparc_atomic64.s │ │ ├── sstream.cpp │ │ ├── stdio_streambuf.cpp │ │ ├── stdio_streambuf.h │ │ ├── stlport.rc │ │ ├── stlport_prefix.h │ │ ├── string.cpp │ │ ├── strstream.cpp │ │ ├── time_facets.cpp │ │ ├── uint64.h │ │ ├── vc_warning_disable.h │ │ └── warning_disable.h │ │ └── stlport │ │ ├── algorithm │ │ ├── assert.h │ │ ├── bitset │ │ ├── cassert │ │ ├── cctype │ │ ├── cerrno │ │ ├── cfloat │ │ ├── ciso646 │ │ ├── climits │ │ ├── clocale │ │ ├── cmath │ │ ├── complex │ │ ├── csetjmp │ │ ├── csignal │ │ ├── cstdarg │ │ ├── cstddef │ │ ├── cstdio │ │ ├── cstdlib │ │ ├── cstring │ │ ├── ctime │ │ ├── ctype.h │ │ ├── cwchar │ │ ├── cwctype │ │ ├── deque │ │ ├── errno.h │ │ ├── exception │ │ ├── exception.h │ │ ├── float.h │ │ ├── fstream │ │ ├── fstream.h │ │ ├── functional │ │ ├── hash_map │ │ ├── hash_set │ │ ├── iomanip │ │ ├── iomanip.h │ │ ├── ios │ │ ├── ios.h │ │ ├── iosfwd │ │ ├── iostream │ │ ├── iostream.h │ │ ├── iso646.h │ │ ├── istream │ │ ├── istream.h │ │ ├── iterator │ │ ├── limits │ │ ├── limits.h │ │ ├── list │ │ ├── locale │ │ ├── locale.h │ │ ├── map │ │ ├── math.h │ │ ├── mem.h │ │ ├── memory │ │ ├── new │ │ ├── new.h │ │ ├── numeric │ │ ├── ostream │ │ ├── ostream.h │ │ ├── pthread.h │ │ ├── pthread_alloc │ │ ├── queue │ │ ├── rlocks.h │ │ ├── rope │ │ ├── set │ │ ├── setjmp.h │ │ ├── signal.h │ │ ├── slist │ │ ├── sstream │ │ ├── stack │ │ ├── stdarg.h │ │ ├── stddef.h │ │ ├── stdexcept │ │ ├── stdio.h │ │ ├── stdiostream.h │ │ ├── stdlib.h │ │ ├── stl │ │ ├── _abbrevs.h │ │ ├── _algo.c │ │ ├── _algo.h │ │ ├── _algobase.c │ │ ├── _algobase.h │ │ ├── _alloc.c │ │ ├── _alloc.h │ │ ├── _alloc_old.h │ │ ├── _auto_ptr.h │ │ ├── _bitset.c │ │ ├── _bitset.h │ │ ├── _bvector.h │ │ ├── _carray.h │ │ ├── _cctype.h │ │ ├── _check_config.h │ │ ├── _clocale.h │ │ ├── _cmath.h │ │ ├── _codecvt.h │ │ ├── _collate.h │ │ ├── _complex.c │ │ ├── _complex.h │ │ ├── _config_compat_post.h │ │ ├── _construct.h │ │ ├── _csetjmp.h │ │ ├── _csignal.h │ │ ├── _cstdarg.h │ │ ├── _cstddef.h │ │ ├── _cstdio.h │ │ ├── _cstdlib.h │ │ ├── _cstring.h │ │ ├── _ctime.h │ │ ├── _ctraits_fns.h │ │ ├── _ctype.h │ │ ├── _cwchar.h │ │ ├── _cwctype.h │ │ ├── _deque.c │ │ ├── _deque.h │ │ ├── _epilog.h │ │ ├── _exception.h │ │ ├── _fstream.c │ │ ├── _fstream.h │ │ ├── _function.h │ │ ├── _function_adaptors.h │ │ ├── _function_base.h │ │ ├── _hash_fun.h │ │ ├── _hash_map.h │ │ ├── _hash_set.h │ │ ├── _hashtable.c │ │ ├── _hashtable.h │ │ ├── _heap.c │ │ ├── _heap.h │ │ ├── _ios.c │ │ ├── _ios.h │ │ ├── _ios_base.h │ │ ├── _ioserr.h │ │ ├── _iosfwd.h │ │ ├── _iostream_string.h │ │ ├── _istream.c │ │ ├── _istream.h │ │ ├── _istreambuf_iterator.h │ │ ├── _iterator.h │ │ ├── _iterator_base.h │ │ ├── _iterator_old.h │ │ ├── _limits.c │ │ ├── _limits.h │ │ ├── _list.c │ │ ├── _list.h │ │ ├── _locale.h │ │ ├── _map.h │ │ ├── _mbstate_t.h │ │ ├── _messages_facets.h │ │ ├── _monetary.c │ │ ├── _monetary.h │ │ ├── _move_construct_fwk.h │ │ ├── _new.h │ │ ├── _null_stream.h │ │ ├── _num_get.c │ │ ├── _num_get.h │ │ ├── _num_put.c │ │ ├── _num_put.h │ │ ├── _numeric.c │ │ ├── _numeric.h │ │ ├── _numpunct.h │ │ ├── _ostream.c │ │ ├── _ostream.h │ │ ├── _ostreambuf_iterator.h │ │ ├── _pair.h │ │ ├── _prolog.h │ │ ├── _pthread_alloc.h │ │ ├── _ptrs_specialize.h │ │ ├── _queue.h │ │ ├── _range_errors.h │ │ ├── _raw_storage_iter.h │ │ ├── _relops_cont.h │ │ ├── _relops_hash_cont.h │ │ ├── _rope.c │ │ ├── _rope.h │ │ ├── _set.h │ │ ├── _slist.c │ │ ├── _slist.h │ │ ├── _slist_base.c │ │ ├── _slist_base.h │ │ ├── _sparc_atomic.h │ │ ├── _sstream.c │ │ ├── _sstream.h │ │ ├── _stack.h │ │ ├── _stdexcept.h │ │ ├── _stdexcept_base.h │ │ ├── _stlport_version.h │ │ ├── _stream_iterator.h │ │ ├── _streambuf.c │ │ ├── _streambuf.h │ │ ├── _string.c │ │ ├── _string.h │ │ ├── _string_base.h │ │ ├── _string_fwd.h │ │ ├── _string_hash.h │ │ ├── _string_io.c │ │ ├── _string_io.h │ │ ├── _string_npos.h │ │ ├── _string_operators.h │ │ ├── _string_sum.h │ │ ├── _string_sum_methods.h │ │ ├── _string_workaround.h │ │ ├── _strstream.h │ │ ├── _tempbuf.c │ │ ├── _tempbuf.h │ │ ├── _threads.c │ │ ├── _threads.h │ │ ├── _time_facets.c │ │ ├── _time_facets.h │ │ ├── _tree.c │ │ ├── _tree.h │ │ ├── _typeinfo.h │ │ ├── _uninitialized.h │ │ ├── _unordered_map.h │ │ ├── _unordered_set.h │ │ ├── _valarray.c │ │ ├── _valarray.h │ │ ├── _vector.c │ │ ├── _vector.h │ │ ├── boost_type_traits.h │ │ ├── c_locale.h │ │ ├── char_traits.h │ │ ├── concept_checks.h │ │ ├── config │ │ │ ├── _aix.h │ │ │ ├── _apcc.h │ │ │ ├── _apple.h │ │ │ ├── _as400.h │ │ │ ├── _auto_link.h │ │ │ ├── _bc.h │ │ │ ├── _como.h │ │ │ ├── _cray.h │ │ │ ├── _cygwin.h │ │ │ ├── _dec.h │ │ │ ├── _dec_vms.h │ │ │ ├── _detect_dll_or_lib.h │ │ │ ├── _dm.h │ │ │ ├── _epilog.h │ │ │ ├── _evc.h │ │ │ ├── _freebsd.h │ │ │ ├── _fujitsu.h │ │ │ ├── _gcc.h │ │ │ ├── _hpacc.h │ │ │ ├── _hpux.h │ │ │ ├── _ibm.h │ │ │ ├── _icc.h │ │ │ ├── _intel.h │ │ │ ├── _kai.h │ │ │ ├── _linux.h │ │ │ ├── _mac.h │ │ │ ├── _macosx.h │ │ │ ├── _mlc.h │ │ │ ├── _msvc.h │ │ │ ├── _mwccnlm.h │ │ │ ├── _mwerks.h │ │ │ ├── _native_headers.h │ │ │ ├── _netware.h │ │ │ ├── _openbsd.h │ │ │ ├── _prolog.h │ │ │ ├── _sgi.h │ │ │ ├── _solaris.h │ │ │ ├── _sunprocc.h │ │ │ ├── _symantec.h │ │ │ ├── _system.h │ │ │ ├── _warnings_off.h │ │ │ ├── _watcom.h │ │ │ ├── _windows.h │ │ │ ├── compat.h │ │ │ ├── features.h │ │ │ ├── host.h │ │ │ ├── stl_confix.h │ │ │ ├── stl_mycomp.h │ │ │ └── user_config.h │ │ ├── debug │ │ │ ├── _debug.c │ │ │ ├── _debug.h │ │ │ ├── _deque.h │ │ │ ├── _hashtable.h │ │ │ ├── _iterator.h │ │ │ ├── _list.h │ │ │ ├── _slist.h │ │ │ ├── _string.h │ │ │ ├── _string_sum_methods.h │ │ │ ├── _tree.h │ │ │ └── _vector.h │ │ ├── msl_string.h │ │ ├── pointers │ │ │ ├── _deque.h │ │ │ ├── _list.h │ │ │ ├── _set.h │ │ │ ├── _slist.h │ │ │ ├── _tools.h │ │ │ └── _vector.h │ │ ├── type_manips.h │ │ └── type_traits.h │ │ ├── streambuf │ │ ├── streambuf.h │ │ ├── string │ │ ├── string.h │ │ ├── strstream │ │ ├── strstream.h │ │ ├── time.h │ │ ├── typeinfo │ │ ├── typeinfo.h │ │ ├── unordered_map │ │ ├── unordered_set │ │ ├── using │ │ ├── cstring │ │ ├── export │ │ ├── fstream │ │ ├── h │ │ │ ├── fstream.h │ │ │ ├── iomanip.h │ │ │ ├── iostream.h │ │ │ ├── ostream.h │ │ │ ├── streambuf.h │ │ │ └── strstream.h │ │ ├── iomanip │ │ ├── ios │ │ ├── iosfwd │ │ ├── iostream │ │ ├── istream │ │ ├── locale │ │ ├── ostream │ │ ├── sstream │ │ ├── streambuf │ │ └── strstream │ │ ├── utility │ │ ├── valarray │ │ ├── vector │ │ ├── wchar.h │ │ └── wctype.h ├── random │ ├── CMakeLists.txt │ ├── entropy.cpp │ ├── entropy.h │ ├── mersenne.h │ ├── mersenne32.h │ ├── mersenne64.h │ ├── mersenne_ut.cpp │ ├── randcpp.cpp │ ├── randcpp.h │ ├── randcpp_ut.cpp │ ├── random.cpp │ ├── random.h │ ├── random_ut.cpp │ ├── rc4.cpp │ ├── rc4.h │ ├── shuffle.h │ └── shuffle_ut.cpp ├── regexp │ ├── CMakeLists.txt │ ├── glob.cpp │ ├── glob_compat.h │ ├── regexp.cpp │ ├── regexp.h │ └── regexp_ut.cpp ├── save_stl.h ├── server │ ├── CMakeLists.txt │ ├── http.cpp │ ├── http.h │ ├── http_ut.cpp │ ├── listen.cpp │ ├── listen.h │ ├── options.cpp │ ├── options.h │ ├── static.cpp │ └── static.h ├── sorter │ ├── CMakeLists.txt │ ├── buffile.h │ ├── filesort.h │ ├── filesortst.h │ ├── sorter.cpp │ ├── sorter.h │ ├── sorter_ut.cpp │ └── sorttree.h ├── spars_ar.h ├── static_hash.h ├── static_hash_map.h ├── static_hash_ut.cpp ├── sthash_iterators.h ├── str_hash.cpp ├── str_hash.h ├── str_map.h ├── str_stl.h ├── stream │ ├── CMakeLists.txt │ ├── aligned.h │ ├── base.h │ ├── buffer.cpp │ ├── buffer.h │ ├── buffered.cpp │ ├── buffered.h │ ├── bzip2.cpp │ ├── bzip2.h │ ├── bzip2_ut.cpp │ ├── chunk.cpp │ ├── chunk.h │ ├── chunk_ut.cpp │ ├── debug.cpp │ ├── debug.h │ ├── file.cpp │ ├── file.h │ ├── format.cpp │ ├── format.h │ ├── format_ut.cpp │ ├── glue.cpp │ ├── glue.h │ ├── helpers.cpp │ ├── helpers.h │ ├── http.cpp │ ├── http.h │ ├── http_ut.cpp │ ├── input.cpp │ ├── input.h │ ├── ios.h │ ├── ios_ut.cpp │ ├── length.h │ ├── lz.cpp │ ├── lz.h │ ├── lz_ut.cpp │ ├── lzma.cpp │ ├── lzma.h │ ├── lzma_ut.cpp │ ├── mem.cpp │ ├── mem.h │ ├── multi.cpp │ ├── multi.h │ ├── null.cpp │ ├── null.h │ ├── output.cpp │ ├── output.h │ ├── pipe.cpp │ ├── pipe.h │ ├── printf.cpp │ ├── printf.h │ ├── printf_ut.cpp │ ├── str.cpp │ ├── str.h │ ├── tee.cpp │ ├── tee.h │ ├── tempbuf.h │ ├── tokenizer.h │ ├── trace.h │ ├── walk.h │ ├── zerocopy.cpp │ ├── zerocopy.h │ ├── zlib.cpp │ ├── zlib.h │ └── zlib_ut.cpp ├── string │ ├── CMakeLists.txt │ ├── ascii.cpp │ ├── ascii.h │ ├── base64.cpp │ ├── base64.h │ ├── base64_ut.cpp │ ├── cast.cpp │ ├── cast.h │ ├── cast_ut.cpp │ ├── cat.h │ ├── cgiparam.cpp │ ├── cgiparam.h │ ├── cgiparam_ut.cpp │ ├── cstriter.h │ ├── dtoa.cpp │ ├── dtoa.i │ ├── dtoa_impl.cpp │ ├── encodexml.cpp │ ├── encodexml.h │ ├── encodexml_ut.cpp │ ├── escape.cpp │ ├── escape.h │ ├── escape_ut.cpp │ ├── hex.h │ ├── hex_ut.cpp │ ├── htmlentgp.gperf │ ├── htmlentity.cpp │ ├── htmlentity.h │ ├── htmlentity_ut.cpp │ ├── http.cpp │ ├── http.h │ ├── http_ut.cpp │ ├── kmp.cpp │ ├── kmp.h │ ├── kmp_ut.cpp │ ├── pcdata.cpp │ ├── pcdata.h │ ├── pcdata_ut.cpp │ ├── printf.cpp │ ├── printf.h │ ├── printf_ut.cpp │ ├── quote.cpp │ ├── quote.h │ ├── quote_ut.cpp │ ├── scan.h │ ├── split.cpp │ ├── split.h │ ├── split_iterator.cpp │ ├── split_iterator.h │ ├── split_iterator_ut.cpp │ ├── split_ut.cpp │ ├── strip.cpp │ ├── strip.h │ ├── strip_ut.cpp │ ├── strspn.h │ ├── subst.h │ ├── subst_ut.cpp │ ├── traits.h │ ├── type.cpp │ ├── type.h │ ├── type_ut.cpp │ ├── url.cpp │ ├── url.h │ ├── url_ut.cpp │ ├── util.cpp │ ├── util.h │ ├── util_ut.cpp │ ├── vector.cpp │ └── vector.h ├── system │ ├── CMakeLists.txt │ ├── align.h │ ├── align_ut.cpp │ ├── atexit.cpp │ ├── atexit.h │ ├── atexit_ut.cpp │ ├── atomic.h │ ├── atomic_fake.h │ ├── atomic_gcc.h │ ├── atomic_ut.cpp │ ├── atomic_win.h │ ├── atomic_x86.h │ ├── backtrace.cpp │ ├── backtrace.h │ ├── backtrace_ut.cpp │ ├── byteorder.h │ ├── byteorder_ut.cpp │ ├── compat.cpp │ ├── compat.h │ ├── compat_ut.cpp │ ├── condvar.cpp │ ├── condvar.h │ ├── condvar_ut.cpp │ ├── context.cpp │ ├── context.h │ ├── context_i686.asm │ ├── context_i686.h │ ├── context_x86.asm │ ├── context_x86.h │ ├── context_x86_64.asm │ ├── context_x86_64.h │ ├── daemon.cpp │ ├── daemon.h │ ├── datetime.cpp │ ├── datetime.h │ ├── datetime_ut.cpp │ ├── defaults.h │ ├── demangle.cpp │ ├── demangle.h │ ├── demangle_ut.cpp │ ├── dynlib.cpp │ ├── dynlib.h │ ├── err.cpp │ ├── error.cpp │ ├── error.h │ ├── error_ut.cpp │ ├── event.cpp │ ├── event.h │ ├── event_ut.cpp │ ├── execpath.cpp │ ├── execpath.h │ ├── execpath_ut.cpp │ ├── file.cpp │ ├── file.h │ ├── file_ut.cpp │ ├── filemap.cpp │ ├── filemap.h │ ├── filemap_ut.cpp │ ├── flock.cpp │ ├── flock.h │ ├── flock_ut.cpp │ ├── freeBSD_mktemp.cpp │ ├── fs.cpp │ ├── fs.h │ ├── fstat.cpp │ ├── fstat.h │ ├── guard.h │ ├── guard_ut.cpp │ ├── hostname.cpp │ ├── hostname.h │ ├── hostname_ut.cpp │ ├── info.cpp │ ├── info.h │ ├── info_ut.cpp │ ├── maxlen.h │ ├── mktemp.cpp │ ├── mktemp.h │ ├── mutex.cpp │ ├── mutex.h │ ├── mutex_ut.cpp │ ├── oldfile.cpp │ ├── oldfile.h │ ├── pipe.cpp │ ├── pipe.h │ ├── pipe_ut.cpp │ ├── platform.h │ ├── platform_ut.cpp │ ├── progname.cpp │ ├── progname.h │ ├── progname_ut.cpp │ ├── rusage.cpp │ ├── rusage.h │ ├── rusage_ut.cpp │ ├── rwlock.cpp │ ├── rwlock.h │ ├── rwlock_ut.cpp │ ├── sem.cpp │ ├── sem.h │ ├── sem_ut.cpp │ ├── sigset.h │ ├── spinlock.cpp │ ├── spinlock.h │ ├── strlcpy.c │ ├── tempfile.h │ ├── thread.cpp │ ├── thread.h │ ├── thread.i │ ├── thread_ut.cpp │ ├── tls.cpp │ ├── tls.h │ ├── user.cpp │ ├── user.h │ ├── utime.h │ ├── valgrind.h │ ├── yassert.cpp │ ├── yassert.h │ ├── yassert_ut.cpp │ ├── yield.cpp │ └── yield.h ├── thread │ ├── CMakeLists.txt │ ├── lfqueue.h │ ├── lfstack.h │ ├── pool.cpp │ ├── pool.h │ ├── pool_ut.cpp │ ├── queue.cpp │ ├── queue.h │ ├── queue_ut.cpp │ ├── tasks.cpp │ ├── tasks.h │ ├── tasks_ut.cpp │ └── threadable.h ├── uri │ ├── CMakeLists.txt │ ├── assign.cpp │ ├── common.cpp │ ├── common.h │ ├── encode.cpp │ ├── encode.h │ ├── encode.rl │ ├── other.cpp │ ├── other.h │ ├── parse.cpp │ ├── parse.h │ ├── parse.rl │ ├── uri-ru_ut.cpp │ ├── uri.cpp │ ├── uri.h │ └── uri_ut.cpp ├── yarchive.cpp ├── yarchive.h ├── yarchive_ut.cpp ├── ycoroutine.h ├── ysafeptr.cpp ├── ysafeptr.h ├── ysaveload.cpp ├── ysaveload.h └── ysaveload_ut.cpp └── web └── httpd ├── factory ├── CMakeLists.txt ├── common.cpp └── common.h ├── kernel ├── CMakeLists.txt ├── address.h ├── alloc.cpp ├── alloc.h ├── bufalloc.h ├── cast.h ├── chunks.cpp ├── chunks.h ├── chunkstring.h ├── chunkstring_ut.cpp ├── concat.h ├── config.h ├── countio.h ├── errors.h ├── factory.h ├── format.cpp ├── format.h ├── headers.cpp ├── headers.h ├── http.cpp ├── http.h ├── httpfsm.rl ├── iface.cpp ├── iface.h ├── iobase.cpp ├── iobase.h ├── iterator.h ├── limitio.h ├── log.cpp ├── log.h ├── luacfg.cpp ├── luacfg.h ├── main.cpp ├── main.h ├── module.h ├── null.cpp ├── null.h ├── precharge.h ├── queue.h ├── regexp.cpp ├── regexp.h ├── rewind.h ├── socket.cpp ├── socket.h ├── split.h ├── stream.h └── syncro.h ├── modules ├── CMakeLists.txt ├── accesslog │ ├── CMakeLists.txt │ ├── module.cpp │ └── module.h ├── admin │ ├── CMakeLists.txt │ ├── fsm.rl │ ├── module.cpp │ └── module.h ├── balancer │ ├── CMakeLists.txt │ ├── arbiter.cpp │ ├── arbiter.h │ ├── average.h │ ├── backend.cpp │ ├── backend.h │ ├── defs.h │ ├── deviation.h │ ├── fair.cpp │ ├── fair.h │ ├── hashing.cpp │ ├── hashing.h │ ├── iterator.cpp │ ├── iterator.h │ ├── module.cpp │ ├── module.h │ ├── pidgroup.cpp │ ├── pidgroup.h │ ├── robust.cpp │ ├── robust.h │ ├── rrobin.cpp │ ├── rrobin.h │ ├── smartrr.cpp │ ├── smartrr.h │ ├── weighted.cpp │ ├── weighted.h │ ├── weighted2.cpp │ └── weighted2.h ├── debug │ ├── CMakeLists.txt │ ├── module.cpp │ └── module.h ├── errorlog │ ├── CMakeLists.txt │ ├── module.cpp │ └── module.h ├── headers │ ├── CMakeLists.txt │ ├── module.cpp │ └── module.h ├── http │ ├── CMakeLists.txt │ ├── encoder.h │ ├── module.cpp │ └── module.h ├── ipdisp │ ├── CMakeLists.txt │ ├── module.cpp │ └── module.h ├── pinger │ ├── CMakeLists.txt │ ├── module.cpp │ └── module.h ├── proxy │ ├── CMakeLists.txt │ ├── module.cpp │ ├── module.h │ ├── proxy.cpp │ └── proxy.h ├── regexp │ ├── CMakeLists.txt │ ├── module.cpp │ ├── module.h │ └── optvalue.h ├── shared │ ├── CMakeLists.txt │ ├── module.cpp │ └── module.h ├── spdy │ ├── CMakeLists.txt │ ├── module.cpp │ ├── module.h │ └── zlib.h ├── static │ ├── CMakeLists.txt │ ├── module.cpp │ ├── module.h │ └── queue.h ├── stats │ ├── CMakeLists.txt │ ├── module.cpp │ └── module.h └── tls │ ├── CMakeLists.txt │ ├── module.cpp │ ├── module.h │ ├── tlsio.cpp │ └── tlsio.h └── server ├── CMakeLists.txt └── main.cpp /cmake/include/FindRagel.cmake: -------------------------------------------------------------------------------- 1 | INCLUDE(${CMAKE_MODULE_PATH}/MakefileHelpers.cmake) 2 | 3 | TOOLDIR_EX( 4 | contrib/tools/ragel6 __ragel6_ 5 | ) 6 | 7 | SET(RAGEL6 ${__ragel6_}) 8 | 9 | MACRO (BUILDWITH_RAGEL6 srcfile dstfile) 10 | ADD_CUSTOM_COMMAND( 11 | OUTPUT "${dstfile}" 12 | COMMAND "${RAGEL6}" ${RAGEL6_FLAGS} -o "${dstfile}" "${srcfile}" 13 | MAIN_DEPENDENCY "${srcfile}" 14 | DEPENDS "${srcfile}" ragel6 ${ARGN} 15 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 16 | COMMENT "Building \"${dstfile}\" with ragel6" 17 | ) 18 | SOURCE_GROUP("Custom Builds" FILES ${srcfile}) 19 | SOURCE_GROUP("Generated" FILES ${dstfile}) 20 | ENDMACRO (BUILDWITH_RAGEL6) 21 | 22 | IF (WIN32) 23 | SET_IF_NOTSET(RAGEL6_FLAGS -mCG2) 24 | ELSE (WIN32) 25 | SET_IF_NOTSET(RAGEL6_FLAGS -CG2) 26 | ENDIF (WIN32) 27 | -------------------------------------------------------------------------------- /cmake/include/_cmake_fake_src.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/balancer/dc4ace0b9f72b0839a6e112f65ba288d81770118/cmake/include/_cmake_fake_src.cpp -------------------------------------------------------------------------------- /cmake/include/fict_exe_source.cpp: -------------------------------------------------------------------------------- 1 | int main() {return 0;}; 2 | -------------------------------------------------------------------------------- /cmake/include/sortpeerlibs.awk: -------------------------------------------------------------------------------- 1 | #!/bin/awk 2 | 3 | BEGIN { 4 | # parse peerdir variable 5 | { 6 | while (length(peerdir) > 0) { 7 | p = peerdir; 8 | if (p ~ /\;/) { 9 | sub(/^[^\;]+\;/, "", peerdir); 10 | p = substr(p, 1, length(p) - length(peerdir) - 1); 11 | } else { 12 | peerdir = ""; 13 | } 14 | if (length(statfile) > 0) { 15 | print p "\n" >> statfile; 16 | } 17 | 18 | peerdirs[p] = 1; 19 | } 20 | } 21 | } 22 | 23 | { 24 | if (peerdirs[$0] > 0) { 25 | ordered = ordered " " $0; 26 | peerdirs[$0] = 2; 27 | } 28 | } 29 | 30 | END { 31 | # check if all of peerdirs have been reordered 32 | for (i in peerdirs) { 33 | if (peerdirs[i] == 1) { 34 | ordered = ordered " " i; 35 | absent = absent " " i; 36 | } 37 | } 38 | print ordered; 39 | print absent > "/dev/stderr"; 40 | } 41 | -------------------------------------------------------------------------------- /cmake/include/ut_template.cmake: -------------------------------------------------------------------------------- 1 | PROGRAM(@UT_PRJNAME@${UT_SUFFIX}) 2 | SRCS( 3 | #${ARCADIA_ROOT}/unittest/lib/utmain.cpp 4 | @UT_SRCS@ 5 | ) 6 | 7 | PEERDIR( 8 | library/unittest 9 | ) 10 | 11 | SET(USE_J_ALLOCATOR no) 12 | SET(USE_GOOGLE_ALLOCATOR no) 13 | SET(USE_LF_ALLOCATOR no) 14 | 15 | DEBUGMESSAGE(3 "-- unittest: [@UT_PRJNAME @${UT_SUFFIX}], srcs: ${SRCS}") 16 | 17 | CFLAGS(@CFLAGS@) 18 | CXXFLAGS(@CXXFLAGS@) 19 | SET(DTMK_I @DTMK_I@) 20 | @UT_PERDIR_PEERDIR@ 21 | @UT_DEPENDS@ 22 | 23 | IF (UT_EXCLUDE_FROM_ALL) 24 | EXCLUDE_FROM_ALL() 25 | ENDIF (UT_EXCLUDE_FROM_ALL) 26 | 27 | ADD_DEPENDENCIES(all_ut @UT_PRJNAME@${UT_SUFFIX}) 28 | 29 | END() 30 | -------------------------------------------------------------------------------- /cmake/include/ysversion.cmake: -------------------------------------------------------------------------------- 1 | DEFAULT(CPACK_PACKAGE_VERSION_MAJOR 4) 2 | DEFAULT(CPACK_PACKAGE_VERSION_MINOR 0) 3 | DEFAULT(CPACK_PACKAGE_VERSION_PATCH 0) 4 | DEFAULT(CPACK_PACKAGE_NAME "Yandex_Server") 5 | DEFAULT(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CMAKE_SYSTEM_NAME}${FREEBSD_VER}${FREEBSD_VER_MINOR}-${HARDWARE_TYPE}) 6 | 7 | CFLAGS("-DYSVERSION1=${CPACK_PACKAGE_VERSION_MAJOR}") 8 | CFLAGS("-DYSVERSION2=${CPACK_PACKAGE_VERSION_MINOR}") 9 | CFLAGS("-DYSVERSION3=${CPACK_PACKAGE_VERSION_PATCH}") 10 | IF (WIN32) 11 | CFLAGS("-DYSPACKAGE='${CPACK_PACKAGE_FILE_NAME}'") 12 | ELSE (WIN32) 13 | CFLAGS("-DYSPACKAGE='\"${CPACK_PACKAGE_FILE_NAME}\"'") 14 | ENDIF (WIN32) 15 | 16 | -------------------------------------------------------------------------------- /contrib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | RECURSE( 2 | contrib/libs 3 | contrib/tools 4 | ) 5 | -------------------------------------------------------------------------------- /contrib/libs/fastlz/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | 6 | SRCS( 7 | fastlz.c 8 | rename.h 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /contrib/libs/fastlz/rename.h: -------------------------------------------------------------------------------- 1 | #ifndef rename_h_7d8f6576asdf5 2 | #define rename_h_7d8f6576asdf5 3 | 4 | #define fastlz_compress yfastlz_compress 5 | #define fastlz_decompress yfastlz_decompress 6 | #define fastlz_compress_level yfastlz_compress_level 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /contrib/libs/libbz2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | 6 | SRCS( 7 | randtable.c 8 | crctable.c 9 | compress.c 10 | bzlib.c 11 | decompress.c 12 | blocksort.c 13 | huffman.c 14 | ) 15 | 16 | END() 17 | -------------------------------------------------------------------------------- /contrib/libs/libbz2/gen.sh: -------------------------------------------------------------------------------- 1 | #1 /bin/sh 2 | cat *.c *.h | grep BZ_API | sed -e 's/.*BZ_API//' | grep BZ | sed -e 's/ .*//' |sed -e 's/(//' | sed -e 's/)//' | sort |uniq | grep -v '(' | while read l; do echo "#define $l Arc$l"; done 3 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | 6 | SRCS( 7 | genaliases.c 8 | genaliases2.c 9 | #genflags.c 10 | #gentranslit.c 11 | iconv.c 12 | #relocatable.c 13 | ) 14 | 15 | END() 16 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/aliases_aix.h: -------------------------------------------------------------------------------- 1 | S(aix_0, "CP856", ei_cp856 ) 2 | S(aix_1, "CP922", ei_cp922 ) 3 | S(aix_2, "CP943", ei_cp943 ) 4 | S(aix_3, "CP1046", ei_cp1046 ) 5 | S(aix_4, "CP1124", ei_cp1124 ) 6 | S(aix_5, "CP1129", ei_cp1129 ) 7 | S(aix_6, "CP1161", ei_cp1161 ) 8 | S(aix_7, "IBM1161", ei_cp1161 ) 9 | S(aix_8, "IBM-1161", ei_cp1161 ) 10 | S(aix_9, "CSIBM1161", ei_cp1161 ) 11 | S(aix_10, "CP1162", ei_cp1162 ) 12 | S(aix_11, "IBM1162", ei_cp1162 ) 13 | S(aix_12, "IBM-1162", ei_cp1162 ) 14 | S(aix_13, "CSIBM1162", ei_cp1162 ) 15 | S(aix_14, "CP1163", ei_cp1163 ) 16 | S(aix_15, "IBM1163", ei_cp1163 ) 17 | S(aix_16, "IBM-1163", ei_cp1163 ) 18 | S(aix_17, "CSIBM1163", ei_cp1163 ) 19 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/aliases_extra.h: -------------------------------------------------------------------------------- 1 | S(extra_0, "EUC-JISX0213", ei_euc_jisx0213 ) 2 | S(extra_1, "EUC-JIS-2004", ei_euc_jisx0213 ) 3 | S(extra_2, "SHIFT_JISX0213", ei_shift_jisx0213 ) 4 | S(extra_3, "SHIFT_JIS-2004", ei_shift_jisx0213 ) 5 | S(extra_4, "ISO-2022-JP-3", ei_iso2022_jp3 ) 6 | S(extra_5, "ISO-2022-JP-2004", ei_iso2022_jp3 ) 7 | S(extra_6, "BIG5-2003", ei_big5_2003 ) 8 | S(extra_7, "TDS565", ei_tds565 ) 9 | S(extra_8, "ISO-IR-230", ei_tds565 ) 10 | S(extra_9, "ATARIST", ei_atarist ) 11 | S(extra_10, "ATARI", ei_atarist ) 12 | S(extra_11, "RISCOS-LATIN1", ei_riscos1 ) 13 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/aliases_osf1.h: -------------------------------------------------------------------------------- 1 | S(osf1_0, "DEC-KANJI", ei_dec_kanji ) 2 | S(osf1_1, "DEC-HANYU", ei_dec_hanyu ) 3 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/aliases_osf1_sysosf1.h: -------------------------------------------------------------------------------- 1 | S(osf1_0, "DEC-KANJI", ei_dec_kanji ) 2 | S(osf1_1, "DECKANJI", ei_dec_kanji ) 3 | S(osf1_2, "DEC-HANYU", ei_dec_hanyu ) 4 | S(osf1_3, "DECHANYU", ei_dec_hanyu ) 5 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/canonical_aix.h: -------------------------------------------------------------------------------- 1 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_0, 2 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_1, 3 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_2, 4 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_3, 5 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_4, 6 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_5, 7 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_6, 8 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_10, 9 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_14, 10 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/canonical_aix_sysaix.h: -------------------------------------------------------------------------------- 1 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_0, 2 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_2, 3 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_4, 4 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_6, 5 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_8, 6 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_10, 7 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_12, 8 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_16, 9 | (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_20, 10 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/canonical_extra.h: -------------------------------------------------------------------------------- 1 | (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_0, 2 | (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_2, 3 | (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_4, 4 | (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_6, 5 | (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_7, 6 | (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_9, 7 | (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_11, 8 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/canonical_local.h: -------------------------------------------------------------------------------- 1 | (int)(long)&((struct stringpool_t *)0)->stringpool_str271, 2 | (int)(long)&((struct stringpool_t *)0)->stringpool_str664, 3 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/canonical_local_sysaix.h: -------------------------------------------------------------------------------- 1 | (int)(long)&((struct stringpool_t *)0)->stringpool_str307, 2 | (int)(long)&((struct stringpool_t *)0)->stringpool_str543, 3 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/canonical_local_syshpux.h: -------------------------------------------------------------------------------- 1 | (int)(long)&((struct stringpool_t *)0)->stringpool_str258, 2 | (int)(long)&((struct stringpool_t *)0)->stringpool_str390, 3 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/canonical_local_sysosf1.h: -------------------------------------------------------------------------------- 1 | (int)(long)&((struct stringpool_t *)0)->stringpool_str275, 2 | (int)(long)&((struct stringpool_t *)0)->stringpool_str465, 3 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/canonical_local_syssolaris.h: -------------------------------------------------------------------------------- 1 | (int)(long)&((struct stringpool_t *)0)->stringpool_str38, 2 | (int)(long)&((struct stringpool_t *)0)->stringpool_str515, 3 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/canonical_osf1.h: -------------------------------------------------------------------------------- 1 | (int)(long)&((struct stringpool2_t *)0)->stringpool_osf1_0, 2 | (int)(long)&((struct stringpool2_t *)0)->stringpool_osf1_1, 3 | -------------------------------------------------------------------------------- /contrib/libs/libiconv/canonical_osf1_sysosf1.h: -------------------------------------------------------------------------------- 1 | (int)(long)&((struct stringpool2_t *)0)->stringpool_osf1_0, 2 | (int)(long)&((struct stringpool2_t *)0)->stringpool_osf1_2, 3 | -------------------------------------------------------------------------------- /contrib/libs/lua/common/stdlib.lua: -------------------------------------------------------------------------------- 1 | function range(i, j) 2 | local function rangeGenerator() 3 | while i < j do 4 | coroutine.yield(i) 5 | i = i + 1 6 | end 7 | end 8 | 9 | return coroutine.wrap(rangeGenerator) 10 | end 11 | -------------------------------------------------------------------------------- /contrib/libs/lua/lua-5.1.4/src/lapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lapi.h,v 1.1 2008-09-16 07:57:53 pg Exp $ 3 | ** Auxiliary functions from Lua API 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lapi_h 8 | #define lapi_h 9 | 10 | 11 | #include "lobject.h" 12 | 13 | 14 | LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /contrib/libs/lua/lua-5.1.4/test/bisect.lua: -------------------------------------------------------------------------------- 1 | -- bisection method for solving non-linear equations 2 | 3 | delta=1e-6 -- tolerance 4 | 5 | function bisect(f,a,b,fa,fb) 6 | local c=(a+b)/2 7 | io.write(n," c=",c," a=",a," b=",b,"\n") 8 | if c==a or c==b or math.abs(a-b) 2 | #include 3 | #include 4 | -------------------------------------------------------------------------------- /contrib/libs/lz4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | SRCS( 6 | lz4.c 7 | lz4hc.c 8 | mmc.c 9 | ) 10 | 11 | END() -------------------------------------------------------------------------------- /contrib/libs/lz4/README: -------------------------------------------------------------------------------- 1 | http://code.google.com/p/lz4/ 2 | http://fastcompression.blogspot.com/2011/05/lz4-explained.html 3 | http://altdevblogaday.com/2011/04/22/survey-of-fast-compression-algorithms-part-1/ -------------------------------------------------------------------------------- /contrib/libs/lzmasdk/Alloc.h: -------------------------------------------------------------------------------- 1 | /* Alloc.h -- Memory allocation functions 2 | 2008-03-13 3 | Igor Pavlov 4 | Public domain */ 5 | 6 | #ifndef __COMMON_ALLOC_H 7 | #define __COMMON_ALLOC_H 8 | 9 | #include 10 | 11 | void *MyAlloc(size_t size); 12 | void MyFree(void *address); 13 | 14 | #ifdef _WIN32 15 | 16 | void SetLargePageSize(); 17 | 18 | void *MidAlloc(size_t size); 19 | void MidFree(void *address); 20 | void *BigAlloc(size_t size); 21 | void BigFree(void *address); 22 | 23 | #else 24 | 25 | #define MidAlloc(size) MyAlloc(size) 26 | #define MidFree(address) MyFree(address) 27 | #define BigAlloc(size) MyAlloc(size) 28 | #define BigFree(address) MyFree(address) 29 | 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /contrib/libs/lzmasdk/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | SRCS( 6 | 7zStream.c 7 | Alloc.c 8 | LzmaDec.c 9 | LzmaEnc.c 10 | LzFind.c 11 | LzmaLib.c 12 | LzmaUtil.c 13 | ) 14 | 15 | END() 16 | -------------------------------------------------------------------------------- /contrib/libs/lzmasdk/LzmaUtil.h: -------------------------------------------------------------------------------- 1 | #ifndef lzma_util_h_sf6g5as78df6 2 | #define lzma_util_h_sf6g5as78df6 3 | 4 | #include "Types.h" 5 | #include "LzmaDec.h" 6 | 7 | SRes Decode2(CLzmaDec *state, ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 unpackSize); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /contrib/libs/matrixssl/src/yandex.c: -------------------------------------------------------------------------------- 1 | /* Made in Yandex */ 2 | 3 | #include "matrixInternal.h" 4 | 5 | void matrixSslClearByteCount(ssl_t *ctx) { 6 | #ifdef USE_ARC4 7 | ctx->sec.decryptCtx.arc4.byteCount = 0; 8 | #endif 9 | } 10 | -------------------------------------------------------------------------------- /contrib/libs/matrixssl/yandex.h: -------------------------------------------------------------------------------- 1 | /* Made in Yandex */ 2 | 3 | #ifndef _h_YANDEX 4 | #define _h_YANDEX 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | void matrixSslClearByteCount(ssl_t *ctx); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif /* _h_YANDEX */ 17 | -------------------------------------------------------------------------------- /contrib/libs/matrixssl3/Makefile.cfg.cmake: -------------------------------------------------------------------------------- 1 | SRCDIR( 2 | contrib/libs/matrixssl3 3 | ) 4 | -------------------------------------------------------------------------------- /contrib/libs/matrixssl3/matrixSsl.h: -------------------------------------------------------------------------------- 1 | #include "matrixssl/matrixsslApi.h" 2 | -------------------------------------------------------------------------------- /contrib/libs/matrixssl3/matrixssl/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 PeerSec Networks, Inc. 3 | This file is auto-generated 4 | */ 5 | #ifndef _h_MATRIXSSL_VERSION 6 | #define _h_MATRIXSSL_VERSION 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define MATRIXSSL_VERSION "3.2.1-OPEN" 12 | #define MATRIXSSL_VERSION_MAJOR 3 13 | #define MATRIXSSL_VERSION_MINOR 2 14 | #define MATRIXSSL_VERSION_PATCH 1 15 | #define MATRIXSSL_VERSION_CODE "OPEN" 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | #endif /* _h_MATRIXSSL_VERSION */ 21 | 22 | -------------------------------------------------------------------------------- /contrib/libs/minilzo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | 6 | SRCS( 7 | minilzo.c 8 | ) 9 | 10 | END() 11 | -------------------------------------------------------------------------------- /contrib/libs/minilzo/protect.h: -------------------------------------------------------------------------------- 1 | #ifndef protect_h_as7d576df 2 | #define protect_h_as7d576df 3 | 4 | #define lzo1x_1_compress ylzo1x_1_compress 5 | #define lzo1x_decompress ylzo1x_decompress 6 | #define lzo1x_decompress_safe ylzo1x_decompress_safe 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /contrib/libs/pcre/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | 6 | CFLAGS( 7 | -DHAVE_CONFIG_H 8 | ) 9 | 10 | SRCS( 11 | pcre_compile.c 12 | pcre_config.c 13 | pcre_dfa_exec.c 14 | pcre_exec.c 15 | pcre_fullinfo.c 16 | pcre_get.c 17 | pcre_globals.c 18 | pcre_info.c 19 | pcre_maketables.c 20 | pcre_newline.c 21 | pcre_ord2utf8.c 22 | pcre_refcount.c 23 | pcre_study.c 24 | pcre_tables.c 25 | pcre_try_flipped.c 26 | pcre_ucp_searchfuncs.c 27 | pcre_valid_utf8.c 28 | pcre_version.c 29 | pcre_xclass.c 30 | pcre_chartables.c 31 | pcreposix.c 32 | ) 33 | 34 | END() 35 | -------------------------------------------------------------------------------- /contrib/libs/pcre/preprocess.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | echo "#ifndef rename_h_as7d46as4d" > rename.h 4 | echo "#define rename_h_as7d46as4d" >> rename.h 5 | 6 | cat pcre.h | grep PCRE_EXP_DECL | grep -v '#' | grep '(' | sed -e 's/(\*//' | sed -e 's/[()].*//' | sed -e 's/.*[ *]//' | sort | uniq | while read l; do echo "#define $l internal_$l"; done >> rename.h 7 | 8 | cat pcreposix.h | grep PCREPOSIX_EXP_DECL | grep -v '#' | grep '(' | sed -e 's/(\*//' | sed -e 's/[()].*//' | sed -e 's/.*[ *]//' | sort | uniq | while read l; do echo "#define $l internal_$l"; done >> rename.h 9 | 10 | echo "#endif" >> rename.h 11 | -------------------------------------------------------------------------------- /contrib/libs/pire/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | SUBDIRS = pire tests pkg samples 3 | -------------------------------------------------------------------------------- /contrib/libs/pire/README: -------------------------------------------------------------------------------- 1 | This is PIRE, Perl Incompatible Regular Expressions library. 2 | 3 | Please report bugs to dprokoptsev@yandex-team.ru or davenger@yandex-team.ru. 4 | -------------------------------------------------------------------------------- /contrib/libs/pire/pire/scanners/null.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "multi.h" 3 | #include "simple.h" 4 | #include "slow.h" 5 | #include "loaded.h" 6 | 7 | namespace Pire { 8 | 9 | const SimpleScanner* SimpleScanner::m_null = &SimpleScanner::Null(); 10 | const SlowScanner* SlowScanner ::m_null = &SlowScanner::Null(); 11 | const LoadedScanner* LoadedScanner::m_null = &LoadedScanner::Null(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /contrib/libs/pire/pire/stub/defaults.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | -------------------------------------------------------------------------------- /contrib/libs/pire/pire/stub/hacks.h: -------------------------------------------------------------------------------- 1 | #ifndef PIRE_STUB_USE_PIRE_H_INCLUDED 2 | #define PIRE_STUB_USE_PIRE_H_INCLUDED 3 | 4 | namespace Pire {} 5 | using namespace Pire; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /contrib/libs/pire/pire/stub/lexical_cast.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /contrib/libs/pire/pire/stub/memstreams.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | namespace Pire { 7 | typedef TBuffer Buffer; 8 | typedef TBuffer::TIterator BufferIterator; 9 | typedef TBufferOutput BufferOutput; 10 | typedef TAlignedOutput AlignedOutput; 11 | } 12 | -------------------------------------------------------------------------------- /contrib/libs/pire/pire/stub/noncopyable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | namespace Pire { 4 | typedef TNonCopyable NonCopyable; 5 | } 6 | -------------------------------------------------------------------------------- /contrib/libs/pire/pire/stub/saveload.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | -------------------------------------------------------------------------------- /contrib/libs/pire/pire/stub/singleton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | namespace Pire { 4 | template 5 | const T& DefaultValue() { 6 | return Default(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /contrib/libs/pire/pire/stub/utf8.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | inline wchar32 to_lower(wchar32 c) { 5 | return ToLower(c); 6 | } 7 | inline wchar32 to_upper(wchar32 c) { 8 | return ToUpper(c); 9 | } 10 | 11 | inline bool is_digit(wchar32 c) { 12 | return IsDigit(c); 13 | } 14 | 15 | inline bool is_upper(wchar32 c) { 16 | return IsUpper(c); 17 | } 18 | -------------------------------------------------------------------------------- /contrib/libs/pire/samples/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | inline \ 3 | blacklist \ 4 | pigrep 5 | -------------------------------------------------------------------------------- /contrib/libs/pire/samples/bench/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CXXFLAGS = -Wall 3 | if ENABLE_DEBUG 4 | AM_CXXFLAGS += -DPIRE_DEBUG 5 | endif 6 | if ENABLE_CHECKED 7 | AM_CXXFLAGS += -DPIRE_CHECKED 8 | endif 9 | 10 | noinst_PROGRAMS = bench 11 | 12 | bench_SOURCES = bench.cpp 13 | bench_LDADD = ../../pire/libpire.la 14 | bench_CXXFLAGS = -I$(top_srcdir) $(AM_CXXFLAGS) 15 | -------------------------------------------------------------------------------- /contrib/libs/pire/tests/stub/cppunit.h: -------------------------------------------------------------------------------- 1 | #ifndef PIRE_STUB_CPPUNIT_H_INCLUDED 2 | #define PIRE_STUB_CPPUNIT_H_INCLUDED 3 | 4 | #include 5 | #include 6 | 7 | #define UNIT_CHECKPOINT() 8 | 9 | typedef TMemoryInput MemoryInput; 10 | 11 | #endif 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1.31/yquicklz.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if defined(__cplusplus) 4 | extern "C" { 5 | #endif 6 | 7 | size_t qlz_decompress(const char *source, void *destination, char *scratch); 8 | size_t qlz_compress(const void *source, char *destination, size_t size, char *scratch); 9 | size_t qlz_size_decompressed(const char *source); 10 | size_t qlz_size_compressed(const char *source); 11 | int qlz_get_setting(int setting); 12 | 13 | #if defined(__cplusplus) 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1.40/yquicklz.h: -------------------------------------------------------------------------------- 1 | #define QLZ_COMPRESSION_LEVEL COMPRESSION_LEVEL 2 | #define QLZ_STREAMING_BUFFER STREAMING_MODE 3 | 4 | #include 5 | 6 | #if defined(__cplusplus) 7 | extern "C" { 8 | #endif 9 | 10 | size_t qlz_size_decompressed(const char *source); 11 | size_t qlz_size_compressed(const char *source); 12 | size_t qlz_decompress(const char *source, void *destination, char *scratch_decompress); 13 | size_t qlz_compress(const void *source, char *destination, size_t size, char *scratch_compress); 14 | int qlz_get_setting(int setting); 15 | 16 | #if defined(__cplusplus) 17 | } 18 | #endif 19 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_0_0.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_31_0_0.h" 3 | #include "1.31/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_0_0.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 0 2 | #define STREAMING_MODE 0 3 | #define QLZ_YVERSION 1_31 4 | 5 | #include "prolog.h" 6 | #include "1.31/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_0_100000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_31_0_100000.h" 3 | #include "1.31/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_0_100000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 0 2 | #define STREAMING_MODE 100000 3 | #define QLZ_YVERSION 1_31 4 | 5 | #include "prolog.h" 6 | #include "1.31/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_0_1000000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_31_0_1000000.h" 3 | #include "1.31/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_0_1000000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 0 2 | #define STREAMING_MODE 1000000 3 | #define QLZ_YVERSION 1_31 4 | 5 | #include "prolog.h" 6 | #include "1.31/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_1_0.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_31_1_0.h" 3 | #include "1.31/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_1_0.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 1 2 | #define STREAMING_MODE 0 3 | #define QLZ_YVERSION 1_31 4 | 5 | #include "prolog.h" 6 | #include "1.31/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_1_100000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_31_1_100000.h" 3 | #include "1.31/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_1_100000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 1 2 | #define STREAMING_MODE 100000 3 | #define QLZ_YVERSION 1_31 4 | 5 | #include "prolog.h" 6 | #include "1.31/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_1_1000000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_31_1_1000000.h" 3 | #include "1.31/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_1_1000000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 1 2 | #define STREAMING_MODE 1000000 3 | #define QLZ_YVERSION 1_31 4 | 5 | #include "prolog.h" 6 | #include "1.31/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_2_0.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_31_2_0.h" 3 | #include "1.31/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_2_0.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 2 2 | #define STREAMING_MODE 0 3 | #define QLZ_YVERSION 1_31 4 | 5 | #include "prolog.h" 6 | #include "1.31/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_2_100000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_31_2_100000.h" 3 | #include "1.31/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_2_100000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 2 2 | #define STREAMING_MODE 100000 3 | #define QLZ_YVERSION 1_31 4 | 5 | #include "prolog.h" 6 | #include "1.31/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_2_1000000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_31_2_1000000.h" 3 | #include "1.31/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_2_1000000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 2 2 | #define STREAMING_MODE 1000000 3 | #define QLZ_YVERSION 1_31 4 | 5 | #include "prolog.h" 6 | #include "1.31/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_3_0.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_31_3_0.h" 3 | #include "1.31/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_3_0.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 3 2 | #define STREAMING_MODE 0 3 | #define QLZ_YVERSION 1_31 4 | 5 | #include "prolog.h" 6 | #include "1.31/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_3_100000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_31_3_100000.h" 3 | #include "1.31/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_3_100000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 3 2 | #define STREAMING_MODE 100000 3 | #define QLZ_YVERSION 1_31 4 | 5 | #include "prolog.h" 6 | #include "1.31/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_3_1000000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_31_3_1000000.h" 3 | #include "1.31/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_31_3_1000000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 3 2 | #define STREAMING_MODE 1000000 3 | #define QLZ_YVERSION 1_31 4 | 5 | #include "prolog.h" 6 | #include "1.31/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_1_0.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_40_1_0.h" 3 | #include "1.40/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_1_0.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 1 2 | #define STREAMING_MODE 0 3 | #define QLZ_YVERSION 1_40 4 | 5 | #include "prolog.h" 6 | #include "1.40/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_1_100000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_40_1_100000.h" 3 | #include "1.40/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_1_100000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 1 2 | #define STREAMING_MODE 100000 3 | #define QLZ_YVERSION 1_40 4 | 5 | #include "prolog.h" 6 | #include "1.40/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_1_1000000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_40_1_1000000.h" 3 | #include "1.40/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_1_1000000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 1 2 | #define STREAMING_MODE 1000000 3 | #define QLZ_YVERSION 1_40 4 | 5 | #include "prolog.h" 6 | #include "1.40/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_2_0.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_40_2_0.h" 3 | #include "1.40/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_2_0.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 2 2 | #define STREAMING_MODE 0 3 | #define QLZ_YVERSION 1_40 4 | 5 | #include "prolog.h" 6 | #include "1.40/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_2_100000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_40_2_100000.h" 3 | #include "1.40/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_2_100000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 2 2 | #define STREAMING_MODE 100000 3 | #define QLZ_YVERSION 1_40 4 | 5 | #include "prolog.h" 6 | #include "1.40/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_2_1000000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_40_2_1000000.h" 3 | #include "1.40/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_2_1000000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 2 2 | #define STREAMING_MODE 1000000 3 | #define QLZ_YVERSION 1_40 4 | 5 | #include "prolog.h" 6 | #include "1.40/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_3_0.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_40_3_0.h" 3 | #include "1.40/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_3_0.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 3 2 | #define STREAMING_MODE 0 3 | #define QLZ_YVERSION 1_40 4 | 5 | #include "prolog.h" 6 | #include "1.40/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_3_100000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_40_3_100000.h" 3 | #include "1.40/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_3_100000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 3 2 | #define STREAMING_MODE 100000 3 | #define QLZ_YVERSION 1_40 4 | 5 | #include "prolog.h" 6 | #include "1.40/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_3_1000000.c: -------------------------------------------------------------------------------- 1 | #define FROM_QUICKLZ_BUILD 2 | #include "1_40_3_1000000.h" 3 | #include "1.40/quicklz.c" 4 | #include "table.inc" 5 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/1_40_3_1000000.h: -------------------------------------------------------------------------------- 1 | #define COMPRESSION_LEVEL 3 2 | #define STREAMING_MODE 1000000 3 | #define QLZ_YVERSION 1_40 4 | 5 | #include "prolog.h" 6 | #include "1.40/yquicklz.h" 7 | #include "epilog.h" 8 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/CMakeLists.inc: -------------------------------------------------------------------------------- 1 | SRCS(1_31_0_0.c) 2 | SRCS(1_31_0_100000.c) 3 | SRCS(1_31_0_1000000.c) 4 | SRCS(1_31_1_0.c) 5 | SRCS(1_31_1_100000.c) 6 | SRCS(1_31_1_1000000.c) 7 | SRCS(1_31_2_0.c) 8 | SRCS(1_31_2_100000.c) 9 | SRCS(1_31_2_1000000.c) 10 | SRCS(1_31_3_0.c) 11 | SRCS(1_31_3_100000.c) 12 | SRCS(1_31_3_1000000.c) 13 | SRCS(1_40_1_0.c) 14 | SRCS(1_40_1_100000.c) 15 | SRCS(1_40_1_1000000.c) 16 | SRCS(1_40_2_0.c) 17 | SRCS(1_40_2_100000.c) 18 | SRCS(1_40_2_1000000.c) 19 | SRCS(1_40_3_0.c) 20 | SRCS(1_40_3_100000.c) 21 | SRCS(1_40_3_1000000.c) 22 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | 6 | INCLUDE(CMakeLists.inc) 7 | 8 | SRCS( 9 | table.c 10 | quicklz.cpp 11 | ) 12 | 13 | END() 14 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/epilog.h: -------------------------------------------------------------------------------- 1 | #if !defined(FROM_QUICKLZ_BUILD) 2 | #undef qlz_decompress 3 | #undef qlz_compress 4 | #undef qlz_size_decompressed 5 | #undef qlz_size_compressed 6 | #undef qlz_get_setting 7 | #undef qlz_table 8 | #undef qlz_compress_core 9 | #undef qlz_decompress_core 10 | #undef hash_func 11 | #undef fast_read 12 | #undef fast_write 13 | 14 | #undef COMPRESSION_LEVEL 15 | #undef STREAMING_MODE 16 | #undef QLZ_YVERSION 17 | #undef QLZ_COMPRESSION_LEVEL 18 | #undef QLZ_STREAMING_BUFFER 19 | #endif 20 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/quicklz.cpp: -------------------------------------------------------------------------------- 1 | #include "quicklz.h" 2 | 3 | const TQuickLZMethods* LzqTable(unsigned ver, unsigned level, unsigned buf) { 4 | if (ver > 1 || level > 3 || buf > 2) { 5 | return 0; 6 | } 7 | 8 | return GetLzqTable(ver, level, buf); 9 | } 10 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/quicklz.h: -------------------------------------------------------------------------------- 1 | #ifndef quicklz_h_sad8fs78d5f 2 | #define quicklz_h_sad8fs78d5f 3 | 4 | #include "table.h" 5 | #include "quicklz.inc" 6 | #define FROM_QUICKLZ_BUILD 7 | #include "1_31_0_0.h" 8 | #undef FROM_QUICKLZ_BUILD 9 | #include "table.h" 10 | 11 | #if defined(__cplusplus) 12 | const TQuickLZMethods* LzqTable(unsigned ver, unsigned level, unsigned buf); 13 | #endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/quicklz.inc: -------------------------------------------------------------------------------- 1 | #include "1_31_0_0.h" 2 | #include "1_31_0_100000.h" 3 | #include "1_31_0_1000000.h" 4 | #include "1_31_1_0.h" 5 | #include "1_31_1_100000.h" 6 | #include "1_31_1_1000000.h" 7 | #include "1_31_2_0.h" 8 | #include "1_31_2_100000.h" 9 | #include "1_31_2_1000000.h" 10 | #include "1_31_3_0.h" 11 | #include "1_31_3_100000.h" 12 | #include "1_31_3_1000000.h" 13 | #include "1_40_1_0.h" 14 | #include "1_40_1_100000.h" 15 | #include "1_40_1_1000000.h" 16 | #include "1_40_2_0.h" 17 | #include "1_40_2_100000.h" 18 | #include "1_40_2_1000000.h" 19 | #include "1_40_3_0.h" 20 | #include "1_40_3_100000.h" 21 | #include "1_40_3_1000000.h" 22 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/table.c: -------------------------------------------------------------------------------- 1 | #include "table.h" 2 | #include "tables2.inc" 3 | 4 | static struct TQuickLZMethods* qlz_tables[2][4][3] = 5 | #include "tables1.inc" 6 | ; 7 | 8 | struct TQuickLZMethods* GetLzqTable(unsigned ver, unsigned level, unsigned buf) { 9 | return qlz_tables[ver][level][buf]; 10 | } 11 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/table.h: -------------------------------------------------------------------------------- 1 | #ifndef table_h_asd78567asdf 2 | #define table_h_asd78567asdf 3 | 4 | #include 5 | 6 | #if defined(__cplusplus) 7 | extern "C" { 8 | #endif 9 | 10 | struct TQuickLZMethods { 11 | size_t (*SizeDecompressed)(const char* source); 12 | size_t (*SizeCompressed)(const char* source); 13 | size_t (*Decompress)(const char* source, void* destination, char* scratch_decompress); 14 | size_t (*Compress)(const void* source, char* destination, size_t size, char* scratch_compress); 15 | int (*Setting)(int setting); 16 | 17 | const char* Name; 18 | }; 19 | 20 | struct TQuickLZMethods* GetLzqTable(unsigned ver, unsigned level, unsigned buf); 21 | 22 | #if defined(__cplusplus) 23 | } 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/table.inc: -------------------------------------------------------------------------------- 1 | #include "table.h" 2 | 3 | #define STR(a) STR2(a) 4 | #define STR2(a) STR3(a) 5 | #define STR3(a) #a 6 | 7 | struct TQuickLZMethods qlz_table = { 8 | qlz_size_decompressed, 9 | qlz_size_compressed, 10 | qlz_decompress, 11 | qlz_compress, 12 | qlz_get_setting, 13 | STR(QLZ_YVERSION) "-" STR(COMPRESSION_LEVEL) "-" STR(STREAMING_MODE) 14 | }; 15 | -------------------------------------------------------------------------------- /contrib/libs/quicklz/tables1.inc: -------------------------------------------------------------------------------- 1 | {{{&yqlz_1_31_0_0_table,&yqlz_1_31_0_100000_table,&yqlz_1_31_0_1000000_table},{&yqlz_1_31_1_0_table,&yqlz_1_31_1_100000_table,&yqlz_1_31_1_1000000_table},{&yqlz_1_31_2_0_table,&yqlz_1_31_2_100000_table,&yqlz_1_31_2_1000000_table},{&yqlz_1_31_3_0_table,&yqlz_1_31_3_100000_table,&yqlz_1_31_3_1000000_table}},{{0,0,0},{&yqlz_1_40_1_0_table,&yqlz_1_40_1_100000_table,&yqlz_1_40_1_1000000_table},{&yqlz_1_40_2_0_table,&yqlz_1_40_2_100000_table,&yqlz_1_40_2_1000000_table},{&yqlz_1_40_3_0_table,&yqlz_1_40_3_100000_table,&yqlz_1_40_3_1000000_table}}} 2 | -------------------------------------------------------------------------------- /contrib/libs/snappy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NO_COMPILER_WARNINGS) 4 | 5 | ENABLE(NOUTIL) 6 | 7 | SRCS( 8 | snappy.cc 9 | snappy-c.cc 10 | snappy-stubs-internal.cc 11 | snappy-sinksource.cc 12 | ) 13 | 14 | END() 15 | -------------------------------------------------------------------------------- /contrib/libs/zlib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | 6 | CFLAGS(-DBUILD_ZLIB) 7 | 8 | SRCS( 9 | adler32.c 10 | compress.c 11 | crc32.c 12 | deflate.c 13 | gzclose.c 14 | gzlib.c 15 | gzread.c 16 | gzwrite.c 17 | infback.c 18 | inffast.c 19 | inflate.c 20 | inftrees.c 21 | trees.c 22 | uncompr.c 23 | zutil.c 24 | ) 25 | 26 | END() 27 | -------------------------------------------------------------------------------- /contrib/libs/zlib/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/balancer/dc4ace0b9f72b0839a6e112f65ba288d81770118/contrib/libs/zlib/ChangeLog -------------------------------------------------------------------------------- /contrib/libs/zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /contrib/libs/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* inffast.h -- header to use inffast.c 4 | * Copyright (C) 1995-2003, 2010 Mark Adler 5 | * For conditions of distribution and use, see copyright notice in zlib.h 6 | */ 7 | 8 | /* WARNING: this file should *not* be used by applications. It is 9 | part of the implementation of the compression library and is 10 | subject to change. Applications should only use zlib.h. 11 | */ 12 | 13 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 14 | -------------------------------------------------------------------------------- /contrib/tools/byacc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROGRAM() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | ENABLE(NO_OPTIMIZE) 6 | 7 | SRCS( 8 | closure.c 9 | error.c 10 | graph.c 11 | lalr.c 12 | lr0.c 13 | main.c 14 | mkpar.c 15 | output.c 16 | reader.c 17 | skeleton.c 18 | symtab.c 19 | verbose.c 20 | warshall.c 21 | ) 22 | 23 | END() 24 | -------------------------------------------------------------------------------- /contrib/tools/byacc/config.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated automatically by configure. */ 2 | /* @configure_input@ */ 3 | /* $Id: config.h,v 1.1 2007-11-29 19:12:16 pg Exp $ */ 4 | 5 | #define SYSTEM_NAME "unknown" 6 | #define CC_HAS_PROTOS 1 7 | -------------------------------------------------------------------------------- /contrib/tools/file2c/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROGRAM() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | SRCS( 6 | file2c.c 7 | ) 8 | 9 | END() 10 | -------------------------------------------------------------------------------- /contrib/tools/flex-old/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROGRAM(flex) 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | ENABLE(NO_OPTIMIZE) 6 | 7 | PEERDIR( 8 | contrib/tools/flex-old/fl 9 | ) 10 | 11 | SRCS( 12 | ccl.c 13 | dfa.c 14 | ecs.c 15 | gen.c 16 | main.c 17 | misc.c 18 | nfa.c 19 | skel.c 20 | sym.c 21 | tblcmp.c 22 | yylex.c 23 | scan.c 24 | parse.c 25 | ) 26 | 27 | END() 28 | -------------------------------------------------------------------------------- /contrib/tools/flex-old/conf.in: -------------------------------------------------------------------------------- 1 | /* $Header: /opt/vlysenkov/CVSROOT/arcadia/contrib/tools/flex-old/conf.in,v 1.1 2007-11-27 08:43:20 pg Exp $ */ 2 | 3 | /* Define to empty if the keyword does not work. */ 4 | #undef const 5 | 6 | /* Define to `unsigned' if doesn't define. */ 7 | #undef size_t 8 | 9 | /* Define if you have the ANSI C header files. */ 10 | #undef STDC_HEADERS 11 | 12 | /* Define if you have the header file. */ 13 | #undef HAVE_MALLOC_H 14 | 15 | /* Define if you have the header file. */ 16 | #undef HAVE_STRING_H 17 | 18 | /* Define if you have the header file. */ 19 | #undef HAVE_SYS_TYPES_H 20 | 21 | /* Define if you have and it should be used (not on Ultrix). */ 22 | #undef HAVE_ALLOCA_H 23 | 24 | /* Define if platform-specific command line handling is necessary. */ 25 | #undef NEED_ARGV_FIXUP 26 | -------------------------------------------------------------------------------- /contrib/tools/flex-old/fl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | 6 | SRCS( 7 | libmain.c 8 | libyywrap.c 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /contrib/tools/flex-old/fl/libmain.c: -------------------------------------------------------------------------------- 1 | /* libmain - flex run-time support library "main" function */ 2 | 3 | /* $Header: /opt/vlysenkov/CVSROOT/arcadia/contrib/tools/flex-old/fl/libmain.c,v 1.2 2007-11-30 02:28:15 pg Exp $ */ 4 | 5 | extern int yylex(); 6 | 7 | int main( argc, argv ) 8 | int argc; 9 | char *argv[]; 10 | { 11 | while ( yylex() != 0 ) 12 | ; 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /contrib/tools/flex-old/fl/libyywrap.c: -------------------------------------------------------------------------------- 1 | /* libyywrap - flex run-time support library "yywrap" function */ 2 | 3 | /* $Header: /opt/vlysenkov/CVSROOT/arcadia/contrib/tools/flex-old/fl/libyywrap.c,v 1.2 2007-11-30 02:28:15 pg Exp $ */ 4 | 5 | int yywrap() 6 | { 7 | return 1; 8 | } 9 | -------------------------------------------------------------------------------- /contrib/tools/flex-old/version.h: -------------------------------------------------------------------------------- 1 | #define FLEX_VERSION "2.5.4" 2 | -------------------------------------------------------------------------------- /contrib/tools/gperf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROGRAM() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | ENABLE(NO_OPTIMIZE) 6 | ENABLE(ADDINCLSELF) 7 | 8 | SRCS( 9 | getopt.c 10 | getopt1.c 11 | getline.cpp 12 | hash.cpp 13 | keyword.cpp 14 | main.cpp 15 | options.cpp 16 | output.cpp 17 | search.cpp 18 | version.cpp 19 | hash-table.cpp 20 | bool-array.cpp 21 | input.cpp 22 | keyword-list.cpp 23 | positions.cpp 24 | ) 25 | 26 | END() 27 | -------------------------------------------------------------------------------- /contrib/tools/gperf/config.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated from config.h.in by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define to the address where bug reports for this package should be sent. */ 5 | #define PACKAGE_BUGREPORT "" 6 | 7 | /* Define to the full name of this package. */ 8 | #define PACKAGE_NAME "" 9 | 10 | /* Define to the full name and version of this package. */ 11 | #define PACKAGE_STRING "" 12 | 13 | /* Define to the one symbol short name of this package. */ 14 | #define PACKAGE_TARNAME "" 15 | 16 | /* Define to the version of this package. */ 17 | #define PACKAGE_VERSION "" 18 | -------------------------------------------------------------------------------- /contrib/tools/gperf/hash.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1990, 2000, 2002 Free Software Foundation 3 | written by Doug Lea 4 | */ 5 | 6 | #include 7 | 8 | /* 9 | Some useful hash function. 10 | It's not a particularly good hash function (<< 5 would be better than << 4), 11 | but people believe in it because it comes from Dragon book. 12 | */ 13 | 14 | unsigned int 15 | hashpjw (const unsigned char *x, unsigned int len) // From Dragon book, p436 16 | { 17 | unsigned int h = 0; 18 | unsigned int g; 19 | 20 | for (; len > 0; len--) 21 | { 22 | h = (h << 4) + *x++; 23 | if ((g = h & 0xf0000000) != 0) 24 | h = (h ^ (g >> 24)) ^ g; 25 | } 26 | return h; 27 | } 28 | -------------------------------------------------------------------------------- /contrib/tools/gperf/hash.h: -------------------------------------------------------------------------------- 1 | // This may look like C code, but it is really -*- C++ -*- 2 | 3 | /* 4 | Copyright (C) 1988, 1992, 2000, 2002 Free Software Foundation 5 | written by Doug Lea 6 | */ 7 | 8 | #ifndef _hash_h 9 | #define _hash_h 1 10 | 11 | /* a hash function for char[] arrays using the 12 | method described in Aho, Sethi, & Ullman, p 436. */ 13 | extern unsigned int hashpjw (const unsigned char *string, unsigned int len); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /contrib/tools/ragel5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | RECURSE( 2 | contrib/tools/ragel5/aapl 3 | contrib/tools/ragel5/common 4 | contrib/tools/ragel5/ragel 5 | contrib/tools/ragel5/redfsm 6 | contrib/tools/ragel5/rlgen-cd 7 | ) 8 | -------------------------------------------------------------------------------- /contrib/tools/ragel5/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | ENABLE(NO_SHARED_LIB) 6 | 7 | SRCDIR( 8 | contrib/tools/ragel5/aapl 9 | ) 10 | 11 | SRCS( 12 | common.cpp 13 | ) 14 | 15 | END() 16 | -------------------------------------------------------------------------------- /contrib/tools/ragel5/common/version.h: -------------------------------------------------------------------------------- 1 | #define VERSION "5.19" 2 | #define PUBDATE "March 2007" 3 | -------------------------------------------------------------------------------- /contrib/tools/ragel5/ragel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROGRAM(ragel5) 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | ENABLE(NO_OPTIMIZE) 6 | 7 | SRCDIR( 8 | contrib/tools/ragel5/aapl 9 | ) 10 | 11 | PEERDIR( 12 | ADDINCL contrib/tools/ragel5/common 13 | ) 14 | 15 | SRCS( 16 | fsmap.cpp 17 | fsmattach.cpp 18 | fsmbase.cpp 19 | fsmgraph.cpp 20 | fsmmin.cpp 21 | fsmstate.cpp 22 | main.cpp 23 | parsedata.cpp 24 | parsetree.cpp 25 | rlparse.cpp 26 | rlscan.cpp 27 | xmlcodegen.cpp 28 | ) 29 | 30 | END() 31 | -------------------------------------------------------------------------------- /contrib/tools/ragel5/redfsm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | ENABLE(NO_SHARED_LIB) 6 | 7 | SRCDIR( 8 | contrib/tools/ragel5/aapl 9 | ) 10 | 11 | PEERDIR( 12 | ADDINCL contrib/tools/ragel5/common 13 | ) 14 | 15 | SRCS( 16 | gendata.cpp 17 | redfsm.cpp 18 | xmlparse.cpp 19 | xmlscan.cpp 20 | xmltags.cpp 21 | ) 22 | 23 | END() 24 | -------------------------------------------------------------------------------- /contrib/tools/ragel5/rlgen-cd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROGRAM() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | ENABLE(NO_OPTIMIZE) 6 | 7 | SRCDIR( 8 | contrib/tools/ragel5/aapl 9 | ) 10 | 11 | PEERDIR( 12 | ADDINCL contrib/tools/ragel5/common 13 | ADDINCL contrib/tools/ragel5/redfsm 14 | ) 15 | 16 | SRCS( 17 | fflatcodegen.cpp 18 | fgotocodegen.cpp 19 | flatcodegen.cpp 20 | fsmcodegen.cpp 21 | ftabcodegen.cpp 22 | gotocodegen.cpp 23 | ipgotocodegen.cpp 24 | main.cpp 25 | splitcodegen.cpp 26 | tabcodegen.cpp 27 | ) 28 | 29 | END() 30 | -------------------------------------------------------------------------------- /contrib/tools/ragel6/config.h: -------------------------------------------------------------------------------- 1 | /* ragel/config.h. Generated from config.h.in by configure. */ 2 | /* ragel/config.h.in. Generated from configure.in by autoheader. */ 3 | 4 | /* Name of package */ 5 | #define PACKAGE "ragel" 6 | 7 | /* Define to the address where bug reports for this package should be sent. */ 8 | #define PACKAGE_BUGREPORT "" 9 | 10 | /* Define to the full name of this package. */ 11 | #define PACKAGE_NAME "ragel" 12 | 13 | /* Define to the full name and version of this package. */ 14 | #define PACKAGE_STRING "ragel 6.6" 15 | 16 | /* Define to the one symbol short name of this package. */ 17 | #define PACKAGE_TARNAME "ragel" 18 | 19 | /* Define to the version of this package. */ 20 | #define PACKAGE_VERSION "6.6" 21 | 22 | /* Version number of package */ 23 | #define VERSION "6.6" 24 | -------------------------------------------------------------------------------- /contrib/tools/ragel6/version.h: -------------------------------------------------------------------------------- 1 | #define VERSION "6.6" 2 | #define PUBDATE "Dec 2009" 3 | -------------------------------------------------------------------------------- /contrib/tools/yasm/libyasm-stdint.h: -------------------------------------------------------------------------------- 1 | #ifndef _YASM_LIBYASM_STDINT_H 2 | #define _YASM_LIBYASM_STDINT_H 1 3 | 4 | #include 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /contrib/tools/yasm/libyasm/phash.h: -------------------------------------------------------------------------------- 1 | /* Modified for use with yasm by Peter Johnson. 2 | * $Id: phash.h 2101 2008-05-23 06:46:51Z peter $ 3 | */ 4 | /* 5 | ------------------------------------------------------------------------------ 6 | By Bob Jenkins, September 1996. 7 | lookupa.h, a hash function for table lookup, same function as lookup.c. 8 | Use this code in any way you wish. Public Domain. It has no warranty. 9 | Source is http://burtleburtle.net/bob/c/lookupa.h 10 | ------------------------------------------------------------------------------ 11 | */ 12 | 13 | #ifndef YASM_LIB_DECL 14 | #define YASM_LIB_DECL 15 | #endif 16 | 17 | YASM_LIB_DECL 18 | unsigned long phash_lookup(const char *k, size_t length, 19 | unsigned long level); 20 | YASM_LIB_DECL 21 | void phash_checksum(const char *k, size_t length, unsigned long *state); 22 | -------------------------------------------------------------------------------- /contrib/tools/yasm/modules/preprocs/nasm/nasm-eval.h: -------------------------------------------------------------------------------- 1 | /* eval.h header file for eval.c 2 | * 3 | * The Netwide Assembler is copyright (C) 1996 Simon Tatham and 4 | * Julian Hall. All rights reserved. The software is 5 | * redistributable under the licence given in the file "Licence" 6 | * distributed in the NASM archive. 7 | */ 8 | 9 | #ifndef NASM_EVAL_H 10 | #define NASM_EVAL_H 11 | 12 | /* 13 | * The evaluator itself. 14 | */ 15 | yasm_expr *nasm_evaluate (scanner sc, void *scprivate, struct tokenval *tv, 16 | int critical, efunc report_error); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /contrib/tools/yasm/modules/preprocs/nasm/nasm-pp.h: -------------------------------------------------------------------------------- 1 | /* preproc.h header file for preproc.c 2 | * 3 | * The Netwide Assembler is copyright (C) 1996 Simon Tatham and 4 | * Julian Hall. All rights reserved. The software is 5 | * redistributable under the licence given in the file "Licence" 6 | * distributed in the NASM archive. 7 | */ 8 | 9 | #ifndef YASM_NASM_PREPROC_H 10 | #define YASM_NASM_PREPROC_H 11 | 12 | void pp_pre_include (const char *); 13 | void pp_pre_define (char *); 14 | void pp_pre_undefine (char *); 15 | void pp_builtin_define (char *); 16 | void pp_extra_stdmac (const char **); 17 | 18 | extern Preproc nasmpp; 19 | 20 | void nasm_preproc_add_dep(char *); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /contrib/tools/yasm/nasm-version.c: -------------------------------------------------------------------------------- 1 | /* This file auto-generated from standard.mac by genmacro.c - don't edit it */ 2 | 3 | #include 4 | 5 | static const char *nasm_version_mac[] = { 6 | "%define __YASM_MAJOR__ 0", 7 | "%define __YASM_MINOR__ 8", 8 | "%define __YASM_SUBMINOR__ 0", 9 | "%define __YASM_BUILD__ 2194", 10 | "%define __YASM_VERSION_ID__ 000080000h", 11 | "%define __YASM_VER__ \"0.8.0\"", 12 | NULL 13 | }; 14 | -------------------------------------------------------------------------------- /library/gettimeofday/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | SRCS( 4 | gettimeofday.cpp 5 | ) 6 | 7 | END() 8 | -------------------------------------------------------------------------------- /library/gettimeofday/gettimeofday.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /library/lua/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | contrib/libs/lua 5 | ) 6 | 7 | SRCS( 8 | wrapper.cpp 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /library/lua/README: -------------------------------------------------------------------------------- 1 | обертка над lua_State*, для удобства программирования с++ биндингов для lua. 2 | -------------------------------------------------------------------------------- /library/lua/wrapper.cpp: -------------------------------------------------------------------------------- 1 | #include "wrapper.h" 2 | -------------------------------------------------------------------------------- /library/pire/Makefile.cfg.cmake: -------------------------------------------------------------------------------- 1 | CFLAGS(-I${ARCADIA_BUILD_ROOT}/contrib/libs/pire/pire) 2 | 3 | MACRO (BUILDWITH_PIRE_INLINE srcfile dstfile) 4 | TOOLDIR_EX(library/pire/inline __pire_inline_) 5 | ADD_CUSTOM_COMMAND( 6 | OUTPUT "${dstfile}" 7 | COMMAND ${__pire_inline_} -o "${dstfile}" "${srcfile}" 8 | MAIN_DEPENDENCY "${srcfile}" 9 | DEPENDS "${srcfile}" pire_inline 10 | COMMENT "Embedding regexps into ${srcfile}" 11 | WORKING_DIRECTORY ${CURDIR} 12 | ${ARGN} 13 | ) 14 | SRCS("${dstfile}") 15 | ENDMACRO (BUILDWITH_PIRE_INLINE) 16 | -------------------------------------------------------------------------------- /library/pire/dbg/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROGRAM(pire_dbg) 2 | 3 | PEERDIR( 4 | util 5 | library/pire 6 | ) 7 | 8 | SRCS( 9 | dbg.cpp 10 | ) 11 | 12 | END() 13 | -------------------------------------------------------------------------------- /library/pire/inline/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROGRAM(pire_inline) 2 | 3 | SET(PIREDIR ${ARCADIA_ROOT}/contrib/libs/pire/pire) 4 | 5 | CXXFLAGS(-I${PIREDIR}) 6 | CXXFLAGS(-I${ARCADIA_ROOT}/library/pire) 7 | CXXFLAGS(-DPIRE_NO_CONFIG) 8 | 9 | 10 | PEERDIR( 11 | util 12 | library/pire 13 | ) 14 | 15 | SRCDIR( 16 | ${PIREDIR} 17 | ) 18 | 19 | SRCS( 20 | inline.lpp 21 | ) 22 | 23 | END() 24 | -------------------------------------------------------------------------------- /library/svnversion/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | CREATE_SVNVERSION_FOR(svnversion.cpp) 4 | 5 | SRCS( 6 | svnversion.cpp 7 | ) 8 | 9 | END() 10 | -------------------------------------------------------------------------------- /library/svnversion/svnversion.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define PROGRAM_VERSION GetProgramSvnVersion() 4 | #define ARCADIA_SOURCE_PATH GetArcadiaSourcePath() 5 | #define PRINT_VERSION PrintSvnVersionAndExit(argc, argv) 6 | 7 | #ifdef __cplusplus 8 | # define EXTERN_C extern "C" 9 | #else 10 | # define EXTERN_C 11 | #endif 12 | 13 | EXTERN_C const char* GetProgramSvnVersion(); 14 | EXTERN_C const char* GetArcadiaSourcePath(); 15 | EXTERN_C int GetProgramSvnRevision(); 16 | EXTERN_C void PrintSvnVersionAndExit(int argc, char *argv[]); 17 | -------------------------------------------------------------------------------- /library/unittest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | SRCS( 4 | checks.cpp 5 | registar.cpp 6 | tests_data.cpp 7 | utmain.cpp 8 | ) 9 | 10 | END() 11 | -------------------------------------------------------------------------------- /library/unittest/checks.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/balancer/dc4ace0b9f72b0839a6e112f65ba288d81770118/library/unittest/checks.cpp -------------------------------------------------------------------------------- /library/unittest/registar.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "registar.h" 4 | 5 | Stroka NUnitTest::RandomString(size_t len, ui32 seed) { 6 | TRand rand; 7 | Stroka ret; 8 | 9 | rand.srandom(seed); 10 | ret.reserve(len); 11 | 12 | for (size_t i = 0; i < len; ++i) { 13 | ret.push_back(char(1 + (rand.random() % 126))); 14 | } 15 | 16 | return ret; 17 | } 18 | -------------------------------------------------------------------------------- /library/unittest/tests_data.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "tests_data.h" 3 | 4 | #ifdef _win_ 5 | const char* DIR_SEPARATORS = "/\\"; 6 | #else 7 | const char* DIR_SEPARATORS = "/"; 8 | #endif 9 | 10 | Stroka GetArcadiaTestsData() { 11 | const char* workDir = getcwd(NULL, 0); 12 | if (!workDir) 13 | return ""; 14 | 15 | Stroka path(workDir); free((void*)workDir); 16 | while (!path.empty()) { 17 | Stroka dataDir = path + "/arcadia_tests_data"; 18 | if (isdir(dataDir.c_str()) == 0) 19 | return dataDir; 20 | 21 | size_t pos = path.find_last_of(DIR_SEPARATORS); 22 | if (pos == Stroka::npos) 23 | pos = 0; 24 | path.erase(pos); 25 | } 26 | 27 | return ""; 28 | } 29 | -------------------------------------------------------------------------------- /library/unittest/tests_data.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | Stroka GetArcadiaTestsData(); 6 | -------------------------------------------------------------------------------- /tools/archiver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROGRAM() 2 | 3 | SRCS( 4 | main.cpp 5 | ) 6 | SET(IDE_FOLDER "_Builders") 7 | 8 | END() 9 | -------------------------------------------------------------------------------- /tools/lua/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROGRAM() 2 | 3 | ENABLE(NO_COMPILER_WARNINGS) 4 | 5 | PEERDIR( 6 | contrib/libs/lua 7 | ) 8 | 9 | SRCDIR( 10 | contrib/libs/lua/lua-5.1.4/src 11 | ) 12 | 13 | SRCS( 14 | lua.cpp 15 | ) 16 | SET(IDE_FOLDER "_Builders") 17 | 18 | END() 19 | -------------------------------------------------------------------------------- /tools/lua/lua.cpp: -------------------------------------------------------------------------------- 1 | #include "lua.c" 2 | -------------------------------------------------------------------------------- /util/charset/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | SRCS( 6 | codepage.cpp 7 | cp_encrec.cpp 8 | doccodes.cpp 9 | utf.cpp 10 | wide.cpp 11 | 12 | recyr.hh 13 | recyr_int.hh 14 | 15 | normalization.cpp 16 | 17 | decomposition_table.h 18 | iconv.h 19 | unidata.h 20 | ) 21 | 22 | SRCDIR(generated) 23 | 24 | SRCS( 25 | cp_data.cpp 26 | composition.cpp 27 | decomposition.cpp 28 | encrec_data.cpp 29 | unidata.cpp 30 | uniscripts.cpp 31 | ) 32 | 33 | PEERDIR( 34 | util/generic 35 | util/system 36 | util/memory 37 | util/stream 38 | util/string 39 | util/folder 40 | util/random 41 | util/digest 42 | ) 43 | 44 | END() 45 | -------------------------------------------------------------------------------- /util/charset/decomposition_table.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "unicode_table.h" 4 | 5 | namespace NUnicode { 6 | namespace NPrivate { 7 | 8 | typedef NUnicodeTable::TTable 10 | > > TDecompositionTable; 11 | 12 | const TDecompositionTable& CannonDecompositionTable(); 13 | const TDecompositionTable& CompatDecompositionTable(); 14 | 15 | template 16 | inline const TDecompositionTable& DecompositionTable(); 17 | 18 | template <> 19 | inline const TDecompositionTable& DecompositionTable() { 20 | return CannonDecompositionTable(); 21 | } 22 | 23 | template <> 24 | inline const TDecompositionTable& DecompositionTable() { 25 | return CompatDecompositionTable(); 26 | } 27 | 28 | }; // namespace NPrivate 29 | }; // namespace NUnicode 30 | -------------------------------------------------------------------------------- /util/charset/utf.cpp: -------------------------------------------------------------------------------- 1 | #include "utf.h" 2 | #include "codepage.h" 3 | 4 | EUTF8Detect UTF8Detect(const char* s, size_t len) { 5 | const unsigned char *s0 = (const unsigned char *)s; 6 | const unsigned char *send = s0 + len; 7 | wchar32 rune; 8 | size_t rune_len; 9 | EUTF8Detect res = ASCII; 10 | 11 | while (s0 < send) { 12 | RECODE_RESULT rr = utf8_read_rune(rune, rune_len, s0, send); 13 | 14 | if (rr != RECODE_OK) { 15 | return NotUTF8; 16 | } 17 | 18 | if (rune_len > 1) { 19 | res = UTF8; 20 | } 21 | 22 | s0 += rune_len; 23 | } 24 | 25 | return res; 26 | } 27 | -------------------------------------------------------------------------------- /util/charset/utf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | enum EUTF8Detect { 6 | NotUTF8 7 | , UTF8 8 | , ASCII 9 | }; 10 | 11 | EUTF8Detect UTF8Detect(const char* s, size_t len); 12 | 13 | inline EUTF8Detect UTF8Detect(const TStringBuf& input) { 14 | return UTF8Detect(~input, +input); 15 | } 16 | 17 | inline bool IsUtf(const char* input, size_t len) { 18 | return UTF8Detect(input, len) != NotUTF8; 19 | } 20 | 21 | inline bool IsUtf(const TStringBuf& input) { 22 | return IsUtf(~input, +input); 23 | } 24 | -------------------------------------------------------------------------------- /util/config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(WERROR) 4 | ENABLE(NOUTIL) 5 | 6 | SET_SVNREVISION() 7 | 8 | SRCS( 9 | last_getopt.cpp 10 | last_getopt_support.h 11 | opt.cpp 12 | opt2.cpp 13 | posix_getopt.cpp 14 | conf.cpp 15 | ygetopt.cpp 16 | ) 17 | 18 | END() 19 | -------------------------------------------------------------------------------- /util/config/last_getopt_demo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROGRAM(last_getopt_demo) 2 | 3 | SRCS( 4 | demo.cpp 5 | ) 6 | 7 | END() 8 | -------------------------------------------------------------------------------- /util/config/opt_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "opt.h" 2 | 3 | #include 4 | 5 | SIMPLE_UNIT_TEST_SUITE(OptTest) { 6 | SIMPLE_UNIT_TEST(TestSimple) { 7 | int argc = 3; 8 | char* argv[] = { 9 | (char*) "cmd", (char*) "-x" 10 | }; 11 | Opt opt(argc, argv, ""); 12 | opt.Err = false; // be quiet 13 | UNIT_ASSERT_VALUES_EQUAL('?', opt.Get()); 14 | UNIT_ASSERT_VALUES_EQUAL(EOF, opt.Get()); 15 | UNIT_ASSERT_VALUES_EQUAL(EOF, opt.Get()); 16 | UNIT_ASSERT_VALUES_EQUAL(EOF, opt.Get()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /util/datetime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | IF (NOT WIN32) 6 | SET(WERROR yes) 7 | ENDIF (NOT WIN32) 8 | 9 | SRCS( 10 | base.cpp 11 | constants.h 12 | cputimer.cpp 13 | parser.rl 14 | systime.cpp 15 | ) 16 | 17 | IF (WIN32) 18 | SRCS( 19 | strptime.cpp 20 | ) 21 | ENDIF (WIN32) 22 | 23 | END() 24 | -------------------------------------------------------------------------------- /util/datetime/constants.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | const time_t SECONDS_IN_DAY = 86400; 6 | const time_t SECONDS_IN_HOUR = 3600; 7 | const time_t SECONDS_IN_HALFHOUR = 1800; 8 | -------------------------------------------------------------------------------- /util/digest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | SRCS( 6 | crc.cpp 7 | fnv.h 8 | iterator.h 9 | md5.cpp 10 | murmur.h 11 | numeric.h 12 | sfh.h 13 | city.cpp 14 | ) 15 | 16 | END() 17 | -------------------------------------------------------------------------------- /util/digest/fnv_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "fnv.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | class TFnvTest: public TTestBase { 8 | UNIT_TEST_SUITE(TFnvTest); 9 | UNIT_TEST(TestFnv32) 10 | UNIT_TEST(TestFnv64) 11 | UNIT_TEST_SUITE_END(); 12 | private: 13 | inline void TestFnv32() { 14 | UNIT_ASSERT_EQUAL(FnvHash("1234567", 7), ULL(2849763999)); 15 | } 16 | 17 | inline void TestFnv64() { 18 | UNIT_ASSERT_EQUAL(FnvHash("1234567", 7), ULL(2449551094593701855)); 19 | } 20 | }; 21 | 22 | UNIT_TEST_SUITE_REGISTRATION(TFnvTest); 23 | -------------------------------------------------------------------------------- /util/digest/md5.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class MD5 { 6 | public: 7 | MD5() { 8 | Init(); 9 | } 10 | 11 | void Init(); 12 | void Update(const void*, unsigned int); 13 | void Pad(); 14 | void Final(unsigned char [16]); 15 | char* End(char*); // buf must be char[33]; 16 | char* End_b64(char*); // buf must be char[25]; 17 | 18 | static char* File(const char*, char*); 19 | static char* Data(const unsigned char*, unsigned int, char*); 20 | 21 | private: 22 | ui32 state[4]; /* state (ABCD) */ 23 | ui32 count[2]; /* number of bits, modulo 2^64 (lsb first) */ 24 | unsigned char buffer[64]; /* input buffer */ 25 | }; 26 | -------------------------------------------------------------------------------- /util/fileptr.cpp: -------------------------------------------------------------------------------- 1 | #include "fgood.h" 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #if defined(_win_) 8 | # include 9 | #endif 10 | 11 | STATIC_ASSERT(sSet == SEEK_SET && sCur == SEEK_CUR && sEnd == SEEK_END); 12 | 13 | i64 TFILEPtr::length() const { 14 | int fd = fileno(m_file); 15 | #if defined (_win32_) && defined(_MSC_VER) 16 | i64 rv = _filelengthi64(fd); 17 | if (rv == -1) 18 | ythrow yexception() << "filelength " << ~Name << ": " << LastSystemErrorText(); 19 | return rv; 20 | #else 21 | struct stat statbuf; 22 | if (::fstat(fd, &statbuf) != 0) 23 | ythrow yexception() << "fstat " << ~Name << ": " << LastSystemErrorText(); 24 | return statbuf.st_size; 25 | #endif 26 | } 27 | -------------------------------------------------------------------------------- /util/folder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | SRCS( 6 | iterator.h 7 | fts.cpp 8 | filelist.cpp 9 | dirut.cpp 10 | ) 11 | 12 | IF (WIN32) 13 | SRCS( 14 | lstat_win.c 15 | dirent_win.c 16 | ) 17 | ENDIF (WIN32) 18 | 19 | END() 20 | -------------------------------------------------------------------------------- /util/folder/lstat_win.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #ifdef _win_ 6 | #include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | #define _S_IFLNK 0xA000 13 | int lstat(const char * fileName, struct stat* fileStat); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif //_win_ 20 | -------------------------------------------------------------------------------- /util/generic/bitops_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "bitops.h" 2 | 3 | #include 4 | 5 | class TBitOpsTest: public TTestBase { 6 | UNIT_TEST_SUITE(TBitOpsTest); 7 | UNIT_TEST(TestCountTrailingZeroBits) 8 | UNIT_TEST_SUITE_END(); 9 | private: 10 | inline void TestCountTrailingZeroBits() { 11 | TestCTZ(); 12 | TestCTZ(); 13 | TestCTZ(); 14 | } 15 | 16 | template 17 | inline void TestCTZ() { 18 | for (unsigned int i = 0; i < (sizeof(T) << 3); ++i) { 19 | UNIT_ASSERT_EQUAL(CountTrailingZeroBits(T(1) << i), i); 20 | } 21 | } 22 | }; 23 | 24 | UNIT_TEST_SUITE_REGISTRATION(TBitOpsTest); 25 | -------------------------------------------------------------------------------- /util/generic/buffer.cpp: -------------------------------------------------------------------------------- 1 | #include "ymath.h" 2 | #include "stroka.h" 3 | #include "buffer.h" 4 | 5 | #include 6 | 7 | TBuffer::TBuffer(size_t len) 8 | : Data_(0) 9 | , Len_(0) 10 | , Pos_(0) 11 | { 12 | Reserve(len); 13 | } 14 | 15 | TBuffer::TBuffer(const Stroka& s) 16 | : Data_(0) 17 | , Len_(0) 18 | , Pos_(0) 19 | { 20 | Append(~s, +s + 1); 21 | } 22 | 23 | void TBuffer::DoReserve(size_t realLen) { 24 | const size_t len = FastClp2(realLen); 25 | 26 | YASSERT(len > Len_); 27 | 28 | Data_ = (char*)y_reallocate(Data_, len); 29 | Len_ = len; 30 | } 31 | 32 | TBuffer::~TBuffer() throw () { 33 | y_deallocate(Data_); 34 | } 35 | 36 | void TBuffer::AsString(Stroka& s) { 37 | s.assign(Data(), Size()); 38 | Clear(); 39 | } 40 | -------------------------------------------------------------------------------- /util/generic/cast_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "cast.h" 2 | 3 | #include 4 | 5 | class TGenericCastsTest: public TTestBase { 6 | UNIT_TEST_SUITE(TGenericCastsTest); 7 | UNIT_TEST(TestReinterpret) 8 | UNIT_TEST_SUITE_END(); 9 | private: 10 | inline void TestReinterpret() { 11 | static char tmp[2]; 12 | 13 | UNIT_ASSERT_EQUAL(reinterpret_cast(tmp), ReinterpretCast(tmp)); 14 | } 15 | }; 16 | 17 | UNIT_TEST_SUITE_REGISTRATION(TGenericCastsTest); 18 | -------------------------------------------------------------------------------- /util/generic/chartraits.cpp: -------------------------------------------------------------------------------- 1 | #include "chartraits.h" 2 | 3 | #include 4 | 5 | static inline const char* FindChr(const char* s, char c, size_t len) throw () { 6 | const char* ret = TCharTraits::Find(s, c, len); 7 | 8 | return ret ? ret : (s + len); 9 | } 10 | 11 | const char* FastFindFirstOf(const char* s, size_t len, const char* set, size_t setlen) { 12 | switch (setlen) { 13 | case 0: 14 | return s + len; 15 | 16 | case 1: 17 | return FindChr(s, *set, len); 18 | 19 | default: 20 | return TCompactStrSpn(set, set + setlen).FindFirstOf(s, s + len); 21 | } 22 | } 23 | 24 | const char* FastFindFirstNotOf(const char* s, size_t len, const char* set, size_t setlen) { 25 | return TCompactStrSpn(set, set + setlen).FindFirstNotOf(s, s + len); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /util/generic/gentl.py: -------------------------------------------------------------------------------- 1 | print "#define TYPELIST_1(T1) TTypeList" 2 | 3 | def genT(i, j): 4 | s = "" 5 | 6 | for k in range(i, j + 1): 7 | s += "T" + str(k) 8 | 9 | if k != j: 10 | s += ", " 11 | 12 | return s 13 | 14 | for i in range(2, 15): 15 | s = "#define TYPELIST_" + str(i) + "(" 16 | 17 | s += genT(1, i) 18 | s += ") TTypeList 6 | struct THiddenImpl { 7 | THiddenImpl() { 8 | STATIC_ASSERT(Sz >= sizeof(T)); 9 | new(DataImpl) T; 10 | } 11 | ~THiddenImpl() { 12 | Obj().~T(); 13 | } 14 | FORCED_INLINE T &Obj() { 15 | return (T&)*DataImpl; 16 | } 17 | FORCED_INLINE const T &Obj() const { 18 | return (const T&)*DataImpl; 19 | } 20 | private: 21 | union { 22 | char DataImpl[Sz]; 23 | TAligner A; 24 | }; 25 | }; 26 | -------------------------------------------------------------------------------- /util/generic/list.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | template 8 | class ylist: public NStl::list { 9 | public: 10 | typedef NStl::list TBase; 11 | typedef typename TBase::size_type size_type; 12 | 13 | inline ylist() 14 | : TBase() 15 | { 16 | } 17 | 18 | inline ylist(size_type n, const T& val) 19 | : TBase(n, val) 20 | { 21 | } 22 | 23 | inline ylist(const typename TBase::allocator_type& a) 24 | : TBase(a) 25 | { 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /util/generic/ptr.cpp: -------------------------------------------------------------------------------- 1 | #include "ptr.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | void TFree::DoDestroy(void* t) throw () { 10 | free(t); 11 | } 12 | 13 | void TDelete::Destroy(void* t) throw () { 14 | ::operator delete(t); 15 | } 16 | -------------------------------------------------------------------------------- /util/generic/stack.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "deque.h" 4 | 5 | #include 6 | 7 | template > 8 | class ystack: public NStl::stack { 9 | typedef NStl::stack TBase; 10 | public: 11 | inline ystack() 12 | : TBase() 13 | { 14 | } 15 | 16 | explicit ystack(const S& s) 17 | : TBase(s) 18 | { 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /util/generic/stlfwd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace NStl { 4 | template 5 | class basic_string; 6 | 7 | template 8 | class basic_istream; 9 | 10 | template 11 | class basic_ostream; 12 | 13 | template 14 | class char_traits; 15 | 16 | template 17 | class basic_string; 18 | 19 | template 20 | struct pair; 21 | } 22 | 23 | typedef NStl::basic_istream > TIStream; 24 | typedef NStl::basic_ostream > TOStream; 25 | -------------------------------------------------------------------------------- /util/generic/strbuf.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Created on: May 28, 2010 3 | * Author: albert@ 4 | * 5 | * $Id: strbuf.cpp 224164 2010-05-31 22:57:49Z albert $ 6 | */ 7 | 8 | #include "strbuf.h" 9 | #include 10 | 11 | template <> 12 | void Out(TOutputStream& os, const TStringBuf& obj) { 13 | os.Write(obj.data(), obj.length()); 14 | } 15 | template <> 16 | void Out(TOutputStream& os, const TWtringBuf& obj) { 17 | WriteString(os, obj.data(), obj.length()); 18 | } 19 | -------------------------------------------------------------------------------- /util/generic/stroka_io.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stroka.h" 4 | 5 | #include 6 | 7 | //FIXME: depricate it! 8 | -------------------------------------------------------------------------------- /util/generic/yexception_ut.c: -------------------------------------------------------------------------------- 1 | #include "yexception_ut.h" 2 | 3 | void TestCallback(TCallbackFun f, int i) { 4 | f(i); 5 | } 6 | -------------------------------------------------------------------------------- /util/generic/yexception_ut.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | typedef void (*TCallbackFun)(int); 8 | 9 | //! just calls callback with parameter @c i 10 | void TestCallback(TCallbackFun f, int i); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /util/green/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(WERROR) 4 | 5 | ENABLE(NOUTIL) 6 | 7 | SRCS( 8 | impl.cpp 9 | poller.cpp 10 | ) 11 | 12 | END() 13 | -------------------------------------------------------------------------------- /util/httpdate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | #define BAD_DATE ((time_t)-1) 8 | 9 | inline time_t parse_http_date(const char *datestring) { 10 | try { 11 | return TInstant::ParseHttp(datestring).TimeT(); 12 | } catch (const TDateTimeParseException&) { 13 | return BAD_DATE; 14 | } 15 | } 16 | 17 | int format_http_date(char buf[], size_t size, time_t when); 18 | const char *format_http_date(time_t when); 19 | -------------------------------------------------------------------------------- /util/logger/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | SRCS( 6 | log.cpp 7 | system.cpp 8 | file.cpp 9 | null.cpp 10 | backend.cpp 11 | thread.cpp 12 | stream.cpp 13 | element.cpp 14 | 15 | all.h 16 | priority.h 17 | record.h 18 | ) 19 | 20 | END() 21 | -------------------------------------------------------------------------------- /util/logger/all.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "log.h" 4 | #include "null.h" 5 | #include "file.h" 6 | #include "stream.h" 7 | #include "thread.h" 8 | #include "system.h" 9 | -------------------------------------------------------------------------------- /util/logger/backend.cpp: -------------------------------------------------------------------------------- 1 | #include "backend.h" 2 | 3 | TLogBackend::TLogBackend() throw () { 4 | } 5 | 6 | TLogBackend::~TLogBackend() throw () { 7 | } 8 | -------------------------------------------------------------------------------- /util/logger/backend.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct TLogRecord; 6 | 7 | class TLogBackend: public TNonCopyable { 8 | public: 9 | TLogBackend() throw (); 10 | virtual ~TLogBackend() throw (); 11 | 12 | virtual void WriteData(const TLogRecord& rec) = 0; 13 | virtual void ReopenLog() = 0; 14 | }; 15 | -------------------------------------------------------------------------------- /util/logger/element.cpp: -------------------------------------------------------------------------------- 1 | #include "log.h" 2 | #include "element.h" 3 | 4 | TLogElement::TLogElement(TLog* parent) 5 | : Parent_(parent) 6 | , Priority_(Parent_->DefaultPriority()) 7 | { 8 | Reset(); 9 | } 10 | 11 | TLogElement::~TLogElement() throw () { 12 | try { 13 | Finish(); 14 | } catch (...) { 15 | } 16 | } 17 | 18 | void TLogElement::DoFlush() { 19 | const size_t filled = Filled(); 20 | 21 | if (filled) { 22 | Parent_->Write(Priority_, Data(), filled); 23 | Reset(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /util/logger/file.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "backend.h" 4 | 5 | #include 6 | 7 | class Stroka; 8 | 9 | class TFileLogBackend: public TLogBackend { 10 | public: 11 | TFileLogBackend(const Stroka& path); 12 | virtual ~TFileLogBackend() throw (); 13 | 14 | virtual void WriteData(const TLogRecord& rec); 15 | virtual void ReopenLog(); 16 | 17 | private: 18 | class TImpl; 19 | THolder Impl_; 20 | }; 21 | -------------------------------------------------------------------------------- /util/logger/null.cpp: -------------------------------------------------------------------------------- 1 | #include "null.h" 2 | 3 | TNullLogBackend::TNullLogBackend() { 4 | } 5 | 6 | TNullLogBackend::~TNullLogBackend() throw () { 7 | } 8 | 9 | void TNullLogBackend::WriteData(const TLogRecord&) { 10 | } 11 | 12 | void TNullLogBackend::ReopenLog() { 13 | } 14 | -------------------------------------------------------------------------------- /util/logger/null.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "backend.h" 4 | 5 | class TNullLogBackend: public TLogBackend { 6 | public: 7 | TNullLogBackend(); 8 | virtual ~TNullLogBackend() throw (); 9 | 10 | virtual void WriteData(const TLogRecord& rec); 11 | virtual void ReopenLog(); 12 | }; 13 | -------------------------------------------------------------------------------- /util/logger/priority.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum TLogPriority { 4 | TLOG_EMERG = 0, /* system is unusable */ 5 | TLOG_ALERT = 1, /* action must be taken immediately */ 6 | TLOG_CRIT = 2, /* critical conditions */ 7 | TLOG_ERR = 3, /* error conditions */ 8 | TLOG_WARNING = 4, /* warning conditions */ 9 | TLOG_NOTICE = 5, /* normal but significant condition */ 10 | TLOG_INFO = 6, /* informational */ 11 | TLOG_DEBUG = 7 /* debug-level messages */ 12 | }; 13 | 14 | #define LOG_DEF_PRIORITY TLOG_INFO 15 | -------------------------------------------------------------------------------- /util/logger/record.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "priority.h" 4 | 5 | #include 6 | 7 | struct TLogRecord { 8 | const char* Data; 9 | size_t Len; 10 | TLogPriority Priority; 11 | 12 | inline TLogRecord(TLogPriority priority, const char* data, size_t len) throw () 13 | : Data(data) 14 | , Len(len) 15 | , Priority(priority) 16 | { 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /util/logger/stream.cpp: -------------------------------------------------------------------------------- 1 | #include "stream.h" 2 | #include "record.h" 3 | 4 | #include 5 | 6 | TStreamLogBackend::TStreamLogBackend(TOutputStream* slave) 7 | : Slave_(slave) 8 | { 9 | } 10 | 11 | TStreamLogBackend::~TStreamLogBackend() throw () { 12 | } 13 | 14 | void TStreamLogBackend::WriteData(const TLogRecord& rec) { 15 | Slave_->Write(rec.Data, rec.Len); 16 | } 17 | 18 | void TStreamLogBackend::ReopenLog() { 19 | } 20 | -------------------------------------------------------------------------------- /util/logger/stream.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "backend.h" 4 | 5 | class TOutputStream; 6 | 7 | class TStreamLogBackend: public TLogBackend { 8 | public: 9 | TStreamLogBackend(TOutputStream* slave); 10 | virtual ~TStreamLogBackend() throw (); 11 | 12 | virtual void WriteData(const TLogRecord& rec); 13 | virtual void ReopenLog(); 14 | 15 | private: 16 | TOutputStream* Slave_; 17 | }; 18 | -------------------------------------------------------------------------------- /util/logger/thread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "backend.h" 4 | 5 | #include 6 | 7 | class TThreadedLogBackend: public TLogBackend { 8 | public: 9 | TThreadedLogBackend(TLogBackend* slave); 10 | TThreadedLogBackend(TLogBackend* slave, size_t queuelen); 11 | virtual ~TThreadedLogBackend() throw (); 12 | 13 | virtual void WriteData(const TLogRecord& rec); 14 | virtual void ReopenLog(); 15 | 16 | private: 17 | class TImpl; 18 | THolder Impl_; 19 | }; 20 | -------------------------------------------------------------------------------- /util/memory/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | SRCS( 6 | profile.cpp 7 | tempbuf.cpp 8 | blob.cpp 9 | mmapalloc.cpp 10 | alloc.cpp 11 | pool.cpp 12 | 13 | addstorage.h 14 | gc.h 15 | segmented_string_pool.h 16 | segpool_alloc.h 17 | smallobj.h 18 | ) 19 | 20 | END() 21 | -------------------------------------------------------------------------------- /util/memory/addstorage_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "addstorage.h" 2 | 3 | #include 4 | 5 | class TAddStorageTest: public TTestBase { 6 | UNIT_TEST_SUITE(TAddStorageTest); 7 | UNIT_TEST(TestIt) 8 | UNIT_TEST_SUITE_END(); 9 | 10 | class TClass: public TAdditionalStorage { 11 | }; 12 | 13 | private: 14 | inline void TestIt() { 15 | THolder c(new (100) TClass); 16 | 17 | UNIT_ASSERT_EQUAL(c->AdditionalDataLength(), 100); 18 | 19 | //test segfault 20 | memset(c->AdditionalData(), 0, c->AdditionalDataLength()); 21 | } 22 | }; 23 | 24 | UNIT_TEST_SUITE_REGISTRATION(TAddStorageTest); 25 | -------------------------------------------------------------------------------- /util/memory/alloc.cpp: -------------------------------------------------------------------------------- 1 | #include "alloc.h" 2 | 3 | #include 4 | 5 | template <> 6 | struct TSingletonTraits { 7 | static const size_t Priority = 256; 8 | }; 9 | 10 | IAllocator* TDefaultAllocator::Instance() throw () { 11 | return Singleton(); 12 | } 13 | -------------------------------------------------------------------------------- /util/memory/gc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "addstorage.h" 4 | 5 | #include 6 | #include 7 | 8 | class TMemoryGc { 9 | class TAllocation: public TIntrusiveListItem 10 | , public TAdditionalStorage { 11 | }; 12 | 13 | public: 14 | inline void* Allocate(size_t len) { 15 | TAllocation* ret = new (len) TAllocation; 16 | 17 | Allocs_.PushBack(ret); 18 | 19 | return ret->AdditionalData(); 20 | } 21 | 22 | inline void Deallocate(void* ptr) throw () { 23 | if (ptr) { 24 | delete TAllocation::ObjectFromData(ptr); 25 | } 26 | } 27 | 28 | private: 29 | TIntrusiveListWithAutoDelete Allocs_; 30 | }; 31 | -------------------------------------------------------------------------------- /util/memory/mmapalloc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IAllocator; 4 | 5 | /* 6 | * return anonymous memory based allocator 7 | */ 8 | IAllocator* MmapAllocator(); 9 | -------------------------------------------------------------------------------- /util/memory/pool.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "pool.h" 3 | 4 | #include 5 | 6 | template <> 7 | struct TSingletonTraits { 8 | static const size_t Priority = 256; 9 | }; 10 | 11 | template <> 12 | struct TSingletonTraits { 13 | static const size_t Priority = 256; 14 | }; 15 | 16 | TMemoryPool::IGrowPolicy* TMemoryPool::TLinearGrow::Instance() throw () { 17 | return Singleton(); 18 | } 19 | 20 | TMemoryPool::IGrowPolicy* TMemoryPool::TExpGrow::Instance() throw () { 21 | return Singleton(); 22 | } 23 | -------------------------------------------------------------------------------- /util/network/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(WERROR) 4 | 5 | ENABLE(NOUTIL) 6 | 7 | SRCS( 8 | hostip.cpp 9 | init.cpp 10 | poller.cpp 11 | socket.cpp 12 | pair.cpp 13 | address.cpp 14 | 15 | ip.h 16 | pollerimpl.h 17 | sock.h 18 | ) 19 | 20 | END() 21 | -------------------------------------------------------------------------------- /util/network/hostip.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace NResolver { 6 | // resolve hostname and fills up to *slots slots in ip array; 7 | // actual number of slots filled is returned in *slots; 8 | int GetHostIP(const char* hostname, ui32* ip, size_t* slots); 9 | int GetDnsError(); 10 | 11 | inline int GetHostIP(const char* hostname, ui32* ip) { 12 | size_t slots = 1; 13 | 14 | return GetHostIP(hostname, ip, &slots); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /util/network/init.cpp: -------------------------------------------------------------------------------- 1 | #include "init.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class TNetworkInit { 12 | public: 13 | inline TNetworkInit() { 14 | #ifndef ROBOT_SIGPIPE 15 | signal(SIGPIPE, SIG_IGN); 16 | #endif 17 | 18 | #if defined(_win_) 19 | #pragma comment(lib, "ws2_32.lib") 20 | WSADATA wsaData; 21 | int result = WSAStartup(MAKEWORD(2, 2), &wsaData); 22 | YASSERT(!result); 23 | if (result) { 24 | exit(-1); 25 | } 26 | #endif 27 | } 28 | }; 29 | 30 | void InitNetworkSubSystem() { 31 | (void)Singleton(); 32 | } 33 | -------------------------------------------------------------------------------- /util/network/pair.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "init.h" 4 | 5 | int SocketPair(SOCKET socks[2], bool overlapped); 6 | 7 | static inline int SocketPair(SOCKET socks[2]) { 8 | return SocketPair(socks, false); 9 | } 10 | -------------------------------------------------------------------------------- /util/private/galloc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | 6 | SRCDIR( 7 | ADDINCL util/private/jalloc 8 | ) 9 | 10 | SRCS( 11 | galloc.cpp 12 | hack.cpp 13 | ) 14 | 15 | END() 16 | -------------------------------------------------------------------------------- /util/private/galloc/stacktrace.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | static inline int GetStackTrace(void** /*result*/, int /*max_depth*/, int /*skip_count*/) throw () { 4 | return 0; 5 | } 6 | 7 | static inline bool GetStackExtent(void* /*sp*/, void** /*stack_top*/, void** /*stack_bottom*/ ) throw () { 8 | return false; 9 | } 10 | -------------------------------------------------------------------------------- /util/private/jalloc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | 6 | SRCS( 7 | malloc.c 8 | hack.cpp 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /util/private/jalloc/hack.cpp: -------------------------------------------------------------------------------- 1 | #include "hack.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | TJNewHook JNewHook() { 11 | return TAllocatorHooks::NewHook(); 12 | } 13 | 14 | TJDelHook JDelHook() { 15 | return TAllocatorHooks::DelHook(); 16 | } 17 | 18 | size_t AllocNumberOfCpus() { 19 | return NAllocSystemInfo::CachedNumberOfCpus(); 20 | } 21 | 22 | size_t MyThreadId() { 23 | return SystemCurrentThreadId(); 24 | } 25 | 26 | #include "spinlock.h" 27 | 28 | void SPIN_L(spinlock_t* l) { 29 | AcquireAdaptiveLock(l); 30 | } 31 | 32 | void SPIN_U(spinlock_t* l) { 33 | ReleaseAdaptiveLock(l); 34 | } 35 | -------------------------------------------------------------------------------- /util/private/jalloc/hack.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #if defined(__cplusplus) 6 | extern "C" { 7 | #endif 8 | 9 | #define AcquireAdaptiveLockSlow AllocAcquireAdaptiveLockSlow 10 | #define SchedYield AllocSchedYield 11 | #define ThreadYield AllocThreadYield 12 | #define NSystemInfo NAllocSystemInfo 13 | 14 | typedef void (*TJDelHook)(void*); 15 | typedef void (*TJNewHook)(void*, size_t); 16 | 17 | TJNewHook JNewHook(); 18 | TJDelHook JDelHook(); 19 | 20 | size_t AllocNumberOfCpus(); 21 | size_t MyThreadId(); 22 | 23 | #if defined(__cplusplus) 24 | }; 25 | #endif 26 | -------------------------------------------------------------------------------- /util/private/jalloc/rename.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define _getprogname getprogname 4 | #define _pthread_self pthread_self 5 | #define _write write 6 | #define _pthread_mutex_trylock pthread_mutex_trylock 7 | #define _pthread_mutex_lock pthread_mutex_lock 8 | #define _pthread_mutex_unlock pthread_mutex_unlock 9 | -------------------------------------------------------------------------------- /util/private/jalloc/spinlock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | typedef volatile intptr_t spinlock_t; 6 | 7 | #define SPIN_L AllocAcquireAdaptiveLock 8 | #define SPIN_U AllocReleaseAdaptiveLock 9 | 10 | #define _SPINLOCK_INITIALIZER 0 11 | #define _SPINUNLOCK(_lck) SPIN_U(_lck) 12 | #define _SPINLOCK(_lck) SPIN_L(_lck) 13 | 14 | #if defined(__cplusplus) 15 | extern "C" { 16 | #endif 17 | void SPIN_L(spinlock_t* lock); 18 | void SPIN_U(spinlock_t* lock); 19 | #if defined(__cplusplus) 20 | }; 21 | #endif 22 | -------------------------------------------------------------------------------- /util/private/lfalloc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | ENABLE(NO_COMPILER_WARNINGS) 5 | 6 | SRCS( 7 | lf_allocX64.cpp 8 | ) 9 | SET(IDE_FOLDER "util") 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/src/aligned_buffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | _STLP_BEGIN_NAMESPACE 4 | // this is for fake initialization 5 | template 6 | union _Stl_aligned_buffer { 7 | char buf[sizeof(T)]; 8 | struct { double a; double b; } padding; 9 | 10 | T* operator&() { 11 | return __REINTERPRET_CAST(T*, this); 12 | } 13 | 14 | T const* operator&() const { 15 | return __REINTERPRET_CAST(T const*, this); 16 | } 17 | }; 18 | _STLP_END_NAMESPACE 19 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/rlocks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | # if (__SUNPRO_CC >= 0x500 ) 4 | # include <../CCios/rlocks.h> 5 | # elif defined (__SUNPRO_CC) 6 | # include <../CC/rlocks.h> 7 | # else 8 | # error "This file is for SUN CC only. Please remove it if it causes any harm for other compilers." 9 | # endif 10 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stdiostream.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | # if (__SUNPRO_CC >= 0x500 ) 4 | # include <../CCios/stdiostream.h> 5 | # else if defined (__SUNPRO_CC) 6 | # include <../CC/stdiostream.h> 7 | # else 8 | # error "This file is for SUN CC only. Please remove it if it causes any harm for other compilers." 9 | # endif 10 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/_ioserr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is included in every header that needs the STLport library to be 3 | * built; the header files mostly are the iostreams-headers. The file checks for 4 | * _STLP_USE_NO_IOSTREAMS or _STLP_NO_IOSTREAMS being not defined, so that the 5 | * iostreams part of STLport cannot be used when the symbols were defined 6 | * accidentally. 7 | */ 8 | #if defined (_STLP_NO_IOSTREAMS) 9 | # error STLport iostreams header cannot be used; you chose not to use iostreams in the STLport configuration file (stlport/stl/config/user_config.h). 10 | #elif defined (_STLP_USE_NO_IOSTREAMS ) 11 | # error STLport iostreams header cannot be used; your compiler do not support it. 12 | #endif 13 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/_relops_hash_cont.h: -------------------------------------------------------------------------------- 1 | /* This is an implementation file which is intended to be included 2 | * multiple times with different _STLP_TEMPLATE_CONTAINER settings. 3 | */ 4 | 5 | #if defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER) 6 | 7 | _STLP_TEMPLATE_HEADER 8 | inline void _STLP_CALL 9 | swap(_STLP_TEMPLATE_CONTAINER& __hm1, _STLP_TEMPLATE_CONTAINER& __hm2) { 10 | __hm1.swap(__hm2); 11 | } 12 | 13 | #endif /* _STLP_FUNCTION_TMPL_PARTIAL_ORDER */ 14 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/config/_aix.h: -------------------------------------------------------------------------------- 1 | #define _STLP_PLATFORM "AIX" 2 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/config/_cygwin.h: -------------------------------------------------------------------------------- 1 | #define _STLP_PLATFORM "Cygwin" 2 | 3 | /* Glibc is the platform API */ 4 | #if !defined (_STLP_USE_GLIBC) 5 | # define _STLP_USE_GLIBC 6 | #endif 7 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/config/_epilog.h: -------------------------------------------------------------------------------- 1 | #if defined (_STLP_MSVC) || defined (__ICL) || defined (__BORLANDC__) 2 | 3 | #if defined (__BORLANDC__) 4 | # pragma option pop 5 | # pragma option -w-pow // -w-8062 Previous options and warnings not restored 6 | #else 7 | # if !(defined (_STLP_MSVC) && (_STLP_MSVC < 1200)) 8 | # pragma warning (pop) 9 | # endif 10 | # pragma pack (pop) 11 | #endif 12 | 13 | #elif defined (__sgi) && !defined (__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) 14 | 15 | # pragma reset woff 1174 16 | # pragma reset woff 1375 17 | # pragma reset woff 1209 18 | /* from iterator_base.h */ 19 | # pragma reset woff 1183 20 | 21 | #elif defined (__DECCXX) 22 | 23 | # ifdef __PRAGMA_ENVIRONMENT 24 | # pragma __environment __restore 25 | # endif 26 | 27 | #elif defined (__IBMCPP__) 28 | 29 | # pragma info(restore) 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/config/_freebsd.h: -------------------------------------------------------------------------------- 1 | #define _STLP_PLATFORM "Free BSD" 2 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/config/_fujitsu.h: -------------------------------------------------------------------------------- 1 | /* STLport configuration for Fujitsu compiler : looks like a perfect one ! */ 2 | #define _STLP_COMPILER "Fujitsu" 3 | 4 | #define _STLP_NATIVE_INCLUDE_PATH ../std 5 | #define _STLP_UINT32_T unsigned int 6 | #define _STLP_LONG_LONG long long 7 | #define _STLP_WCHAR_SUNPRO_EXCLUDE 1 8 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/config/_hpux.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define _STLP_PLATFORM "HP Unix" 4 | 5 | #ifdef __GNUC__ 6 | # define _STLP_NO_WCHAR_T 7 | # define _STLP_NO_LONG_DOUBLE 8 | #endif 9 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/config/_mac.h: -------------------------------------------------------------------------------- 1 | #define _STLP_PLATFORM "Mac" 2 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/config/_macosx.h: -------------------------------------------------------------------------------- 1 | #define _STLP_PLATFORM "Mac OS X" 2 | 3 | #if defined (__BIG_ENDIAN__) 4 | # define _STLP_BIG_ENDIAN 1 5 | #elif defined (__LITTLE_ENDIAN__) 6 | # define _STLP_LITTLE_ENDIAN 1 7 | #endif 8 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/config/_mlc.h: -------------------------------------------------------------------------------- 1 | // STLport configuration file 2 | // It is internal STLport header - DO NOT include it directly 3 | 4 | #define _STLP_NO_MEMBER_TEMPLATES // Compiler does not support member templates 5 | #define _STLP_NO_MEMBER_TEMPLATE_CLASSES // Compiler does not support member template classes 6 | 7 | #define _STLP_HAS_NEW_NEW_HEADER 8 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/config/_netware.h: -------------------------------------------------------------------------------- 1 | #define _STLP_PLATFORM "Novell Netware" 2 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/config/_openbsd.h: -------------------------------------------------------------------------------- 1 | #define _STLP_PLATFORM "Open BSD" 2 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/stl/config/host.h: -------------------------------------------------------------------------------- 1 | #include "../../../../config.h" 2 | 3 | #define _STLP_NO_UNCAUGHT_EXCEPT_SUPPORT 4 | #define _STLP_NO_UNEXPECTED_EXCEPT_SUPPORT 5 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/export: -------------------------------------------------------------------------------- 1 | cstring 2 | fstream 3 | iomanip 4 | ios 5 | iosfwd 6 | iostream 7 | istream 8 | locale 9 | ostream 10 | sstream 11 | streambuf 12 | strstream 13 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/fstream: -------------------------------------------------------------------------------- 1 | #ifdef _STLP_BROKEN_USING_DIRECTIVE 2 | using namespace _STLP_STD; 3 | #else 4 | using _STLP_NEW_IO_NAMESPACE::basic_filebuf; 5 | using _STLP_NEW_IO_NAMESPACE::filebuf; 6 | using _STLP_NEW_IO_NAMESPACE::basic_ifstream; 7 | using _STLP_NEW_IO_NAMESPACE::basic_ofstream; 8 | using _STLP_NEW_IO_NAMESPACE::ifstream; 9 | using _STLP_NEW_IO_NAMESPACE::ofstream; 10 | using _STLP_NEW_IO_NAMESPACE::basic_fstream; 11 | using _STLP_NEW_IO_NAMESPACE::fstream; 12 | 13 | # ifndef _STLP_NO_WIDE_STREAMS 14 | using _STLP_NEW_IO_NAMESPACE::wofstream; 15 | using _STLP_NEW_IO_NAMESPACE::wfilebuf; 16 | using _STLP_NEW_IO_NAMESPACE::wifstream; 17 | using _STLP_NEW_IO_NAMESPACE::wfstream; 18 | # endif 19 | #endif 20 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/h/fstream.h: -------------------------------------------------------------------------------- 1 | using ::streambuf; 2 | using ::ifstream; 3 | using ::ofstream; 4 | using ::fstream; 5 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/h/iomanip.h: -------------------------------------------------------------------------------- 1 | using ::setiosflags; 2 | using ::resetiosflags; 3 | // using ::setbase; 4 | using ::setfill; 5 | using ::setprecision; 6 | using ::setw; 7 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/h/iostream.h: -------------------------------------------------------------------------------- 1 | using _STLP_OLD_IO_NAMESPACE::istream; 2 | using _STLP_OLD_IO_NAMESPACE::ostream; 3 | 4 | /* HP aCC include files re-define these when THREAD_SAFE */ 5 | #if !defined(cin) 6 | using _STLP_OLD_IO_NAMESPACE::cin; 7 | #endif 8 | #if !defined(cout) 9 | using _STLP_OLD_IO_NAMESPACE::cout; 10 | #endif 11 | #if !defined(cerr) 12 | using _STLP_OLD_IO_NAMESPACE::cerr; 13 | #endif 14 | #if !defined(clog) 15 | using _STLP_OLD_IO_NAMESPACE::clog; 16 | #endif 17 | 18 | using _STLP_OLD_IO_NAMESPACE::endl; 19 | using _STLP_OLD_IO_NAMESPACE::ends; 20 | 21 | using _STLP_OLD_IO_NAMESPACE::ios; 22 | using _STLP_OLD_IO_NAMESPACE::flush; 23 | 24 | // using _STLP_OLD_IO_NAMESPACE::ws; 25 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/h/ostream.h: -------------------------------------------------------------------------------- 1 | using _STLP_OLD_IO_NAMESPACE::ostream; 2 | using _STLP_OLD_IO_NAMESPACE::endl; 3 | using _STLP_OLD_IO_NAMESPACE::ends; 4 | using _STLP_OLD_IO_NAMESPACE::flush; 5 | 6 | // using _STLP_OLD_IO_NAMESPACE::ws; 7 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/h/streambuf.h: -------------------------------------------------------------------------------- 1 | using ::streambuf; 2 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/h/strstream.h: -------------------------------------------------------------------------------- 1 | using _STLP_OLD_IO_NAMESPACE::strstreambuf; 2 | using _STLP_OLD_IO_NAMESPACE::istrstream; 3 | using _STLP_OLD_IO_NAMESPACE::ostrstream; 4 | using _STLP_OLD_IO_NAMESPACE::strstream; 5 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/iomanip: -------------------------------------------------------------------------------- 1 | using _STLP_NEW_IO_NAMESPACE::setiosflags; 2 | using _STLP_NEW_IO_NAMESPACE::resetiosflags; 3 | using _STLP_NEW_IO_NAMESPACE::setbase; 4 | using _STLP_NEW_IO_NAMESPACE::setfill; 5 | using _STLP_NEW_IO_NAMESPACE::setprecision; 6 | using _STLP_NEW_IO_NAMESPACE::setw; 7 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/iostream: -------------------------------------------------------------------------------- 1 | 2 | # include 3 | 4 | using _STLP_VENDOR_STD::cin; 5 | using _STLP_VENDOR_STD::cout; 6 | using _STLP_VENDOR_STD::cerr; 7 | using _STLP_VENDOR_STD::clog; 8 | 9 | # if ! defined (_STLP_NO_WIDE_STREAMS) 10 | using _STLP_VENDOR_STD::wcin; 11 | using _STLP_VENDOR_STD::wcout; 12 | using _STLP_VENDOR_STD::wcerr; 13 | using _STLP_VENDOR_STD::wclog; 14 | # endif 15 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/istream: -------------------------------------------------------------------------------- 1 | # include 2 | 3 | using _STLP_NEW_IO_NAMESPACE::basic_istream; 4 | using _STLP_NEW_IO_NAMESPACE::basic_iostream; 5 | 6 | using _STLP_NEW_IO_NAMESPACE::istream; 7 | using _STLP_NEW_IO_NAMESPACE::iostream; 8 | 9 | # if !defined (_STLP_NO_NATIVE_WIDE_STREAMS) 10 | using _STLP_NEW_IO_NAMESPACE::wistream; 11 | using _STLP_NEW_IO_NAMESPACE::wiostream; 12 | # endif 13 | 14 | #if !(defined (_STLP_MSVC) && (_STLP_MSVC < 1200)) 15 | using _STLP_NEW_IO_NAMESPACE::ws; 16 | #endif 17 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/ostream: -------------------------------------------------------------------------------- 1 | using _STLP_NEW_IO_NAMESPACE::basic_ostream; 2 | using _STLP_NEW_IO_NAMESPACE::ostream; 3 | 4 | # ifndef _STLP_NO_WIDE_STREAMS 5 | using _STLP_NEW_IO_NAMESPACE::wostream; 6 | # endif 7 | 8 | using _STLP_NEW_IO_NAMESPACE::endl; 9 | using _STLP_NEW_IO_NAMESPACE::ends; 10 | using _STLP_NEW_IO_NAMESPACE::flush; 11 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/sstream: -------------------------------------------------------------------------------- 1 | using _STLP_NEW_IO_NAMESPACE::basic_stringbuf; 2 | using _STLP_NEW_IO_NAMESPACE::stringbuf; 3 | 4 | using _STLP_NEW_IO_NAMESPACE::basic_istringstream; 5 | using _STLP_NEW_IO_NAMESPACE::basic_ostringstream; 6 | using _STLP_NEW_IO_NAMESPACE::basic_stringstream; 7 | using _STLP_NEW_IO_NAMESPACE::istringstream; 8 | using _STLP_NEW_IO_NAMESPACE::ostringstream; 9 | using _STLP_NEW_IO_NAMESPACE::stringstream; 10 | 11 | #ifndef _STLP_NO_WIDE_STREAMS 12 | using _STLP_NEW_IO_NAMESPACE::wstringbuf; 13 | using _STLP_NEW_IO_NAMESPACE::wistringstream; 14 | using _STLP_NEW_IO_NAMESPACE::wostringstream; 15 | using _STLP_NEW_IO_NAMESPACE::wstringstream; 16 | #endif 17 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/streambuf: -------------------------------------------------------------------------------- 1 | using _STLP_NEW_IO_NAMESPACE::basic_streambuf; 2 | using _STLP_NEW_IO_NAMESPACE::streambuf; 3 | #ifndef _STLP_NO_WIDE_STREAMS 4 | using _STLP_NEW_IO_NAMESPACE::wstreambuf; 5 | # endif 6 | -------------------------------------------------------------------------------- /util/private/stl/stlport-5.1.4/stlport/using/strstream: -------------------------------------------------------------------------------- 1 | using _STLP_NEW_IO_NAMESPACE::strstreambuf; 2 | using _STLP_NEW_IO_NAMESPACE::istrstream; 3 | using _STLP_NEW_IO_NAMESPACE::ostrstream; 4 | using _STLP_NEW_IO_NAMESPACE::strstream; 5 | -------------------------------------------------------------------------------- /util/random/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | SRCS( 6 | randcpp.cpp 7 | random.cpp 8 | entropy.cpp 9 | rc4.cpp 10 | 11 | mersenne.h 12 | mersenne32.h 13 | mersenne64.h 14 | shuffle.h 15 | ) 16 | 17 | END() 18 | -------------------------------------------------------------------------------- /util/random/entropy.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TBuffer; 4 | class TInputStream; 5 | 6 | /* 7 | * fast entropy pool, based on good prng, 8 | * initialized with some bits from system entropy pool 9 | */ 10 | TInputStream* EntropyPool(); 11 | 12 | /* 13 | * initial host entropy data 14 | */ 15 | const TBuffer& HostEntropy(); 16 | -------------------------------------------------------------------------------- /util/random/randcpp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TRand { 4 | public: 5 | TRand(); 6 | char* initstate(unsigned long seed, char* arg_state, long n); 7 | char* setstate(char* arg_state); 8 | void srandom(unsigned long x); 9 | long random(); 10 | 11 | private: 12 | long randtbl[32]; 13 | long *fptr, *rptr, *state, rand_type, rand_deg, rand_sep, *end_ptr; 14 | }; 15 | -------------------------------------------------------------------------------- /util/random/randcpp_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "randcpp.h" 2 | 3 | #include 4 | 5 | class TRandTest: public TTestBase { 6 | UNIT_TEST_SUITE(TRandTest); 7 | UNIT_TEST(TestRandom) 8 | UNIT_TEST_SUITE_END(); 9 | private: 10 | inline void TestRandom() { 11 | TRand r; 12 | r.srandom(17); 13 | 14 | // PG said random() must be completely deterministic 15 | 16 | long expected[] = { 65, 57, 39, 47, 79, 59, 45, 11, 53, 27 }; 17 | for (unsigned int i = 0; i < ARRAY_SIZE(expected); ++i) { 18 | // printf("%ld\n", r.random() % 100); 19 | UNIT_ASSERT_EQUAL(expected[i], r.random() % 100); 20 | } 21 | } 22 | }; 23 | 24 | UNIT_TEST_SUITE_REGISTRATION(TRandTest); 25 | -------------------------------------------------------------------------------- /util/random/random.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | * thread-safe random number generator. 5 | * 6 | * specialized for: 7 | * all unsigned types (return value in range [0, MAX_VALUE_FOR_TYPE]) 8 | * bool 9 | * long double (return value in range [0, 1)) 10 | * double (return value in range [0, 1)) 11 | * float (return value in range [0, 1)) 12 | */ 13 | template 14 | T RandomNumber(); 15 | 16 | /* 17 | * returns value in range [0, max) 18 | */ 19 | template 20 | T RandomNumber(T max); 21 | -------------------------------------------------------------------------------- /util/random/shuffle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "random.h" 4 | 5 | #include 6 | 7 | template 8 | inline void Shuffle(TRandIter begin, TRandIterEnd end) { 9 | const size_t sz = end - begin; 10 | 11 | for (size_t i = 1; i < sz; ++i) { 12 | DoSwap(*(begin + i), *(begin + RandomNumber(i + 1))); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /util/random/shuffle_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "shuffle.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | SIMPLE_UNIT_TEST_SUITE(TRandUtilsTest) { 8 | SIMPLE_UNIT_TEST(TestShuffle) { 9 | Stroka s0, s1; 10 | Shuffle(s1.begin(), s1.end()); 11 | s1 = "0"; 12 | Shuffle(s1.begin(), s1.end()); 13 | s1 = "01"; 14 | Shuffle(s1.begin(), s1.end()); 15 | s1 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 16 | s0 = s1.copy(); 17 | Shuffle(s1.begin(), s1.end()); 18 | UNIT_ASSERT(s0 != s1); // if shuffle does work, chances it will fail are 1 to 64!. 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /util/regexp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | contrib/libs/pcre 5 | ) 6 | 7 | SRCS( 8 | glob_compat.h 9 | regexp.cpp 10 | ) 11 | 12 | IF (WIN32) 13 | SRCS( 14 | glob.cpp 15 | ) 16 | ENDIF (WIN32) 17 | 18 | END() 19 | -------------------------------------------------------------------------------- /util/server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(WERROR) 4 | 5 | SRCS( 6 | http.cpp 7 | static.cpp 8 | listen.cpp 9 | options.cpp 10 | ) 11 | 12 | END() 13 | -------------------------------------------------------------------------------- /util/sorter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | SRCS( 6 | buffile.h 7 | filesort.h 8 | filesortst.h 9 | sorter.cpp 10 | sorttree.h 11 | ) 12 | 13 | END() 14 | -------------------------------------------------------------------------------- /util/stream/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | PEERDIR( 6 | contrib/libs/lzmasdk 7 | contrib/libs/zlib 8 | contrib/libs/lz4 9 | contrib/libs/snappy 10 | util/network 11 | ) 12 | 13 | IF (NOT WIN32) 14 | SET(WERROR yes) 15 | ENDIF (NOT WIN32) 16 | 17 | SRCS( 18 | buffer.cpp 19 | buffered.cpp 20 | bzip2.cpp 21 | chunk.cpp 22 | debug.cpp 23 | file.cpp 24 | glue.cpp 25 | helpers.cpp 26 | http.cpp 27 | input.cpp 28 | lz.cpp 29 | lzma.cpp 30 | mem.cpp 31 | multi.cpp 32 | null.cpp 33 | output.cpp 34 | pipe.cpp 35 | str.cpp 36 | tee.cpp 37 | zerocopy.cpp 38 | zlib.cpp 39 | printf.cpp 40 | format.cpp 41 | 42 | aligned.h 43 | base.h 44 | ios.h 45 | length.h 46 | tempbuf.h 47 | tokenizer.h 48 | walk.h 49 | ) 50 | 51 | END() 52 | -------------------------------------------------------------------------------- /util/stream/base.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "input.h" 4 | #include "output.h" 5 | #include "zerocopy.h" 6 | -------------------------------------------------------------------------------- /util/stream/debug.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "output.h" 4 | 5 | /// @addtogroup Streams 6 | /// @{ 7 | 8 | /// Отладочный поток вывода. 9 | /// @details Вывод в stderr. 10 | class TDebugOutput: public TOutputStream { 11 | public: 12 | inline TDebugOutput() throw () {} 13 | virtual ~TDebugOutput() throw () {} 14 | 15 | private: 16 | virtual void DoWrite(const void* buf, size_t len); 17 | }; 18 | 19 | /// Отладочный поток вывода. 20 | /// @details Если переменная окружения DBGOUT = 1, вывод производится в Cerr, 21 | /// в противном случае - в Cnull. 22 | TOutputStream& StdDbgStream() throw (); 23 | 24 | int StdDbgLevel() throw (); 25 | 26 | #define Cdbg (StdDbgStream()) 27 | 28 | /// @} 29 | -------------------------------------------------------------------------------- /util/stream/format.cpp: -------------------------------------------------------------------------------- 1 | #include "format.h" 2 | 3 | #include 4 | #include 5 | 6 | void Time(TOutputStream& l) { 7 | l << millisec(); 8 | } 9 | 10 | void TimeHumanReadable(TOutputStream& l) { 11 | char timeStr[30]; 12 | const time_t t = time(0); 13 | 14 | l << ctime_r(&t, timeStr); 15 | } 16 | -------------------------------------------------------------------------------- /util/stream/glue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "input.h" 4 | #include "output.h" 5 | 6 | #include 7 | 8 | #include 9 | 10 | //DEPRECATED, DONT USE IN NEW CODE 11 | class TStreamBufAdaptor: public std::streambuf { 12 | public: 13 | TStreamBufAdaptor(TInputStream* istream, size_t ibuflen); 14 | TStreamBufAdaptor(TOutputStream* ostream, size_t obuflen); 15 | TStreamBufAdaptor(TInputStream* istream, size_t ibuflen, TOutputStream* ostream, size_t obuflen); 16 | virtual ~TStreamBufAdaptor() throw (); 17 | 18 | private: 19 | virtual int overflow(int c); 20 | virtual int underflow(); 21 | virtual int sync(); 22 | 23 | void SetOutBuf(); 24 | size_t InOutBuffer() const throw (); 25 | 26 | private: 27 | class TImpl; 28 | THolder Impl_; 29 | }; 30 | -------------------------------------------------------------------------------- /util/stream/helpers.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers.h" 2 | 3 | #include 4 | 5 | ui64 TransferData(TInputStream* in, TOutputStream* out, TBuffer& b) { 6 | return TransferData(in, out, b.Data(), b.Size()); 7 | } 8 | 9 | ui64 TransferData(TInputStream* in, TOutputStream* out, size_t sz) { 10 | TTempBuf tmp(sz); 11 | return TransferData(in, out, tmp.Data(), tmp.Size()); 12 | } 13 | 14 | ui64 TransferData(TInputStream* in, TOutputStream* out) { 15 | TTempBuf tmp; 16 | return TransferData(in, out, tmp.Data(), tmp.Size()); 17 | } 18 | 19 | ui64 TransferData(TInputStream* in, TOutputStream* out, void* buf, size_t sz) { 20 | ui64 totalReaded = 0; 21 | size_t readed; 22 | 23 | while ((readed = in->Read(buf, sz)) != 0) { 24 | out->Write(buf, readed); 25 | totalReaded += readed; 26 | } 27 | 28 | return totalReaded; 29 | } 30 | -------------------------------------------------------------------------------- /util/stream/helpers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "base.h" 4 | #include 5 | 6 | /// @addtogroup Streams 7 | /// @{ 8 | 9 | ui64 TransferData(TInputStream* in, TOutputStream* out, void* buf, size_t sz); 10 | ui64 TransferData(TInputStream* in, TOutputStream* out, TBuffer&); 11 | ui64 TransferData(TInputStream* in, TOutputStream* out, size_t sz); 12 | ui64 TransferData(TInputStream* in, TOutputStream* out); 13 | 14 | /// @} 15 | -------------------------------------------------------------------------------- /util/stream/ios.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "tee.h" 4 | #include "str.h" 5 | #include "mem.h" 6 | #include "base.h" 7 | #include "null.h" 8 | #include "pipe.h" 9 | #include "multi.h" 10 | #include "buffer.h" 11 | #include "helpers.h" 12 | #include "buffered.h" 13 | -------------------------------------------------------------------------------- /util/stream/lzma.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "lz.h" 4 | 5 | class TLzmaCompress: public TOutputStream { 6 | public: 7 | TLzmaCompress(TOutputStream* slave, size_t level = 7); 8 | virtual ~TLzmaCompress() throw (); 9 | 10 | private: 11 | virtual void DoWrite(const void* buf, size_t len); 12 | virtual void DoFinish(); 13 | 14 | private: 15 | class TImpl; 16 | THolder Impl_; 17 | }; 18 | 19 | class TLzmaDecompress: public TInputStream { 20 | public: 21 | TLzmaDecompress(TInputStream* slave); 22 | virtual ~TLzmaDecompress() throw (); 23 | 24 | private: 25 | virtual size_t DoRead(void* buf, size_t len); 26 | 27 | private: 28 | class TImpl; 29 | THolder Impl_; 30 | }; 31 | -------------------------------------------------------------------------------- /util/stream/multi.cpp: -------------------------------------------------------------------------------- 1 | #include "null.h" 2 | #include "multi.h" 3 | 4 | TMultiInput::TMultiInput(TInputStream* f, TInputStream* s) throw () 5 | : C_(f) 6 | , N_(s) 7 | { 8 | } 9 | 10 | TMultiInput::~TMultiInput() throw () { 11 | } 12 | 13 | size_t TMultiInput::DoRead(void* buf, size_t len) { 14 | const size_t ret = C_->Read(buf, len); 15 | 16 | if (ret) { 17 | return ret; 18 | } 19 | 20 | C_ = N_; 21 | N_ = &Cnull; 22 | 23 | return C_->Read(buf, len); 24 | } 25 | -------------------------------------------------------------------------------- /util/stream/multi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "input.h" 4 | 5 | /// @addtogroup Streams_Multi 6 | /// @{ 7 | 8 | /* 9 | * merge two input streams in one 10 | */ 11 | /// Объединение двух потоков ввода в один. 12 | /// @details При чтении данных первым обрабатывается поток f. 13 | class TMultiInput: public TInputStream { 14 | public: 15 | TMultiInput(TInputStream* f, TInputStream* s) throw (); 16 | virtual ~TMultiInput() throw (); 17 | 18 | private: 19 | virtual size_t DoRead(void* buf, size_t len); 20 | 21 | private: 22 | TInputStream* C_; 23 | TInputStream* N_; 24 | }; 25 | 26 | /// @} 27 | -------------------------------------------------------------------------------- /util/stream/null.cpp: -------------------------------------------------------------------------------- 1 | #include "null.h" 2 | 3 | #include 4 | 5 | TNullIO& StdNullStream() throw () { 6 | return *Singleton(); 7 | } 8 | 9 | TNullInput::TNullInput() throw () { 10 | } 11 | 12 | TNullInput::~TNullInput() throw () { 13 | } 14 | 15 | size_t TNullInput::DoRead(void* /*buf*/, size_t /*len*/) { 16 | return 0; 17 | } 18 | 19 | bool TNullInput::DoNext(const void** /*ptr*/, size_t* /*len*/) { 20 | return false; 21 | } 22 | 23 | TNullOutput::TNullOutput() throw () { 24 | } 25 | 26 | TNullOutput::~TNullOutput() throw () { 27 | } 28 | 29 | void TNullOutput::DoWrite(const void* /*buf*/, size_t /*len*/) { 30 | } 31 | 32 | TNullIO::TNullIO() throw () { 33 | } 34 | 35 | TNullIO::~TNullIO() throw () { 36 | } 37 | -------------------------------------------------------------------------------- /util/stream/printf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class TOutputStream; 6 | 7 | size_t printf_format(2,3) Printf(TOutputStream& out, const char* fmt, ...); 8 | size_t printf_format(2,0) Printf(TOutputStream& out, const char* fmt, va_list params); 9 | -------------------------------------------------------------------------------- /util/stream/printf_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "ios.h" 2 | #include "printf.h" 3 | 4 | #include 5 | 6 | SIMPLE_UNIT_TEST_SUITE(TStreamPrintfTest) { 7 | SIMPLE_UNIT_TEST(TestPrintf) { 8 | TStringStream ss; 9 | 10 | UNIT_ASSERT_EQUAL(Printf(ss, "qw %s %d", "er", 1), 7); 11 | UNIT_ASSERT_EQUAL(ss.Str(), "qw er 1"); 12 | } 13 | 14 | #ifdef __GNUC__ 15 | #pragma GCC diagnostic ignored "-Wformat-zero-length" 16 | #endif // __GNUC__ 17 | 18 | SIMPLE_UNIT_TEST(TestZeroString) { 19 | UNIT_ASSERT_EQUAL(Printf(Cnull, ""), 0); 20 | } 21 | 22 | SIMPLE_UNIT_TEST(TestLargePrintf) { 23 | Stroka s = NUnitTest::RandomString(1000000); 24 | TStringStream ss; 25 | 26 | Printf(ss, "%s", ~s); 27 | 28 | UNIT_ASSERT_EQUAL(ss.Str(), s); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /util/stream/str.cpp: -------------------------------------------------------------------------------- 1 | #include "str.h" 2 | 3 | TStringInput::~TStringInput() throw () { 4 | } 5 | 6 | size_t TStringInput::DoRead(void* buf, size_t len) { 7 | if (Pos_ < +S_) { 8 | const size_t toRead = Min(len, +S_ - Pos_); 9 | 10 | memcpy(buf, ~S_ + Pos_, toRead); 11 | Pos_ += toRead; 12 | 13 | return toRead; 14 | } 15 | 16 | return 0; 17 | } 18 | 19 | TStringOutput::~TStringOutput() throw () { 20 | } 21 | 22 | void TStringOutput::DoWrite(const void* buf, size_t len) { 23 | S_.append((const char*)buf, len); 24 | } 25 | 26 | TStringStream::~TStringStream() throw () { 27 | } 28 | -------------------------------------------------------------------------------- /util/stream/tee.cpp: -------------------------------------------------------------------------------- 1 | #include "tee.h" 2 | 3 | TTeeOutput::TTeeOutput(TOutputStream* l, TOutputStream* r) throw () 4 | : L_(l) 5 | , R_(r) 6 | { 7 | } 8 | 9 | TTeeOutput::~TTeeOutput() throw () { 10 | } 11 | 12 | void TTeeOutput::DoWrite(const void* buf, size_t len) { 13 | L_->Write(buf, len); 14 | R_->Write(buf, len); 15 | } 16 | 17 | void TTeeOutput::DoFlush() { 18 | L_->Flush(); 19 | R_->Flush(); 20 | } 21 | 22 | void TTeeOutput::DoFinish() { 23 | L_->Finish(); 24 | R_->Finish(); 25 | } 26 | -------------------------------------------------------------------------------- /util/stream/tee.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "output.h" 4 | 5 | /// @addtogroup Streams_Multi 6 | /// @{ 7 | 8 | /// Вывод данных в два потока одновременно. 9 | class TTeeOutput: public TOutputStream { 10 | public: 11 | TTeeOutput(TOutputStream* l, TOutputStream* r) throw (); 12 | virtual ~TTeeOutput() throw (); 13 | 14 | private: 15 | virtual void DoWrite(const void* buf, size_t len); 16 | virtual void DoFlush(); 17 | virtual void DoFinish(); 18 | 19 | private: 20 | TOutputStream* L_; 21 | TOutputStream* R_; 22 | }; 23 | 24 | /// @} 25 | -------------------------------------------------------------------------------- /util/stream/tempbuf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "output.h" 4 | 5 | #include 6 | 7 | class TTempBufOutput 8 | : public TOutputStream 9 | , public TTempBuf 10 | { 11 | public: 12 | TTempBufOutput() 13 | {} 14 | explicit TTempBufOutput(size_t size) 15 | : TTempBuf(size) 16 | {} 17 | 18 | public: 19 | virtual void DoWrite(const void* data, size_t len) { 20 | Append(data, len); 21 | } 22 | }; 23 | -------------------------------------------------------------------------------- /util/stream/trace.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "debug.h" 4 | 5 | enum ETraceLevel { 6 | TRACE_ERR = 1, 7 | TRACE_WARN = 2, 8 | TRACE_NOTICE = 3, 9 | TRACE_INFO = 4, 10 | TRACE_DEBUG = 5, 11 | TRACE_DETAIL = 6, 12 | TRACE_VERBOSE = 7 13 | }; 14 | 15 | #if !defined(NDEBUG) && !defined(ENABLE_TRACE) 16 | #define ENABLE_TRACE 17 | #endif 18 | 19 | #ifdef ENABLE_TRACE 20 | 21 | #define DBGTRACE(elevel, args) DBGTRACE0(int(TRACE_##elevel), args) 22 | #define DBGTRACE0(level, args) do if ((level) <= StdDbgLevel()) { StdDbgStream() << args << Endl; } while(false) 23 | 24 | #else 25 | 26 | #define DBGTRACE(elevel, args) do {} while (false) 27 | #define DBGTRACE0(level, args) do {} while (false) 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /util/stream/zerocopy.cpp: -------------------------------------------------------------------------------- 1 | #include "output.h" 2 | #include "zerocopy.h" 3 | 4 | ui64 TransferData(IZeroCopyInput* in, TOutputStream* out) { 5 | ui64 ret = 0; 6 | 7 | size_t len; 8 | const void* ptr; 9 | 10 | while (in->Next(&ptr, &len)) { 11 | out->Write(ptr, len); 12 | ret += (ui64)len; 13 | } 14 | 15 | return ret; 16 | } 17 | -------------------------------------------------------------------------------- /util/stream/zlib_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "zlib.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #define ZDATA "./zdata" 9 | 10 | static const Stroka data = "8s7d5vc6s5vc67sa4c65ascx6asd4xcv76adsfxv76s"; 11 | 12 | SIMPLE_UNIT_TEST_SUITE(TZLibTest) { 13 | SIMPLE_UNIT_TEST(Compress) { 14 | TFileOutput o(ZDATA); 15 | TZLibCompress c(&o, ZLib::ZLib); 16 | 17 | c.Write(~data, +data); 18 | c.Finish(); 19 | o.Finish(); 20 | } 21 | 22 | SIMPLE_UNIT_TEST(Decompress) { 23 | TTempFile tmpFile(ZDATA); 24 | 25 | { 26 | TFileInput i(ZDATA); 27 | TZLibDecompress d(&i); 28 | 29 | UNIT_ASSERT_EQUAL(d.ReadLine(), data); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /util/string/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | SRCS( 6 | base64.cpp 7 | cast.cpp 8 | cgiparam.cpp 9 | encodexml.cpp 10 | escape.cpp 11 | util.cpp 12 | vector.cpp 13 | htmlentgp.cpp 14 | htmlentity.cpp 15 | split_iterator.cpp 16 | split.cpp 17 | url.cpp 18 | kmp.cpp 19 | http.cpp 20 | quote.cpp 21 | ascii.cpp 22 | printf.cpp 23 | type.cpp 24 | strip.cpp 25 | pcdata.cpp 26 | 27 | cat.h 28 | hex.h 29 | scan.h 30 | subst.h 31 | traits.h 32 | 33 | ) 34 | 35 | END() 36 | -------------------------------------------------------------------------------- /util/string/ascii.cpp: -------------------------------------------------------------------------------- 1 | #include "ascii.h" 2 | 3 | extern const unsigned char asciiSpaces[256] = { 4 | 0,0,0,0, 0,0,0,0, 0,1,1,1, 1,1,0,0, //0 5 | 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, //1 6 | 1 //2 7 | }; 8 | -------------------------------------------------------------------------------- /util/string/ascii.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | inline bool IsAsciiSpace(char c) { 6 | extern const unsigned char asciiSpaces[256]; 7 | return asciiSpaces[(unsigned char)c]; 8 | } 9 | 10 | inline bool IsAsciiSpace(wchar16 c) { 11 | return (c < 127) && IsAsciiSpace((char)(unsigned char)c); 12 | } 13 | -------------------------------------------------------------------------------- /util/string/base64_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "base64.h" 2 | 3 | #include 4 | 5 | SIMPLE_UNIT_TEST_SUITE(TBase64) { 6 | SIMPLE_UNIT_TEST(TestEncode) { 7 | UNIT_ASSERT_VALUES_EQUAL(Base64Encode("12z"), "MTJ6"); 8 | UNIT_ASSERT_VALUES_EQUAL(Base64Encode("123"), "MTIz"); 9 | UNIT_ASSERT_VALUES_EQUAL(Base64Encode("12"), "MTI="); 10 | UNIT_ASSERT_VALUES_EQUAL(Base64Encode("1"), "MQ=="); 11 | } 12 | 13 | SIMPLE_UNIT_TEST(TestDecode) { 14 | UNIT_ASSERT_VALUES_EQUAL(Base64Decode("MTI="), "12"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /util/string/cstriter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct TCStringEndIterator { 4 | }; 5 | 6 | template 7 | static inline bool operator== (It b, TCStringEndIterator) { 8 | return !*b; 9 | } 10 | 11 | template 12 | static inline bool operator!= (It b, TCStringEndIterator) { 13 | return !!*b; 14 | } 15 | -------------------------------------------------------------------------------- /util/string/encodexml.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | /// @} 6 | 7 | /// @addtogroup Strings_FormattedText 8 | /// @{ 9 | 10 | /// Преобразует текст в XML-код. 11 | /// @details Символы, запрещенные спецификацией XML 1.0, удаляются. 12 | Stroka EncodeXML(const char* str, int qEncodeEntities = 1); 13 | 14 | /// Преобразует текст в XML-код, в котором могут присутствовать только цифровые сущности. 15 | /// @details Cимволы, запрещенные спецификацией XML 1.0, не удаляются. 16 | Stroka EncodeXMLString(const char* str); 17 | 18 | /// @} 19 | -------------------------------------------------------------------------------- /util/string/encodexml_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "encodexml.h" 2 | 3 | #include 4 | 5 | SIMPLE_UNIT_TEST_SUITE(TEncodeXml) { 6 | SIMPLE_UNIT_TEST(TestEncodeXML) { 7 | UNIT_ASSERT_EQUAL(EncodeXML("It's a \"test\" & ") == "It's a "test" & <TEST>", true); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /util/string/hex_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "hex.h" 2 | 3 | #include 4 | 5 | SIMPLE_UNIT_TEST_SUITE(THexCodingTest) { 6 | SIMPLE_UNIT_TEST(TestEncode) { 7 | UNIT_ASSERT_EQUAL(HexEncode("i1634iqwbf,&msdb"), "693136333469717762662C266D736462"); 8 | } 9 | 10 | SIMPLE_UNIT_TEST(TestDecode) { 11 | UNIT_ASSERT_EQUAL(HexDecode("693136333469717762662C266D736462"), "i1634iqwbf,&msdb"); 12 | } 13 | 14 | SIMPLE_UNIT_TEST(TestDecodeCase) { 15 | UNIT_ASSERT_EQUAL(HexDecode("12ABCDEF"), HexDecode("12abcdef")); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /util/string/htmlentity_ut.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/balancer/dc4ace0b9f72b0839a6e112f65ba288d81770118/util/string/htmlentity_ut.cpp -------------------------------------------------------------------------------- /util/string/http.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct TParsedHttpRequest { 6 | TParsedHttpRequest(const TStringBuf& str); 7 | 8 | TStringBuf Method; 9 | TStringBuf Request; 10 | TStringBuf Proto; 11 | }; 12 | 13 | struct TParsedHttpLocation { 14 | TParsedHttpLocation(const TStringBuf& req); 15 | 16 | TStringBuf Path; 17 | TStringBuf Cgi; 18 | }; 19 | 20 | struct TParsedHttpFull: public TParsedHttpRequest, public TParsedHttpLocation { 21 | inline TParsedHttpFull(const TStringBuf& line) 22 | : TParsedHttpRequest(line) 23 | , TParsedHttpLocation(Request) 24 | { 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /util/string/http_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "http.h" 2 | 3 | #include 4 | 5 | SIMPLE_UNIT_TEST_SUITE(THttpParse) { 6 | SIMPLE_UNIT_TEST(TestParse) { 7 | TParsedHttpFull h("GET /yandsearch?text=nokia HTTP/1.1"); 8 | 9 | UNIT_ASSERT_EQUAL(h.Method, "GET"); 10 | UNIT_ASSERT_EQUAL(h.Request, "/yandsearch?text=nokia"); 11 | UNIT_ASSERT_EQUAL(h.Proto, "HTTP/1.1"); 12 | 13 | UNIT_ASSERT_EQUAL(h.Path, "/yandsearch"); 14 | UNIT_ASSERT_EQUAL(h.Cgi, "text=nokia"); 15 | } 16 | 17 | SIMPLE_UNIT_TEST(TestError) { 18 | bool wasError = false; 19 | 20 | try { 21 | TParsedHttpFull("GET /yandsearch?text=nokiaHTTP/1.1"); 22 | } catch (...) { 23 | wasError = true; 24 | } 25 | 26 | UNIT_ASSERT(wasError); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /util/string/kmp.cpp: -------------------------------------------------------------------------------- 1 | #include "kmp.h" 2 | 3 | #include 4 | 5 | TKMPMatcher::TKMPMatcher(const char* patternBegin, const char* patternEnd) 6 | : Pattern(patternBegin, patternEnd) 7 | { 8 | ComputePrefixFunction(); 9 | } 10 | 11 | TKMPMatcher::TKMPMatcher(const Stroka& pattern) 12 | : Pattern(pattern) 13 | { 14 | ComputePrefixFunction(); 15 | } 16 | 17 | void TKMPMatcher::ComputePrefixFunction() { 18 | ssize_t* pf; 19 | ::ComputePrefixFunction(~Pattern, ~Pattern + +Pattern, &pf); 20 | PrefixFunction.Reset(pf); 21 | } 22 | -------------------------------------------------------------------------------- /util/string/pcdata.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | /// Преобразует текст в HTML-код. Служебные символы HTML («<», «>», ...) заменяются на сущности. 7 | Stroka EncodeHtmlPcdata(const TStringBuf& str, bool qAmp = true); 8 | 9 | // reverse of EncodeHtmlPcdata() 10 | Stroka DecodeHtmlPcdata(const Stroka& sz); 11 | -------------------------------------------------------------------------------- /util/string/printf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | /// formatted print. return printed length: 6 | int printf_format(2,0) vsprintf(Stroka& s, const char* c, va_list params); 7 | /// formatted print. return printed length: 8 | int printf_format(2,3) sprintf(Stroka& s, const char* c, ...); 9 | Stroka printf_format(1,2) Sprintf(const char* c, ...); 10 | int printf_format(2,3) fcat(Stroka& s, const char* c, ...); 11 | -------------------------------------------------------------------------------- /util/string/printf_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "printf.h" 2 | 3 | #include 4 | 5 | SIMPLE_UNIT_TEST_SUITE(TStringPrintf) { 6 | SIMPLE_UNIT_TEST(TestSprintf) { 7 | Stroka s; 8 | int len = sprintf(s, "Hello %s", "world"); 9 | UNIT_ASSERT_EQUAL(s, Stroka("Hello world")); 10 | UNIT_ASSERT_EQUAL(len, 11); 11 | } 12 | 13 | SIMPLE_UNIT_TEST(TestFcat) { 14 | Stroka s; 15 | int len = sprintf(s, "Hello %s", "world"); 16 | UNIT_ASSERT_EQUAL(s, Stroka("Hello world")); 17 | UNIT_ASSERT_EQUAL(len, 11); 18 | len = fcat(s, " qwqw%s", "as"); 19 | UNIT_ASSERT_EQUAL(s, Stroka("Hello world qwqwas")); 20 | UNIT_ASSERT_EQUAL(len, 7); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /util/string/scan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | template 6 | static inline void ScanKeyValue(TStringBuf s, F& f) 7 | { 8 | TStringBuf key, val; 9 | while (!s.Empty()) 10 | { 11 | val = s.NextTok(sep1); 12 | if (val.Empty()) 13 | continue; // && case 14 | 15 | key = val.NextTok(sep2); 16 | if (addAll || val.IsInited()) 17 | f(key, val); // includes empty keys 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /util/string/strip_ut.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/balancer/dc4ace0b9f72b0839a6e112f65ba288d81770118/util/string/strip_ut.cpp -------------------------------------------------------------------------------- /util/string/subst_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "subst.h" 2 | 3 | #include 4 | 5 | SIMPLE_UNIT_TEST_SUITE(TStringSubst) { 6 | SIMPLE_UNIT_TEST(TestSubstGlobal) { 7 | Stroka s; 8 | s = "aaa"; 9 | SubstGlobal(s, "a", "bb"); 10 | UNIT_ASSERT_EQUAL(s, Stroka("bbbbbb")); 11 | s = "aaa"; 12 | SubstGlobal(s, "a", "b"); 13 | UNIT_ASSERT_EQUAL(s, Stroka("bbb")); 14 | s = "aaa"; 15 | SubstGlobal(s, "a", ""); 16 | UNIT_ASSERT_EQUAL(s, Stroka("")); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /util/string/traits.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | template 8 | struct TCharStringTraits; 9 | 10 | template <> 11 | struct TCharStringTraits { 12 | typedef Stroka TString; 13 | typedef TStringBuf TBuffer; 14 | }; 15 | 16 | template <> 17 | struct TCharStringTraits { 18 | typedef Wtroka TString; 19 | typedef TWtringBuf TBuffer; 20 | }; 21 | -------------------------------------------------------------------------------- /util/string/type.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | bool IsSpace(const char* s, size_t len) throw (); 6 | 7 | /// Определяет, является ли строка набором пробельных символов. 8 | static inline bool IsSpace(const TStringBuf& s) throw () { 9 | return IsSpace(~s, +s); 10 | } 11 | 12 | /// Определяет, можно ли интерпретировать значение строки как арабское число. 13 | // Returns "true" if given string is number ([0-9]+) 14 | bool IsNumber(const TStringBuf& s) throw (); 15 | 16 | /// Возвращает 'true' если аргумент - одна из строк "yes", "on", "1", "true", "da". 17 | /// @details Регистр символов не учитывается. 18 | bool istrue(const TStringBuf& value); 19 | 20 | /// Возвращает 'false' если аргумент - одна из строк "no", "off", "0", "false", "net". 21 | /// @details Регистр символов не учитывается. 22 | bool isfalse(const TStringBuf& value); 23 | -------------------------------------------------------------------------------- /util/string/type_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "type.h" 2 | 3 | #include 4 | 5 | SIMPLE_UNIT_TEST_SUITE(TStringClassify) { 6 | SIMPLE_UNIT_TEST(TestIsSpace) { 7 | UNIT_ASSERT_EQUAL(IsSpace(" "), true); 8 | UNIT_ASSERT_EQUAL(IsSpace("\t\r\n"), true); 9 | UNIT_ASSERT_EQUAL(IsSpace(""), false); 10 | UNIT_ASSERT_EQUAL(IsSpace(" a"), false); 11 | } 12 | 13 | SIMPLE_UNIT_TEST(TestIsTrue) { 14 | UNIT_ASSERT(istrue("1")); 15 | UNIT_ASSERT(istrue("yes")); 16 | UNIT_ASSERT(istrue("YeS")); 17 | UNIT_ASSERT(istrue("on")); 18 | UNIT_ASSERT(istrue("true")); 19 | UNIT_ASSERT(istrue("da")); 20 | 21 | UNIT_ASSERT(!istrue(""));// istrue won't return true on empty strings anymore 22 | 23 | UNIT_ASSERT(!istrue("foobar")); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /util/system/atexit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defaults.h" 4 | 5 | typedef void (*TAtExitFunc)(void*); 6 | typedef void (*TTraditionalAtExitFunc)(); 7 | 8 | void AtExit(TAtExitFunc func, void* ctx); 9 | void AtExit(TAtExitFunc func, void* ctx, size_t priority); 10 | void AtExit(TTraditionalAtExitFunc func); 11 | -------------------------------------------------------------------------------- /util/system/atomic_fake.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef volatile intptr_t TAtomic; 4 | 5 | static inline intptr_t AtomicIncrement(TAtomic& p) { 6 | return ++p; 7 | } 8 | 9 | static inline intptr_t AtomicDecrement(TAtomic& p) { 10 | return --p; 11 | } 12 | 13 | static inline intptr_t AtomicAdd(TAtomic& p, intptr_t v) { 14 | return p += v; 15 | } 16 | 17 | static inline intptr_t AtomicSwap(TAtomic& p, intptr_t v) { 18 | intptr_t ret = p; 19 | p = v; 20 | return ret; 21 | } 22 | 23 | static inline bool AtomicCas(TAtomic* a, intptr_t exchange, intptr_t compare) { 24 | if (*a == compare) { 25 | *a = exchange; 26 | 27 | return true; 28 | } 29 | 30 | return false; 31 | } 32 | 33 | static inline void AtomicBarrier() { 34 | } 35 | -------------------------------------------------------------------------------- /util/system/atomic_gcc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef volatile intptr_t TAtomic; 4 | 5 | static inline intptr_t AtomicIncrement(TAtomic& p) { 6 | return __sync_add_and_fetch(&p, 1); 7 | } 8 | 9 | static inline intptr_t AtomicDecrement(TAtomic& p) { 10 | return __sync_sub_and_fetch(&p, 1); 11 | } 12 | 13 | static inline intptr_t AtomicAdd(TAtomic& p, intptr_t v) { 14 | return __sync_add_and_fetch(&p, v); 15 | } 16 | 17 | static inline intptr_t AtomicSwap(TAtomic& p, intptr_t v) { 18 | return __sync_lock_test_and_set(&p, v); 19 | } 20 | 21 | static inline bool AtomicCas(TAtomic* a, intptr_t exchange, intptr_t compare) { 22 | return __sync_bool_compare_and_swap(a, compare, exchange); 23 | } 24 | 25 | static inline void AtomicBarrier() { 26 | __sync_synchronize(); 27 | } 28 | -------------------------------------------------------------------------------- /util/system/backtrace.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defaults.h" 4 | 5 | class TOutputStream; 6 | 7 | size_t BackTrace(void** p, size_t len); 8 | 9 | struct TResolvedSymbol { 10 | const char* Name; 11 | void* NearestSymbol; 12 | }; 13 | 14 | TResolvedSymbol ResolveSymbol(void* sym, char* buf, size_t len); 15 | 16 | void FormatBackTrace(TOutputStream* out); 17 | void PrintBackTrace(); 18 | -------------------------------------------------------------------------------- /util/system/byteorder_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "byteorder.h" 2 | 3 | #include 4 | 5 | class TByteOrderTest: public TTestBase { 6 | UNIT_TEST_SUITE(TByteOrderTest); 7 | UNIT_TEST(TestSwap16) 8 | UNIT_TEST(TestSwap32) 9 | UNIT_TEST(TestSwap64) 10 | UNIT_TEST_SUITE_END(); 11 | private: 12 | inline void TestSwap16() { 13 | UNIT_ASSERT_EQUAL((ui16)0x1234, SwapBytes((ui16)0x3412)); 14 | } 15 | 16 | inline void TestSwap32() { 17 | UNIT_ASSERT_EQUAL(0x12345678, SwapBytes(0x78563412)); 18 | } 19 | 20 | inline void TestSwap64() { 21 | UNIT_ASSERT_EQUAL(0x1234567890abcdefULL, SwapBytes((ui64)ULL(0xefcdab9078563412))); 22 | } 23 | }; 24 | 25 | UNIT_TEST_SUITE_REGISTRATION(TByteOrderTest); 26 | -------------------------------------------------------------------------------- /util/system/compat_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "compat.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | SIMPLE_UNIT_TEST_SUITE(TCompatTest) { 9 | SIMPLE_UNIT_TEST(TestGetprogname) { 10 | getprogname(); // just check it links 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /util/system/context_i686.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define MJB_SP 4 4 | #define MJB_PC 5 5 | #define MJB_RSP MJB_SP 6 | 7 | typedef int __myjmp_buf[6]; 8 | -------------------------------------------------------------------------------- /util/system/context_x86.asm: -------------------------------------------------------------------------------- 1 | %macro EXPORT 1 2 | %ifdef DARWIN 3 | global _%1 4 | _%1: 5 | %else 6 | global %1 7 | %1: 8 | %endif 9 | %endmacro 10 | 11 | %ifdef _x86_64_ 12 | %include "context_x86_64.asm" 13 | %else 14 | %include "context_i686.asm" 15 | %endif 16 | -------------------------------------------------------------------------------- /util/system/context_x86.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(_x86_64_) 4 | #include "context_x86_64.h" 5 | #elif defined(_i386_) 6 | #include "context_i686.h" 7 | #else 8 | #error todo 9 | #endif 10 | 11 | extern "C" void __mylongjmp(__myjmp_buf env, int val) 12 | #if defined(__GNUC__) 13 | __attribute__ ((__noreturn__)) 14 | #endif 15 | ; 16 | 17 | extern "C" int __mysetjmp(__myjmp_buf env) 18 | #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 1))) 19 | __attribute__ ((__returns_twice__)) 20 | #endif 21 | ; 22 | -------------------------------------------------------------------------------- /util/system/context_x86_64.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define MJB_RSP 6 4 | #define MJB_PC 7 5 | 6 | typedef long int __myjmp_buf[8]; 7 | -------------------------------------------------------------------------------- /util/system/daemon.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace NDaemonMaker { 4 | enum ECloseDescriptors { 5 | closeAll = 0, 6 | closeStdIoOnly 7 | }; 8 | 9 | enum EStdIoDescriptors { 10 | openNone = 0, 11 | openDevNull, 12 | openYandexStd 13 | }; 14 | 15 | enum EChDir { 16 | chdirNone = 0, 17 | chdirRoot 18 | }; 19 | 20 | void MakeMeDaemon(ECloseDescriptors cd = closeAll, EStdIoDescriptors iod = openDevNull, EChDir chd = chdirRoot); 21 | void CloseFrom(int fd); 22 | } 23 | -------------------------------------------------------------------------------- /util/system/datetime_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "datetime.h" 2 | -------------------------------------------------------------------------------- /util/system/demangle.cpp: -------------------------------------------------------------------------------- 1 | #include "platform.h" 2 | 3 | #if defined(_win_) || defined(_darwin_) 4 | #define NO_CXXABI 5 | #endif 6 | 7 | #if !defined(NO_CXXABI) 8 | #include 9 | #include 10 | #endif 11 | 12 | #include "demangle.h" 13 | 14 | const char* TCppDemangler::Demangle(const char* name) { 15 | #if defined(NO_CXXABI) 16 | return name; 17 | #else 18 | int status; 19 | TmpBuf_.Reset(__cxxabiv1::__cxa_demangle(name, 0, 0, &status)); 20 | 21 | if (!TmpBuf_) { 22 | return name; 23 | } 24 | 25 | return TmpBuf_.Get(); 26 | #endif 27 | } 28 | -------------------------------------------------------------------------------- /util/system/demangle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class TCppDemangler { 7 | public: 8 | const char* Demangle(const char* name); 9 | 10 | private: 11 | THolder TmpBuf_; 12 | }; 13 | 14 | inline Stroka CppDemangle(const Stroka& name) { 15 | return TCppDemangler().Demangle(~name); 16 | } 17 | -------------------------------------------------------------------------------- /util/system/demangle_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "demangle.h" 2 | 3 | #include 4 | 5 | SIMPLE_UNIT_TEST_SUITE(TDemangleTest) { 6 | SIMPLE_UNIT_TEST(SimpleTest) { 7 | // just check it does not crash or leak 8 | CppDemangle("hello"); 9 | CppDemangle(""); 10 | CppDemangle("Sfsdf$dfsdfTTSFSDF23234::SDFS:FSDFSDF#$%"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /util/system/execpath.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Stroka; 4 | class TMappedFile; 5 | 6 | const Stroka& GetExecPath(); 7 | 8 | // Opens the program's binary for reading, if it still exists. Throws an exception on failure. 9 | TMappedFile* OpenExecFile(); 10 | -------------------------------------------------------------------------------- /util/system/execpath_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "execpath.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | SIMPLE_UNIT_TEST_SUITE(TExecPathTest) { 9 | SIMPLE_UNIT_TEST(TestIt) { 10 | Stroka execPath = GetExecPath(); 11 | 12 | try { 13 | UNIT_ASSERT(isexist(~execPath)); 14 | } catch (...) { 15 | Cerr << execPath << Endl; 16 | 17 | throw; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /util/system/flock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "error.h" 4 | #include "defaults.h" 5 | 6 | #if defined(_unix_) 7 | 8 | #include 9 | 10 | static inline int Flock(int fd, int op) { 11 | return flock(fd, op); 12 | } 13 | 14 | #else 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | #define LOCK_SH 1 /* shared lock */ 21 | #define LOCK_EX 2 /* exclusive lock */ 22 | #define LOCK_NB 4 /* don't block when locking */ 23 | #define LOCK_UN 8 /* unlock */ 24 | 25 | int Flock(void* hndl, int operation); 26 | int flock(int fd, int operation); 27 | int fsync(int fd); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /util/system/flock_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "flock.h" 2 | #include "tempfile.h" 3 | 4 | #include 5 | 6 | class TFileLockTest: public TTestBase { 7 | UNIT_TEST_SUITE(TFileLockTest); 8 | UNIT_TEST(TestFlock) 9 | UNIT_TEST_SUITE_END(); 10 | private: 11 | inline void TestFlock() { 12 | TTempFileHandle tmp("./file"); 13 | 14 | UNIT_ASSERT_EQUAL(Flock(tmp.GetHandle(), LOCK_EX), 0); 15 | UNIT_ASSERT_EQUAL(Flock(tmp.GetHandle(), LOCK_UN), 0); 16 | } 17 | }; 18 | 19 | UNIT_TEST_SUITE_REGISTRATION(TFileLockTest); 20 | -------------------------------------------------------------------------------- /util/system/fs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace NFs { 4 | int Remove(const char* name); 5 | int Rename(const char* oldName, const char* newName); 6 | void HardLinkOrCopy(const char* oldName, const char* newName); 7 | void Cat(const char* dstName, const char* srcName); 8 | void Copy(const char* oldName, const char* newName); 9 | } 10 | -------------------------------------------------------------------------------- /util/system/fstat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defaults.h" 4 | 5 | class TFile; 6 | class TFileHandle; 7 | class Stroka; 8 | 9 | struct TFileStat { 10 | 11 | ui32 Mode; /* protection */ 12 | ui32 Uid; /* user ID of owner */ 13 | ui32 Gid; /* group ID of owner */ 14 | 15 | ui64 NLinks; /* number of hard links */ 16 | ui64 Size; /* total size, in bytes */ 17 | 18 | time_t ATime; /* time of last access */ 19 | time_t MTime; /* time of last modification */ 20 | time_t CTime; /* time of last status change */ 21 | 22 | public: 23 | TFileStat(); 24 | explicit TFileStat(const TFile&); 25 | explicit TFileStat(const TFileHandle&); 26 | explicit TFileStat(const Stroka& f); 27 | }; 28 | -------------------------------------------------------------------------------- /util/system/hostname.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Stroka; 4 | 5 | const char* GetHostName(); 6 | const Stroka& HostName(); 7 | -------------------------------------------------------------------------------- /util/system/hostname_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "hostname.h" 2 | 3 | #include 4 | 5 | class THostNameTest: public TTestBase { 6 | UNIT_TEST_SUITE(THostNameTest); 7 | UNIT_TEST(Test1) 8 | UNIT_TEST_SUITE_END(); 9 | private: 10 | inline void Test1() { 11 | UNIT_ASSERT(*GetHostName() != '?'); 12 | } 13 | }; 14 | 15 | UNIT_TEST_SUITE_REGISTRATION(THostNameTest); 16 | -------------------------------------------------------------------------------- /util/system/info.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defaults.h" 4 | 5 | namespace NSystemInfo { 6 | size_t NumberOfCpus(); 7 | size_t CachedNumberOfCpus(); 8 | size_t LoadAverage(double* la, size_t len); 9 | size_t GetPageSize() throw (); 10 | } 11 | -------------------------------------------------------------------------------- /util/system/info_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "info.h" 2 | 3 | #include 4 | 5 | class TSysInfoTest: public TTestBase { 6 | UNIT_TEST_SUITE(TSysInfoTest); 7 | UNIT_TEST(TestNumberOfCpus) 8 | UNIT_TEST(TestGetPageSize) 9 | UNIT_TEST_SUITE_END(); 10 | private: 11 | inline void TestNumberOfCpus() { 12 | UNIT_ASSERT(NSystemInfo::NumberOfCpus() > 0); 13 | UNIT_ASSERT_EQUAL(NSystemInfo::NumberOfCpus(), NSystemInfo::CachedNumberOfCpus()); 14 | } 15 | 16 | inline void TestGetPageSize() { 17 | UNIT_ASSERT(NSystemInfo::GetPageSize() >= 4096); 18 | } 19 | }; 20 | 21 | UNIT_TEST_SUITE_REGISTRATION(TSysInfoTest); 22 | -------------------------------------------------------------------------------- /util/system/maxlen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #define MAXWORD_LEN 55 6 | #define MAXWORD_BUF 56 7 | 8 | #define MAXKEY_LEN 255 9 | #define MAXKEY_BUF 256 10 | 11 | // http://support.microsoft.com/kb/208427 12 | #define URL_MAXLEN 2083 13 | 14 | #define HOST_MAX 260 15 | #ifndef URL_MAX 16 | # define URL_MAX 1024 17 | #endif 18 | #define FULLURL_MAX (URL_MAX + HOST_MAX) 19 | #define ABSTRACT_MAX 1024 20 | 21 | #define LINKTEXT_MAX 1024 22 | 23 | #ifdef WIN32 24 | # ifndef PATH_MAX 25 | # define PATH_MAX _MAX_PATH 26 | # endif 27 | #else 28 | 29 | #ifndef MAX_PATH 30 | # define MAX_PATH PATH_MAX 31 | #endif 32 | 33 | #ifndef _MAX_PATH 34 | # define _MAX_PATH PATH_MAX 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /util/system/mktemp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | /* 6 | * Create temp file name in the specified directory. 7 | * If wrkDir is NULL or empty, P_tmpdir is used. 8 | * throw exception on error 9 | */ 10 | Stroka MakeTempName(const char* wrkDir = 0, const char* prefix = "yandex"); 11 | -------------------------------------------------------------------------------- /util/system/pipe_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "pipe.h" 2 | 3 | #include 4 | 5 | SIMPLE_UNIT_TEST_SUITE(TPipeTest) { 6 | SIMPLE_UNIT_TEST(TestPipe) { 7 | TPipe r; 8 | TPipe w; 9 | TPipe::Pipe(r, w); 10 | char c = 'a'; 11 | UNIT_ASSERT(1 == w.Write(&c, 1)); 12 | UNIT_ASSERT(1 == r.Read(&c, 1)); 13 | UNIT_ASSERT_VALUES_EQUAL('a', c); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /util/system/progname.cpp: -------------------------------------------------------------------------------- 1 | #include "execpath.h" 2 | #include "progname.h" 3 | 4 | #include 5 | #include 6 | 7 | static const char *Argv0; 8 | 9 | struct TProgramNameHolder { 10 | inline TProgramNameHolder() 11 | : ProgName(GetFileNameComponent(Argv0 ? Argv0 : ~GetExecPath())) 12 | { 13 | } 14 | 15 | Stroka ProgName; 16 | }; 17 | 18 | const Stroka& GetProgramName() { 19 | return Singleton()->ProgName; 20 | } 21 | 22 | void SetProgramName(const char *argv0) { 23 | Argv0 = argv0; 24 | } 25 | -------------------------------------------------------------------------------- /util/system/progname.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | void SetProgramName(const char *argv0); 6 | 7 | #define SAVE_PROGRAM_NAME do { SetProgramName(argv[0]); } while(0) 8 | 9 | /// guaranted return the same immutable instance of Stroka 10 | const Stroka& GetProgramName(); 11 | -------------------------------------------------------------------------------- /util/system/progname_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "progname.h" 2 | 3 | #include 4 | 5 | SIMPLE_UNIT_TEST_SUITE(TProgramNameTest) { 6 | SIMPLE_UNIT_TEST(TestIt) { 7 | Stroka progName = GetProgramName(); 8 | 9 | try { 10 | UNIT_ASSERT( 11 | progName.find("ut_util") != Stroka::npos 12 | || progName.find("util-system_ut") != Stroka::npos); 13 | } catch (...) { 14 | Cerr << progName << Endl; 15 | 16 | throw; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /util/system/rusage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | /// portable getrusage 8 | 9 | struct TRusage { 10 | // some fields may be zero if unsupported 11 | 12 | // RSS in bytes 13 | // returned value may be not accurate, see discussion 14 | // http://www.mail-archive.com/freebsd-stable@freebsd.org/msg77102.html 15 | ui64 Rss; 16 | TDuration Utime; 17 | TDuration Stime; 18 | 19 | TRusage() 20 | : Rss(0) 21 | { 22 | } 23 | 24 | void Fill(); 25 | 26 | static TRusage Get() { 27 | TRusage r; 28 | r.Fill(); 29 | return r; 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /util/system/rusage_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "rusage.h" 2 | 3 | #include 4 | 5 | SIMPLE_UNIT_TEST_SUITE(TRusageTest) { 6 | SIMPLE_UNIT_TEST(TestRusage) { 7 | TRusage r; 8 | // just check it returns something 9 | r.Fill(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /util/system/sem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defaults.h" 4 | 5 | #include 6 | 7 | class TSemaphore { 8 | public: 9 | TSemaphore(const char* name, ui32 maxFreeCount); 10 | ~TSemaphore() throw (); 11 | 12 | //Increase the semaphore counter. 13 | //Returns 'true' if the semaphore counter increased 14 | bool Release(); 15 | 16 | //Keep a thread held while the semaphore counter is equal 0. 17 | bool Acquire(); 18 | 19 | //Try to enter the semaphore gate. A non-blocking variant of Acquire. 20 | //Returns 'true' if the semaphore counter decreased 21 | bool TryAcquire(); 22 | 23 | private: 24 | class TImpl; 25 | THolder Impl_; 26 | }; 27 | -------------------------------------------------------------------------------- /util/system/tempfile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "fs.h" 4 | #include "file.h" 5 | 6 | #include 7 | 8 | class TTempFile { 9 | public: 10 | inline TTempFile(const Stroka& fname) 11 | : Name_(fname) 12 | { 13 | } 14 | 15 | inline ~TTempFile() throw () { 16 | NFs::Remove(~Name()); 17 | } 18 | 19 | inline const Stroka& Name() const throw () { 20 | return Name_; 21 | } 22 | 23 | private: 24 | const Stroka Name_; 25 | }; 26 | 27 | class TTempFileHandle: public TTempFile, public TFile { 28 | public: 29 | inline TTempFileHandle(const Stroka& fname) 30 | : TTempFile(fname) 31 | , TFile(Name(), CreateAlways | RdWr) 32 | { 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /util/system/user.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | Stroka GetUsername(); 6 | 7 | -------------------------------------------------------------------------------- /util/system/utime.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defaults.h" 4 | 5 | #ifdef _MSC_VER 6 | # include 7 | #else 8 | # include 9 | # include 10 | #endif 11 | 12 | inline int TouchFile(const char* filePath) { 13 | return utime(filePath, NULL); 14 | } 15 | 16 | inline int SetModTime(const char* filePath, time_t modtime, time_t actime) { 17 | struct utimbuf buf; 18 | buf.modtime = modtime; 19 | buf.actime = actime; 20 | return utime(filePath, &buf); 21 | } 22 | -------------------------------------------------------------------------------- /util/system/valgrind.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(WITH_VALGRIND) && defined(HAVE_VALGRIND) 4 | #include 5 | #include 6 | 7 | #if !defined(VALGRIND_CHECK_READABLE) 8 | #define VALGRIND_CHECK_READABLE(s, l) VALGRIND_CHECK_MEM_IS_DEFINED(s, l) 9 | #endif 10 | 11 | #if !defined(VALGRIND_MAKE_READABLE) 12 | #define VALGRIND_MAKE_READABLE(a, b) VALGRIND_MAKE_MEM_DEFINED(a, b) 13 | #endif 14 | #else 15 | #define RUNNING_ON_VALGRIND 0 16 | #define VALGRIND_CHECK_READABLE(s, l) 17 | #define VALGRIND_MAKE_READABLE(a, b) 0 18 | #define VALGRIND_STACK_REGISTER(start, end) 0 19 | #define VALGRIND_STACK_DEREGISTER(id) 20 | #define VALGRIND_DISCARD(v) ((void)v) 21 | static inline int VALGRIND_PRINTF(...) { 22 | return 0; 23 | } 24 | #define VALGRIND_DO_LEAK_CHECK 25 | #endif 26 | -------------------------------------------------------------------------------- /util/system/yassert_ut.cpp: -------------------------------------------------------------------------------- 1 | #undef NDEBUG 2 | // yassert.h must be included before all headers 3 | #include "yassert.h" 4 | 5 | #include 6 | 7 | SIMPLE_UNIT_TEST_SUITE(YassertTest) { 8 | SIMPLE_UNIT_TEST(TestAcsLikeFunctionCall) { 9 | if (true) 10 | YASSERT(true); // this cannot be compiled if YASSERT is "if (!cond) { ... }" 11 | else 12 | YASSERT(false); 13 | 14 | bool var = false; 15 | if (false) 16 | YASSERT(false); 17 | else 18 | var = true; // this is unreachable if YASSERT is "if (!cond) { ... }" 19 | UNIT_ASSERT(var); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /util/system/yield.cpp: -------------------------------------------------------------------------------- 1 | #include "platform.h" 2 | 3 | #ifdef _win_ 4 | #define WIN32_LEAN_AND_MEAN 5 | #define NOMINMAX 6 | #include 7 | #include 8 | #else 9 | #include 10 | #include 11 | #endif 12 | 13 | void SchedYield() throw () { 14 | #if defined(_unix_) 15 | sched_yield(); 16 | #else 17 | Sleep(0); 18 | #endif 19 | } 20 | 21 | void ThreadYield() throw () { 22 | #if defined(_mt_) 23 | #if defined(_freebsd_) 24 | pthread_yield(); 25 | #else 26 | SchedYield(); 27 | #endif 28 | #endif 29 | } 30 | -------------------------------------------------------------------------------- /util/system/yield.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void SchedYield() throw (); 4 | void ThreadYield() throw (); 5 | -------------------------------------------------------------------------------- /util/thread/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | ENABLE(NOUTIL) 4 | 5 | SRCS( 6 | lfqueue.h 7 | lfstack.h 8 | pool.cpp 9 | queue.cpp 10 | tasks.cpp 11 | threadable.h 12 | ) 13 | 14 | END() 15 | -------------------------------------------------------------------------------- /util/uri/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY(uri) 2 | 3 | ENABLE(NOUTIL) 4 | 5 | PEERDIR( 6 | util/charset 7 | util/generic 8 | util/memory 9 | util/stream 10 | util/string 11 | util/system 12 | ) 13 | 14 | IF (NOT WIN32) 15 | SET(WERROR yes) 16 | ENDIF (NOT WIN32) 17 | 18 | IF (SUN) 19 | SET_APPEND(PICFLAGS -fPIC) 20 | ENDIF (SUN) 21 | 22 | SRCS( 23 | assign.cpp 24 | common.cpp 25 | encode.cpp 26 | other.cpp 27 | parse.cpp 28 | uri.cpp 29 | ) 30 | 31 | SRCS( 32 | encode.rl 33 | parse.rl 34 | ) 35 | 36 | set_source_files_properties(encode.rl PROPERTIES 37 | RL6 TRUE 38 | GENERATE_SOURCE encode.rl.gen.cpp 39 | ) 40 | set_source_files_properties(parse.rl PROPERTIES 41 | RL6 TRUE 42 | GENERATE_SOURCE parse.rl.gen.cpp 43 | ) 44 | 45 | END() 46 | -------------------------------------------------------------------------------- /util/uri/encode.rl: -------------------------------------------------------------------------------- 1 | #include "encode.h" 2 | 3 | namespace NUri { 4 | namespace NEncode { 5 | 6 | %%{ 7 | machine TEncoder; 8 | 9 | hex = ( 10 | digit >{ HexDigit(fc); } | 11 | [A-F] >{ HexUpper(fc); } | 12 | [a-f] >{ HexLower(fc); } 13 | ); 14 | 15 | escaped = ( "%" hex hex ) 16 | > { HexReset(); } 17 | % { DoHex(); }; 18 | 19 | sym = ( (1..127) - "%") >{ DoSym(fc); }; 20 | 21 | exsym = (-128..0) >{ DoEx(fc); }; 22 | 23 | main := ( escaped | sym | exsym )*; 24 | 25 | write data; 26 | }%% 27 | 28 | void TEncoder::ReEncode(const TStringBuf &url) 29 | { 30 | const char *p = url.data(); 31 | const char *pe = p + url.length(); 32 | const char *eof = pe; 33 | int cs; 34 | 35 | %% write init; 36 | %% write exec; 37 | } 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /util/uri/uri-ru_ut.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/balancer/dc4ace0b9f72b0839a6e112f65ba288d81770118/util/uri/uri-ru_ut.cpp -------------------------------------------------------------------------------- /util/yarchive.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | class TArchiveWriter { 8 | public: 9 | TArchiveWriter(TOutputStream* out); 10 | ~TArchiveWriter() throw (); 11 | 12 | void Flush(); 13 | void Finish(); 14 | void Add(const Stroka& key, TInputStream* src); 15 | 16 | private: 17 | class TImpl; 18 | THolder Impl_; 19 | }; 20 | 21 | class TArchiveReader { 22 | public: 23 | TArchiveReader(const TBlob& data); 24 | ~TArchiveReader() throw (); 25 | 26 | size_t Count() const throw (); 27 | Stroka KeyByIndex(size_t n) const; 28 | TAutoPtr ObjectByKey(const Stroka& key) const; 29 | 30 | private: 31 | class TImpl; 32 | THolder Impl_; 33 | }; 34 | -------------------------------------------------------------------------------- /util/ycoroutine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /util/ysaveload.cpp: -------------------------------------------------------------------------------- 1 | #include "ysaveload.h" 2 | -------------------------------------------------------------------------------- /web/httpd/factory/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | 6 | web/httpd/modules/admin 7 | web/httpd/modules/balancer 8 | web/httpd/modules/ipdisp 9 | web/httpd/modules/headers 10 | web/httpd/modules/proxy 11 | web/httpd/modules/stats 12 | web/httpd/modules/errorlog 13 | web/httpd/modules/debug 14 | web/httpd/modules/static 15 | web/httpd/modules/regexp 16 | web/httpd/modules/accesslog 17 | web/httpd/modules/http 18 | web/httpd/modules/pinger 19 | web/httpd/modules/shared 20 | web/httpd/modules/tls 21 | web/httpd/modules/spdy 22 | ) 23 | 24 | SRCS( 25 | common.cpp 26 | ) 27 | 28 | END() 29 | -------------------------------------------------------------------------------- /web/httpd/factory/common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace NSrvKernel { 4 | class IModuleFactory; 5 | } 6 | 7 | namespace NModulesFactory { 8 | using namespace NSrvKernel; 9 | 10 | IModuleFactory* CommonModules(); 11 | } 12 | -------------------------------------------------------------------------------- /web/httpd/kernel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | util/server 5 | 6 | library/lua 7 | library/pire 8 | library/svnversion 9 | ) 10 | 11 | SRCS( 12 | main.cpp 13 | log.cpp 14 | chunks.cpp 15 | luacfg.cpp 16 | iobase.cpp 17 | socket.cpp 18 | iface.cpp 19 | regexp.cpp 20 | format.cpp 21 | headers.cpp 22 | alloc.cpp 23 | null.cpp 24 | httpfsm.rl 25 | http.cpp 26 | ) 27 | 28 | END() 29 | -------------------------------------------------------------------------------- /web/httpd/kernel/alloc.cpp: -------------------------------------------------------------------------------- 1 | #include "alloc.h" 2 | 3 | namespace NSrvKernel { 4 | TAllocator ALLOCATOR; 5 | } 6 | -------------------------------------------------------------------------------- /web/httpd/kernel/cast.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "chunks.h" 4 | 5 | namespace NSrvKernel { 6 | template 7 | static inline T FromString(const TChunkList& lst) { 8 | T ret = 0; 9 | 10 | for (TChunkList::TConstIterator it = lst.Begin(); it != lst.End(); ++it) { 11 | const char* b = it->Data(); 12 | const char* e = b + it->Length(); 13 | 14 | while (b != e) { 15 | ret = ret * T(10) + (T)(*b++ - '0'); 16 | } 17 | } 18 | 19 | return ret; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /web/httpd/kernel/chunks.cpp: -------------------------------------------------------------------------------- 1 | #include "chunks.h" 2 | 3 | #include 4 | 5 | using namespace NSrvKernel; 6 | 7 | template <> 8 | void Out(TOutputStream& o, const TChunk& p) { 9 | o.Write(p.Data(), p.Length()); 10 | } 11 | 12 | template <> 13 | void Out(TOutputStream& o, const TChunkList& lst) { 14 | for (TChunkList::TConstIterator it = lst.Begin(); it != lst.End(); ++it) { 15 | o << *it; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web/httpd/kernel/concat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "null.h" 4 | #include "iobase.h" 5 | 6 | namespace NSrvKernel { 7 | class TConcatInput: public IIoInput { 8 | public: 9 | inline TConcatInput(IIoInput* f, IIoInput* s) 10 | : F_(f) 11 | , S_(s) 12 | { 13 | } 14 | 15 | private: 16 | virtual void DoRecv(TChunkList& lst) { 17 | F_->Recv(lst); 18 | 19 | if (lst.Empty()) { 20 | F_ = S_; 21 | S_ = &TNullStream::Instance(); 22 | 23 | F_->Recv(lst); 24 | } 25 | } 26 | 27 | private: 28 | IIoInput* F_; 29 | IIoInput* S_; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /web/httpd/kernel/countio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "iobase.h" 4 | 5 | namespace NSrvKernel { 6 | class TCountOutput: public IIoOutput { 7 | public: 8 | inline TCountOutput(IIoOutput* slave) throw () 9 | : Slave_(slave) 10 | , Written_(0) 11 | { 12 | } 13 | 14 | inline size_t Written() const throw () { 15 | return Written_; 16 | } 17 | 18 | private: 19 | virtual void DoSend(TChunkList& lst) { 20 | Written_ += NSrvKernel::Send(Slave_, lst); 21 | } 22 | 23 | private: 24 | IIoOutput* Slave_; 25 | size_t Written_; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /web/httpd/kernel/errors.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace NSrvKernel { 7 | class THttpError: public yexception { 8 | public: 9 | inline THttpError(ui16 code) 10 | : Code_(code) 11 | { 12 | *this << STRINGBUF("(") << HttpCodeStr(code) << STRINGBUF(") "); 13 | } 14 | 15 | inline ui16 Code() const throw () { 16 | return Code_; 17 | } 18 | 19 | private: 20 | ui16 Code_; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /web/httpd/kernel/format.cpp: -------------------------------------------------------------------------------- 1 | #include "format.h" 2 | #include "address.h" 3 | 4 | #include 5 | 6 | using namespace NSrvKernel; 7 | 8 | template <> 9 | void Out(TOutputStream& o, const THostFormat& ip) { 10 | PrintHost(o, *ip.Addr); 11 | } 12 | -------------------------------------------------------------------------------- /web/httpd/kernel/format.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "address.h" 4 | 5 | namespace NSrvKernel { 6 | struct THostFormat { 7 | inline THostFormat(const IRemoteAddr* addr) throw () 8 | : Addr(addr) 9 | { 10 | } 11 | 12 | const IRemoteAddr* Addr; 13 | }; 14 | 15 | inline THostFormat FormatHost(const IRemoteAddr& addr) throw () { 16 | return THostFormat(&addr); 17 | } 18 | 19 | inline THostFormat FormatHost(const IRemoteAddr* addr) throw () { 20 | return THostFormat(addr); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /web/httpd/kernel/headers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace NSrvKernel { 6 | class TRequest; 7 | //TODO - inherit from common ancestor 8 | typedef TRequest TResponse; 9 | 10 | struct TResponseProperties { 11 | TResponseProperties(TResponse* r); 12 | 13 | bool ChunkedTransfer; 14 | size_t ContentLength; 15 | }; 16 | 17 | struct TRequestProperties { 18 | TRequestProperties(TRequest* r); 19 | 20 | bool KeepAlive; 21 | bool ChunkedTransfer; 22 | size_t ContentLength; 23 | }; 24 | 25 | void InitHeadersParser(); 26 | } 27 | -------------------------------------------------------------------------------- /web/httpd/kernel/iface.cpp: -------------------------------------------------------------------------------- 1 | #include "iface.h" 2 | 3 | #include 4 | 5 | using namespace NSrvKernel; 6 | 7 | void IModule::PrintStats(TOutputStream& out) { 8 | const char* name = Handle()->Name(); 9 | 10 | out << "<" << name << ">"; 11 | DoStats(out); 12 | out << ""; 13 | } 14 | 15 | void IModule::DoStats(TOutputStream&) { 16 | } 17 | -------------------------------------------------------------------------------- /web/httpd/kernel/limitio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "iobase.h" 4 | #include "split.h" 5 | 6 | namespace NSrvKernel { 7 | template 8 | class TLengthLimitedInput: public IIoInput { 9 | public: 10 | inline TLengthLimitedInput(IIoInput* s, size_t limit) 11 | : S_(s) 12 | , L_(limit) 13 | { 14 | } 15 | 16 | virtual void DoRecv(TChunkList& lst) { 17 | if (!L_) { 18 | TErr::OnErr(); 19 | 20 | return; 21 | } 22 | 23 | S_->Recv(lst); 24 | Cut(L_, lst); 25 | L_ -= lst.FullLength(); 26 | } 27 | 28 | private: 29 | IIoInput* S_; 30 | size_t L_; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /web/httpd/kernel/log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace NSrvKernel { 7 | class TSystemLog: public TLog { 8 | public: 9 | TSystemLog(); 10 | 11 | inline TSystemLog(const Stroka& name) { 12 | Open(name); 13 | } 14 | 15 | void Open(const Stroka& path); 16 | 17 | template 18 | inline TLogElement operator<< (const T& t) { 19 | TLogElement ret(this); 20 | 21 | LogPrefix(ret); 22 | ret << t; 23 | 24 | return ret; 25 | } 26 | 27 | private: 28 | void LogPrefix(TLogElement& s); 29 | 30 | private: 31 | TBuffer Buffer_; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /web/httpd/kernel/luacfg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "config.h" 4 | 5 | namespace NSrvKernel { 6 | TAutoPtr LuaConfigParser(TInputStream& in); 7 | } 8 | -------------------------------------------------------------------------------- /web/httpd/kernel/main.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class TInputStream; 4 | class TContExecutor; 5 | 6 | namespace NSrvKernel { 7 | class IModuleFactory; 8 | 9 | void RunMain(int argc, char** argv, IModuleFactory* loader); 10 | void RunMain(TInputStream& cfg, IModuleFactory* loader); 11 | void RunMain(TInputStream& cfg, TContExecutor* executor, IModuleFactory* loader); 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/kernel/null.cpp: -------------------------------------------------------------------------------- 1 | #include "null.h" 2 | 3 | #include 4 | 5 | using namespace NSrvKernel; 6 | 7 | TNullStream& TNullStream::Instance() throw () { 8 | return *Singleton(); 9 | } 10 | -------------------------------------------------------------------------------- /web/httpd/kernel/null.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "iobase.h" 4 | 5 | namespace NSrvKernel { 6 | class TNullStream: public IIoInput, public IIoOutput { 7 | public: 8 | static TNullStream& Instance() throw (); 9 | 10 | private: 11 | virtual void DoRecv(TChunkList&) { 12 | } 13 | 14 | virtual void DoSend(TChunkList&) { 15 | } 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /web/httpd/kernel/regexp.cpp: -------------------------------------------------------------------------------- 1 | #include "regexp.h" 2 | #include "chunks.h" 3 | 4 | namespace NSrvKernel { 5 | TMatcher& Match(TMatcher& m, const TChunkList& lst) throw () { 6 | for (TChunkList::TConstIterator it = lst.Begin(); it != lst.End(); ++it) { 7 | m.Match(it->Data(), it->Length()); 8 | } 9 | 10 | return m; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/kernel/regexp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace NSrvKernel { 6 | using namespace NRegExp; 7 | class TChunkList; 8 | 9 | TMatcher& Match(TMatcher& m, const TChunkList& lst) throw (); 10 | } 11 | -------------------------------------------------------------------------------- /web/httpd/modules/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | RECURSE( 2 | web/httpd/modules/admin 3 | web/httpd/modules/ipdisp 4 | web/httpd/modules/proxy 5 | web/httpd/modules/balancer 6 | web/httpd/modules/headers 7 | web/httpd/modules/proxy 8 | web/httpd/modules/stats 9 | web/httpd/modules/errorlog 10 | web/httpd/modules/debug 11 | web/httpd/modules/static 12 | web/httpd/modules/regexp 13 | web/httpd/modules/accesslog 14 | web/httpd/modules/http 15 | web/httpd/modules/pinger 16 | web/httpd/modules/shared 17 | web/httpd/modules/tls 18 | web/httpd/modules/spdy 19 | ) 20 | -------------------------------------------------------------------------------- /web/httpd/modules/accesslog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | ) 6 | 7 | SRCS( 8 | module.cpp 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /web/httpd/modules/accesslog/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NSrvKernel { 5 | class IModuleHandle; 6 | } 7 | 8 | namespace NModAccessLog { 9 | using namespace NSrvKernel; 10 | 11 | IModuleHandle* Handle(); 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/modules/admin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | library/svnversion 5 | web/httpd/kernel 6 | ) 7 | 8 | SRCS( 9 | fsm.rl 10 | module.cpp 11 | ) 12 | 13 | END() 14 | -------------------------------------------------------------------------------- /web/httpd/modules/admin/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NSrvKernel { 5 | class IModuleHandle; 6 | } 7 | 8 | namespace NModAdmin { 9 | using namespace NSrvKernel; 10 | 11 | IModuleHandle* Handle(); 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/modules/balancer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | ) 6 | 7 | SRCS( 8 | module.cpp 9 | fair.cpp 10 | weighted.cpp 11 | weighted2.cpp 12 | robust.cpp 13 | arbiter.cpp 14 | pidgroup.cpp 15 | iterator.cpp 16 | rrobin.cpp 17 | smartrr.cpp 18 | backend.cpp 19 | hashing.cpp 20 | ) 21 | 22 | END() 23 | -------------------------------------------------------------------------------- /web/httpd/modules/balancer/arbiter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defs.h" 4 | 5 | #include 6 | 7 | class Stroka; 8 | class TOutputStream; 9 | 10 | namespace NModBalancer { 11 | class IReAskArbiter { 12 | public: 13 | virtual ~IReAskArbiter() { 14 | } 15 | 16 | virtual void RegisterSucc() = 0; 17 | virtual void RegisterFail() = 0; 18 | virtual bool Authorize() const = 0; 19 | 20 | void PrintStats(TOutputStream& out) const; 21 | 22 | private: 23 | virtual void DoPrintStats(TOutputStream& out) const = 0; 24 | }; 25 | 26 | TAutoPtr ConstructArbiter(const Stroka& name, const TModuleParams& mp); 27 | } 28 | -------------------------------------------------------------------------------- /web/httpd/modules/balancer/backend.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defs.h" 4 | 5 | #include 6 | 7 | namespace NModBalancer { 8 | class TBackEndDescriptor { 9 | public: 10 | TBackEndDescriptor(const TModuleParams& mp); 11 | 12 | inline double Weight() const throw () { 13 | return Weight_; 14 | } 15 | 16 | inline IModule* Module() const throw () { 17 | return Module_.Get(); 18 | } 19 | 20 | private: 21 | double Weight_; 22 | TSharedPtr Module_; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /web/httpd/modules/balancer/defs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NSrvKernel { 5 | class IModule; 6 | class IConfig; 7 | class IModuleHandle; 8 | struct TModuleParams; 9 | struct TConnDescr; 10 | } 11 | 12 | namespace NModBalancer { 13 | using namespace NSrvKernel; 14 | 15 | class IBackEnds; 16 | } 17 | -------------------------------------------------------------------------------- /web/httpd/modules/balancer/fair.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defs.h" 4 | 5 | namespace NModBalancer { 6 | IBackEnds* CreateFair(const TModuleParams& mp); 7 | } 8 | -------------------------------------------------------------------------------- /web/httpd/modules/balancer/hashing.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defs.h" 4 | 5 | namespace NModBalancer { 6 | IBackEnds* CreateHashing(const TModuleParams& mp); 7 | } 8 | -------------------------------------------------------------------------------- /web/httpd/modules/balancer/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defs.h" 4 | 5 | namespace NModBalancer { 6 | IModuleHandle* Handle(); 7 | } 8 | -------------------------------------------------------------------------------- /web/httpd/modules/balancer/pidgroup.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defs.h" 4 | 5 | namespace NModBalancer { 6 | IBackEnds* CreatePIDGroup(const TModuleParams& mp); 7 | } 8 | -------------------------------------------------------------------------------- /web/httpd/modules/balancer/robust.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defs.h" 4 | 5 | namespace NModBalancer { 6 | IBackEnds* CreateRobust(const TModuleParams& mp); 7 | } 8 | -------------------------------------------------------------------------------- /web/httpd/modules/balancer/rrobin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defs.h" 4 | 5 | namespace NModBalancer { 6 | IBackEnds* CreateRoundRobin(const TModuleParams& mp); 7 | } 8 | -------------------------------------------------------------------------------- /web/httpd/modules/balancer/smartrr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defs.h" 4 | 5 | namespace NModBalancer { 6 | IBackEnds* CreateSmartRoundRobin(const TModuleParams& mp); 7 | } 8 | -------------------------------------------------------------------------------- /web/httpd/modules/balancer/weighted.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defs.h" 4 | 5 | namespace NModBalancer { 6 | IBackEnds* CreateWeighted(const TModuleParams& mp); 7 | } 8 | -------------------------------------------------------------------------------- /web/httpd/modules/balancer/weighted2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "defs.h" 4 | 5 | namespace NModBalancer { 6 | IBackEnds* CreateWeighted2(const TModuleParams& mp); 7 | } 8 | -------------------------------------------------------------------------------- /web/httpd/modules/debug/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | ) 6 | 7 | SRCS( 8 | module.cpp 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /web/httpd/modules/debug/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NSrvKernel { 5 | class IModuleHandle; 6 | } 7 | 8 | namespace NModDebug { 9 | using namespace NSrvKernel; 10 | 11 | IModuleHandle* Handle(); 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/modules/errorlog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | ) 6 | 7 | SRCS( 8 | module.cpp 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /web/httpd/modules/errorlog/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NSrvKernel { 5 | class IModuleHandle; 6 | } 7 | 8 | namespace NModErrorLog { 9 | using namespace NSrvKernel; 10 | 11 | IModuleHandle* Handle(); 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/modules/headers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | ) 6 | 7 | SRCS( 8 | module.cpp 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /web/httpd/modules/headers/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace NSrvKernel { 4 | class IModuleHandle; 5 | } 6 | 7 | namespace NModHeaders { 8 | using namespace NSrvKernel; 9 | 10 | IModuleHandle* Handle(); 11 | } 12 | -------------------------------------------------------------------------------- /web/httpd/modules/http/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | ) 6 | 7 | SRCS( 8 | module.cpp 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /web/httpd/modules/http/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NSrvKernel { 5 | class IModuleHandle; 6 | } 7 | 8 | namespace NModHttp { 9 | using namespace NSrvKernel; 10 | 11 | IModuleHandle* Handle(); 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/modules/ipdisp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | ) 6 | 7 | SRCS( 8 | module.cpp 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /web/httpd/modules/ipdisp/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NSrvKernel { 5 | class IModuleHandle; 6 | } 7 | 8 | namespace NModIpDispatch { 9 | using namespace NSrvKernel; 10 | 11 | IModuleHandle* Handle(); 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/modules/pinger/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | #TODO - refactor common code 6 | web/httpd/modules/balancer 7 | ) 8 | 9 | SRCS( 10 | module.cpp 11 | ) 12 | 13 | END() 14 | -------------------------------------------------------------------------------- /web/httpd/modules/pinger/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NSrvKernel { 5 | class IModuleHandle; 6 | } 7 | 8 | namespace NModPinger { 9 | using namespace NSrvKernel; 10 | 11 | IModuleHandle* Handle(); 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/modules/proxy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | ) 6 | 7 | SRCS( 8 | module.cpp 9 | proxy.cpp 10 | ) 11 | 12 | END() 13 | -------------------------------------------------------------------------------- /web/httpd/modules/proxy/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NSrvKernel { 5 | class IModuleHandle; 6 | } 7 | 8 | namespace NModProxy { 9 | using namespace NSrvKernel; 10 | 11 | IModuleHandle* Handle(); 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/modules/proxy/proxy.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class TContExecutor; 6 | 7 | namespace NSrvKernel { 8 | class IIoInput; 9 | class IIoOutput; 10 | 11 | struct TProxy { 12 | void Run(); 13 | 14 | TContExecutor* E; 15 | IIoInput* CI; 16 | IIoOutput* CO; 17 | IIoInput* BI; 18 | IIoOutput* BO; 19 | bool FailOnEmptyReply; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /web/httpd/modules/regexp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | ) 6 | 7 | SRCS( 8 | module.cpp 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /web/httpd/modules/regexp/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NSrvKernel { 5 | class IModuleHandle; 6 | } 7 | 8 | namespace NModRegexp { 9 | using namespace NSrvKernel; 10 | 11 | IModuleHandle* Handle(); 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/modules/regexp/optvalue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum EOptionValue { 4 | OV_DEFAULT, 5 | OV_FALSE, 6 | OV_TRUE, 7 | }; 8 | 9 | inline bool CalcOptionValue(EOptionValue value, bool defaultValue) { 10 | switch (value) { 11 | case OV_DEFAULT: 12 | return defaultValue; 13 | case OV_FALSE: 14 | return false; 15 | case OV_TRUE: 16 | return true; 17 | } 18 | 19 | assert(false); 20 | 21 | return false; 22 | } 23 | 24 | inline EOptionValue OptionValue(bool value) { 25 | return value ? OV_TRUE : OV_FALSE; 26 | } 27 | -------------------------------------------------------------------------------- /web/httpd/modules/shared/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | ) 6 | 7 | SRCS( 8 | module.cpp 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /web/httpd/modules/shared/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NSrvKernel { 5 | class IModuleHandle; 6 | } 7 | 8 | namespace NModShared { 9 | using namespace NSrvKernel; 10 | 11 | IModuleHandle* Handle(); 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/modules/spdy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | ) 6 | 7 | SRCS( 8 | module.cpp 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /web/httpd/modules/spdy/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace NSrvKernel { 4 | class IModuleHandle; 5 | } 6 | 7 | namespace NModSpdy { 8 | using namespace NSrvKernel; 9 | 10 | IModuleHandle* Handle(); 11 | } 12 | -------------------------------------------------------------------------------- /web/httpd/modules/static/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | ) 6 | 7 | SRCS( 8 | module.cpp 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /web/httpd/modules/static/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NSrvKernel { 5 | class IModuleHandle; 6 | } 7 | 8 | namespace NModStatic { 9 | using namespace NSrvKernel; 10 | 11 | IModuleHandle* Handle(); 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/modules/stats/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | ) 6 | 7 | SRCS( 8 | module.cpp 9 | ) 10 | 11 | END() 12 | -------------------------------------------------------------------------------- /web/httpd/modules/stats/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NSrvKernel { 5 | class IModuleHandle; 6 | } 7 | 8 | namespace NModStatistics { 9 | using namespace NSrvKernel; 10 | 11 | IModuleHandle* Handle(); 12 | } 13 | -------------------------------------------------------------------------------- /web/httpd/modules/tls/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | LIBRARY() 2 | 3 | PEERDIR( 4 | web/httpd/kernel 5 | contrib/libs/matrixssl 6 | ) 7 | 8 | SRCS( 9 | tlsio.cpp 10 | module.cpp 11 | ) 12 | 13 | END() 14 | -------------------------------------------------------------------------------- /web/httpd/modules/tls/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace NSrvKernel { 4 | class IModuleHandle; 5 | } 6 | 7 | namespace NModTls { 8 | using namespace NSrvKernel; 9 | 10 | IModuleHandle* Handle(); 11 | } 12 | -------------------------------------------------------------------------------- /web/httpd/modules/tls/tlsio.cpp: -------------------------------------------------------------------------------- 1 | #include "tlsio.h" 2 | 3 | #include 4 | #include 5 | 6 | using namespace NTls; 7 | 8 | TCerts NTls::ReadCert(const Stroka& fname) { 9 | TCerts ret; 10 | Stroka cur; 11 | Stroka line; 12 | 13 | TBufferedFileInput fi(fname); 14 | 15 | while (fi.ReadLine(line)) { 16 | if (line.find("----") == Stroka::npos) { 17 | cur += line; 18 | } else if (!!cur) { 19 | ret.push_back(Base64Decode(cur)); 20 | cur.clear(); 21 | } 22 | } 23 | 24 | if (ret.empty()) { 25 | ythrow yexception() << STRINGBUF("can not parse ") << fname; 26 | } 27 | 28 | return ret; 29 | } 30 | -------------------------------------------------------------------------------- /web/httpd/server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROGRAM(fhttpd) 2 | 3 | OWNER(pg) 4 | 5 | PEERDIR( 6 | web/httpd/kernel 7 | web/httpd/factory 8 | library/gettimeofday 9 | ) 10 | 11 | SRCS( 12 | main.cpp 13 | ) 14 | 15 | END() 16 | -------------------------------------------------------------------------------- /web/httpd/server/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | using namespace NSrvKernel; 8 | using namespace NModulesFactory; 9 | 10 | int main(int argc, char** argv) { 11 | try { 12 | RunMain(argc, argv, CommonModules()); 13 | 14 | return 0; 15 | } catch (...) { 16 | Cerr << CurrentExceptionMessage() << Endl; 17 | } 18 | 19 | return 1; 20 | } 21 | --------------------------------------------------------------------------------